1 25 26 29 package net.killingar.forum.actions.strip; 30 31 import net.killingar.forum.internal.Comic; 32 33 public class Delete extends net.killingar.forum.actions.comic.ActionComicsSupport 34 { 35 37 net.killingar.forum.internal.Strip strip; 39 Comic comic; 40 boolean confirmed; 41 String url; 42 43 45 47 public void setStripID(long stripID) 49 { 50 try 51 { 52 strip = comicmgr.getStrip(stripID); 53 comic = comicmgr.getComic(strip.getParentID()); 54 } 55 catch (Exception e) 56 { 57 strip = null; 58 } 59 } 60 public void setConfirmed(boolean in) { confirmed = in; } 61 62 public net.killingar.forum.internal.Strip getStrip() { return strip; } 64 public Comic getComic() { return comic; } 65 public long getComicId() { return comic.ID; } 66 public String getUrl() { return url; } 67 68 protected String doExecute() 70 { 71 if (strip == null) 72 { 73 addErrorMessage("strip not found"); 74 return ERROR; 75 } 76 77 try 78 { 79 if (!confirmed) 80 { 81 url = (optionmgr.get("use cached comics") != null && strip.localURL != null)? strip.localURL: strip.URL; 82 return INPUT; 83 } 84 85 comicmgr.removeStrip(strip.ID); 86 } 87 catch (Exception e) 88 { 89 e.printStackTrace(); 90 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 91 return ERROR; 92 } 93 94 return SUCCESS; 95 } 96 } 97 | Popular Tags |