1 19 20 package com.lutris.airsent.presentation.messenger; 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.XMLCUtil; 27 import org.enhydra.xml.xmlc.XMLObject; 28 import org.w3c.dom.*; 29 import java.util.Date ; 30 import com.lutris.airsent.presentation.AirSentConstants; 31 import com.lutris.airsent.presentation.DeviceBasePO; 32 import com.lutris.airsent.presentation.DeviceUtils; 33 import com.lutris.airsent.presentation.AirSentPresentationException; 34 import java.lang.reflect.Method ; 35 36 43 public class MessengerMain extends DeviceBasePO { 44 45 48 private static final int AUTH_LEVEL = AirSentConstants.UNAUTH_USER; 49 50 56 public int getRequiredAuthLevel() { 57 return AUTH_LEVEL; 58 } 59 60 66 public XMLObject handleDefault() throws HttpPresentationException { 67 return showPage(null); 68 } 69 70 77 public XMLObject showPage(String errorMsg) 78 throws HttpPresentationException { 79 Class tempClass=null; 80 Object page= null; 81 Method setTextErrorText = null; 82 83 try{ 84 Class stringClass=Class.forName("java.lang.String"); 85 tempClass = Class.forName(DeviceUtils.getPageName(myComms, "com.lutris.airsent.presentation.messenger.MessengerMain")); 86 page= myComms.xmlcFactory.create(tempClass); 87 Class [] argTypeArr={stringClass}; 88 setTextErrorText = tempClass.getMethod("setTextErrorText",argTypeArr); 89 }catch(Exception e){} 90 91 94 try { 95 if (null != errorMsg 96 || null 97 != (errorMsg = 98 this.getSessionData().getAndClearUserMessage())) { 99 Object [] temp={errorMsg}; 100 setTextErrorText.invoke(page,temp); 101 } else { 103 Object [] temp={""}; 104 setTextErrorText.invoke(page,temp); 105 } 107 } catch (Exception e) { 108 throw new AirSentPresentationException("Exception showing main page: ", 109 e); 110 } 111 DeviceUtils.setURLTimeStamp((XMLObject)page); 112 return ((XMLObject)page); 113 } 114 115 } 116 117 118 119 120 121 122 | Popular Tags |