KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > airsent > presentation > messenger > MessengerMain


1 /*
2  * Copyright (c) 1999-2001 Lutris Technologies, Inc. All Rights
3  * Reserved.
4  *
5  * This source code file is distributed by Lutris Technologies, Inc. for
6  * use only by licensed users of product(s) that include this source
7  * file. Use of this source file or the software that uses it is covered
8  * by the terms and conditions of the Lutris Enhydra Development License
9  * Agreement included with this product.
10  *
11  * This Software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
12  * ANY KIND, either express or implied. See the License for the specific terms
13  * governing rights and limitations under the License.
14  *
15  * Contributor(s):
16  *
17  * $Id: MessengerMain.java,v 1.1 2004/08/16 09:33:18 slobodan Exp $
18  */

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 com.lutris.xml.xmlc.*;
26
import org.enhydra.xml.xmlc.XMLCUtil;
27 import org.enhydra.xml.xmlc.XMLObject;
28 import org.w3c.dom.*;
29 import java.util.Date JavaDoc;
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 JavaDoc;
35
36 /**
37  * MessengerMain.java is the Main Directory page for the Messenger portion
38  * of the AirSent app.
39  *
40  * @author
41  * @version
42  */

43 public class MessengerMain extends DeviceBasePO {
44
45     /**
46      * Constants
47      */

48     private static final int AUTH_LEVEL = AirSentConstants.UNAUTH_USER;
49
50     /**
51      * Superclass method override.
52      * returns the authorization level necessary to access this po.
53      *
54      * @return int required authorization level
55      */

56     public int getRequiredAuthLevel() {
57     return AUTH_LEVEL;
58     }
59
60     /**
61      * Default event. Just show the page.
62      *
63      * @return XMLObject document
64      * @exception HttpPresentationException
65      */

66     public XMLObject handleDefault() throws HttpPresentationException {
67     return showPage(null);
68     }
69
70     /**
71      * Displays the MessengerMain page.
72      *
73      * @param errorMsg, the error messages
74      * @return XMLObject document
75      * @exception HttpPresentationException
76      */

77     public XMLObject showPage(String JavaDoc errorMsg)
78         throws HttpPresentationException {
79     Class JavaDoc tempClass=null;
80     Object JavaDoc page= null;
81     Method JavaDoc setTextErrorText = null;
82   
83     try{
84     Class JavaDoc 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 JavaDoc[] argTypeArr={stringClass};
88     setTextErrorText = tempClass.getMethod("setTextErrorText",argTypeArr);
89   }catch(Exception JavaDoc e){}
90   
91 // MessengerMainPage page =
92
// (MessengerMainPage) create("com.lutris.airsent.presentation.messenger.MessengerMain");
93

94     try {
95         if (null != errorMsg
96             || null
97                != (errorMsg =
98                this.getSessionData().getAndClearUserMessage())) {
99         Object JavaDoc [] temp={errorMsg};
100       setTextErrorText.invoke(page,temp);
101         //page.setTextErrorText(errorMsg);
102
} else {
103       Object JavaDoc [] temp={""};
104       setTextErrorText.invoke(page,temp);
105         //page.setTextErrorText("");
106
}
107     } catch (Exception JavaDoc 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