KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > airsent > presentation > Welcome


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: Welcome.java,v 1.1 2004/08/16 09:33:16 slobodan Exp $
18  */

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 com.lutris.xml.xmlc.*;
26
//import com.lutris.xml.xmlc.html.*;
27
import org.enhydra.xml.xmlc.XMLObject;
28 import org.w3c.dom.*;
29 import org.w3c.dom.html.*;
30 import java.util.Date JavaDoc;
31 import com.lutris.airsent.presentation.BasePO;
32
33 /**
34  * Login.java handles the login functionality of the DiscRack app.
35  *
36  * @author
37  * @version
38  */

39 public class Welcome extends BasePO {
40
41     /**
42      * Constants
43      */

44     private static final int AUTH_LEVEL = AirSentConstants.UNAUTH_USER;
45
46     /**
47      * Superclass method override.
48      * returns the authorization level necessary to access this po.
49      *
50      * @return int required authorization level
51      */

52     public int getRequiredAuthLevel() {
53         return AUTH_LEVEL;
54     }
55
56     /**
57      * Default event. Just show the page.
58      */

59     public XMLObject handleDefault() throws HttpPresentationException {
60         return showPage(null);
61     }
62
63     /**
64      * handle throw exception event.
65      *
66      * @return html document
67      * @exception Exception
68      */

69     public XMLObject handleThrowException() throws Exception JavaDoc {
70         throw new Exception JavaDoc("This is a test exception thrown from Login.java handleThrowException()");
71     }
72
73     /**
74      * display page
75      *
76      * @param errorMsg, the error messages
77      * @return html document
78      */

79     public XMLObject showPage(String JavaDoc 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 JavaDoc ex) {
90             throw new AirSentPresentationException("Trouble getting current authorization level", ex);
91         }
92     // finally {
93
return page;
94     // }
95
}
96 }
97
98
Popular Tags