1 25 26 29 package net.killingar.forum.actions.task; 30 31 import net.killingar.forum.internal.Task; 32 33 public class Add extends ActionTaskSupport 34 { 35 37 private String name; 39 private long group = -1; 40 private String description; 41 String folder; 42 43 45 public void setName(String inName) { name = inName; } 47 public void setDescription(String in) { description = in; } 48 public void setFolder(String in) { folder = in; } 49 public void setGroup(long inGroup) { group = inGroup; } 50 51 public String getName () { return name; } 53 public String getDescription () { return description; } 54 public String getFolder () { return folder; } 55 public long getGroup() { return group; } 56 57 protected String doExecute() 59 { 60 try 61 { 62 if (name == null) 63 return INPUT; 64 65 Task task = new Task(group, name, description, folder); 66 taskMgr.addTask(task); 67 } 68 catch (Exception e) 69 { 70 e.printStackTrace(); 71 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 72 return ERROR; 73 } 74 75 return SUCCESS; 76 } 77 } 78 | Popular Tags |