1 25 26 29 package net.killingar.forum.actions.comic; 30 31 import net.killingar.forum.internal.Comic; 32 33 public class Edit extends ActionComicsSupport 34 { 35 37 Comic comic = new Comic(); 39 boolean confirmed = false; 40 41 43 45 public void setComicID(long in) { comic.ID = in; } 47 public void setConfirmed(boolean in) {confirmed = in; } 48 49 public Comic getComic() { return comic; } 51 52 protected String doExecute() 54 { 55 try 56 { 57 if (!confirmed) 58 { 59 comic = comicmgr.getComic(comic.ID); 60 return INPUT; 61 } 62 else 63 { 64 Comic c = comicmgr.getComic(comic.ID); 65 c.name = comic.name; 66 c.URL = comic.URL; 67 c.system = comic.system; 68 c.position = comic.position; 69 c.firstID = comic.firstID; 70 comicmgr.changeComic(c); 71 comic = c; 72 73 return SUCCESS; 74 } 75 } 76 catch (Exception e) 77 { 78 e.printStackTrace(); 79 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 80 return ERROR; 81 } 82 } 83 } 84 | Popular Tags |