1 19 20 package com.lutris.airsent.presentation; 21 22 import com.lutris.appserver.server.httpPresentation.*; 23 import com.lutris.appserver.server.session.*; 24 import com.lutris.util.*; 25 import org.enhydra.xml.xmlc.XMLObject; 28 import org.w3c.dom.*; 29 import org.w3c.dom.html.*; 30 import java.util.Date ; 31 import com.lutris.airsent.presentation.BasePO; 32 33 39 public class Welcome extends BasePO { 40 41 44 private static final int AUTH_LEVEL = AirSentConstants.UNAUTH_USER; 45 46 52 public int getRequiredAuthLevel() { 53 return AUTH_LEVEL; 54 } 55 56 59 public XMLObject handleDefault() throws HttpPresentationException { 60 return showPage(null); 61 } 62 63 69 public XMLObject handleThrowException() throws Exception { 70 throw new Exception ("This is a test exception thrown from Login.java handleThrowException()"); 71 } 72 73 79 public XMLObject showPage(String errorMsg) 80 throws AirSentPresentationException { 81 WelcomeHTML page = (WelcomeHTML) getComms().xmlcFactory.create(WelcomeHTML.class); 82 83 try { 84 if (null != errorMsg || null != (errorMsg = getSessionData().getAndClearUserMessage())) { 85 page.setTextErrorText(errorMsg); 86 } else { 87 page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText()); 88 } 89 } catch (Exception ex) { 90 throw new AirSentPresentationException("Trouble getting current authorization level", ex); 91 } 92 return page; 94 } 96 } 97 98 | Popular Tags |