1 25 26 package net.killingar.forum.actions.wiki; 27 28 import net.killingar.forum.actions.ActionForumSupport; 29 import net.killingar.forum.internal.managers.TimeManager; 30 31 public class SetUserTime extends ActionForumSupport 32 { 33 String wiki; 35 String context; 36 boolean allContexts = false; 37 38 public void setWiki(String in) { wiki = in; } 40 public void setContext(String in) { context = in; } 41 public void setAllContexts(boolean in) { allContexts = in; } 42 43 45 protected String doExecute() 46 { 47 try 48 { 49 TimeManager timemgr = (TimeManager)manager.getManager(TimeManager.class.getName()); 50 51 if (allContexts) 52 timemgr.setUserTime(TimeManager.systemWiki); 53 54 if (context != null) 55 { 56 timemgr.setUserTime("wiki/"+context); 57 if (wiki != null) 58 timemgr.setUserTime("wiki/"+context+"/"+wiki); 59 } 60 } 61 catch (Exception e) 62 { 63 e.printStackTrace(); 64 addErrorMessage("failed to set time, exception thrown: "+e); 65 66 return ERROR; 67 } 68 69 return SUCCESS; 70 } 71 } 72 | Popular Tags |