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 Add extends Edit 35 { 36 38 40 42 44 46 public Add() 48 { 49 todo = new Todo(0, 1, 1, ""); 50 } 51 52 protected String doExecute() 53 { 54 try 55 { 56 TodoManager todoMgr = (TodoManager)manager.getManager(TodoManager.class.getName()); 57 58 if (message != null && (type == 1 || type == 2)) 59 { 60 todo.message = message; 61 todo.type = type; 62 todo.priority = priority; 63 64 todoMgr.addTodo(todo); 65 66 return SUCCESS; 67 } 68 } 69 catch (Exception e) 70 { 71 e.printStackTrace(); 72 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 73 return ERROR; 74 } 75 76 return INPUT; 77 } 78 } 79 | Popular Tags |