1 25 26 29 package net.killingar.forum.actions.areagroup; 30 31 import net.killingar.forum.actions.Utils; 32 import net.killingar.forum.internal.AreaGroup; 33 34 import java.util.ArrayList ; 35 import java.util.List ; 36 37 public class Add extends net.killingar.forum.actions.area.ActionAreaSupport 38 { 39 41 AreaGroup areagroup = new AreaGroup(); 43 boolean confirmed = false; 44 List areaGroups = new ArrayList (); 45 46 48 50 public void setAreaGroupID(long in) { areagroup.ID = in; } 52 public void setConfirmed(boolean in) {confirmed = in; } 53 54 public AreaGroup getAreaGroup() { return areagroup; } 56 public List getAreaGroups() { return areaGroups; } 57 58 protected String doExecute() 60 { 61 try 62 { 63 if (!confirmed) 64 { 65 AreaGroup[] areaGroups = areamgr.getAreaGroups(); 66 long indents[] = new long[areaGroups.length]; 67 Utils.buildFlatTree(areaGroups, indents); 68 69 for (int i = 0; i < areaGroups.length; i++) 70 this.areaGroups.add(new net.killingar.forum.actions.areagroup.List.AreaGroupData(areaGroups[i], false, indents[i])); 72 return INPUT; 73 } 74 else 75 { 76 areamgr.addAreaGroup(areagroup); 77 78 return SUCCESS; 79 } 80 } 81 catch (Exception e) 82 { 83 e.printStackTrace(); 84 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 85 return ERROR; 86 } 87 } 88 } 89 | Popular Tags |