1 25 26 29 package net.killingar.forum.actions.planning; 30 31 import net.killingar.forum.internal.Event; 32 import net.killingar.forum.internal.managers.PlanningManager; 33 34 public class Remove extends ActionPlanningSupport 35 { 36 38 long eventID = -1; 40 boolean confirmed = false; 41 Event event; 42 43 45 public void setEvent(long inEvent) { eventID = inEvent; } 47 public void setConfirmed(boolean inConfirmed) { confirmed = inConfirmed; } 48 49 public long getEvent() { return eventID; } 51 public String getName() { return event.getName(); } 52 53 protected String doExecute() 55 { 56 try 57 { 58 PlanningManager planningMgr = (PlanningManager)manager.getManager(PlanningManager.class.getName()); 59 60 if (eventID == -1) 61 { 62 addErrorMessage("no event id specified"); 63 return ERROR; 64 } 65 66 event = planningMgr.getEvent(eventID); 67 68 if (!confirmed) 69 return INPUT; 70 71 planningMgr.removeEvent(eventID); 72 } 73 catch (Exception e) 74 { 75 e.printStackTrace(); 76 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 77 return ERROR; 78 } 79 80 return SUCCESS; 81 } 82 } 83 | Popular Tags |