1 25 26 29 package net.killingar.forum.actions.todo; 30 31 import net.killingar.forum.internal.Todo; 32 import net.killingar.forum.internal.managers.TodoManager; 33 34 public class Delete extends ActionTodoSupport 35 { 36 38 long todoID; 40 boolean confirmed = false; 41 Todo todo; 42 43 45 public void setTodoID(long in) { todoID = in; } 47 public void setConfirmed(boolean in) { confirmed = in; } 48 49 public Todo getTodo() { return todo; } 51 52 protected String doExecute() 54 { 55 try 56 { 57 TodoManager todoMgr = (TodoManager)manager.getManager(TodoManager.class.getName()); 58 59 if (confirmed) 60 { 61 todoMgr.removeTodo(todoID); 62 return SUCCESS; 63 } 64 else 65 { 66 todo = todoMgr.getTodo(todoID); 67 return INPUT; 68 } 69 } 70 catch (Exception e) 71 { 72 e.printStackTrace(); 73 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 74 return ERROR; 75 } 76 } 77 } 78 | Popular Tags |