1 10 package net.sourceforge.ejosa.piggybank.presentation.enhydra; 11 12 import com.lutris.appserver.server.Enhydra; 13 import com.lutris.appserver.server.httpPresentation.*; 14 import com.lutris.appserver.server.user.User; 15 16 import com.lutris.logging.*; 17 18 import com.lutris.util.KeywordValueException; 19 20 23 import java.lang.Throwable ; 24 import java.lang.reflect.*; 25 26 import java.text.*; 27 28 import java.util.*; 29 30 import org.openuss.presentation.enhydra.framework.*; 31 32 import org.openuss.utility.*; 33 34 import org.w3c.dom.*; 35 import org.w3c.dom.html.*; 36 37 38 45 abstract public class FoundationPO extends BasePO implements HttpPresentation, 46 BaseLayout { 47 protected static String MAIN_PAGE = "/Welcome.po"; 48 49 52 protected FoundationSessionData mySessionData = null; 53 54 58 public FoundationSessionData getSessionData() { 59 return this.mySessionData; 60 } 61 62 65 public void removeAllSessionData() { 66 this.getSessionData().getAndClearUserMessage(); 67 } 68 69 72 public void setLocale(Locale locale) throws FoundationPOException { 73 this.getSessionData().setLocale(locale); 74 } 75 76 79 public Locale getLocale() { 80 return this.getSessionData().getLocale(); 81 } 82 83 87 public boolean isForPublicAccess() throws BasePOException { 88 return true; 93 } 94 95 98 public void run(HttpPresentationComms comms) throws Exception { 99 initSessionData(comms); 101 102 103 checkSecurity(); 105 106 107 handleEvent(comms); 109 } 110 111 115 protected void initSessionData(HttpPresentationComms comms) 116 throws FoundationPOException { 117 this.myComms = comms; 118 119 try { 120 Object obj = comms.sessionData.get( 121 FoundationSessionData.SESSION_KEY); 122 123 if (null != obj) { 125 this.mySessionData = (FoundationSessionData) obj; 126 } else { 127 this.mySessionData = new FoundationSessionData(); 129 comms.sessionData.set(FoundationSessionData.SESSION_KEY, 130 this.mySessionData); 131 } 132 } catch (KeywordValueException ex) { 133 writeDebugMsg("Problem getting session data from session: " + 134 ex.getMessage()); 135 } 136 } 137 138 142 protected void checkForUserLogin() throws ClientPageRedirectException, 143 FoundationPOException { 144 } 146 147 151 protected void checkForAccessList() throws ClientPageRedirectException, 152 FoundationPOException { 153 } 155 156 159 protected void checkSecurity() throws Exception { 160 if (this.loggedInUserRequired()) { 162 checkForUserLogin(); 163 } 164 } 165 166 170 public void showTreebar(Object page) throws BasePOException { 171 } 173 174 178 public void showUpdatedDate(Object page) throws BasePOException { 179 } 181 182 187 public String showLayout(Object page) throws BasePOException { 188 return null; 190 } 191 } | Popular Tags |