1 25 26 29 package net.killingar.forum.actions.task; 30 31 import net.killingar.forum.internal.Task; 32 33 public class Edit extends ActionTaskSupport 34 { 35 37 private long taskID; 39 40 String name; 41 long group = -1; 42 String description; 43 String folder; 44 45 47 public void setTask(long inTask) { taskID = inTask; } 49 public void setName(String inName) { name = inName; } 50 public void setDescription(String in) { description = in; } 51 public void setFolder(String in) { folder = in; } 52 public void setGroup(long inGroup) { group = inGroup; } 53 54 public long getTask() { return taskID; } 56 public String getName () { return name; } 57 public String getDescription () { return description; } 58 public String getFolder () { return folder; } 59 public long getGroup() { return group; } 60 61 protected String doExecute() 63 { 64 try 65 { 66 Task task = taskMgr.getTask(taskID); 67 68 if (name == null || group == -1) 69 { 70 name = task.name; 71 group = task.groupID; 72 description = task.description; 73 folder = task.folder; 74 75 return INPUT; 76 } 77 78 task.name = name; 79 task.groupID = group; 80 task.description = description; 81 task.folder = folder; 82 83 taskMgr.changeTask(task); 84 } 85 catch (Exception e) 86 { 87 e.printStackTrace(); 88 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 89 return ERROR; 90 } 91 92 return SUCCESS; 93 } 94 } 95 | Popular Tags |