Source Code Cross Referenced for FoundationPO.java in  » J2EE » Enhydra-Demos » net » sourceforge » ejosa » piggybank » presentation » enhydra » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Enhydra Demos » net.sourceforge.ejosa.piggybank.presentation.enhydra 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Title:        OpenUSS - Open Source University Support System
003:         *               My Piggy Bank Example
004:         * Description:  Enhydra Presentation Object
005:         * Copyright:    Copyright (c) 2003 by B. Lofi Dewanto, T. Menzel
006:         * Company:      University of Muenster, HTWK Leipzig
007:         * @author  B. Lofi Dewanto, T. Menzel
008:         * @version 1.1
009:         */package net.sourceforge.ejosa.piggybank.presentation.enhydra;
010:
011:        import com.lutris.appserver.server.Enhydra;
012:        import com.lutris.appserver.server.httpPresentation.*;
013:        import com.lutris.appserver.server.user.User;
014:
015:        import com.lutris.logging.*;
016:
017:        import com.lutris.util.KeywordValueException;
018:
019:        //import com.lutris.xml.xmlc.*;
020:        //import com.lutris.xml.xmlc.html.*;
021:
022:        import java.lang.Throwable;
023:        import java.lang.reflect.*;
024:
025:        import java.text.*;
026:
027:        import java.util.*;
028:
029:        import org.openuss.presentation.enhydra.framework.*;
030:
031:        import org.openuss.utility.*;
032:
033:        import org.w3c.dom.*;
034:        import org.w3c.dom.html.*;
035:
036:        /**
037:         * The base presentation object for foundation components.
038:         * This should be used to show a html file.
039:         *
040:         * @author  B. Lofi Dewanto, T. Menzel
041:         * @version 1.1
042:         */
043:        abstract public class FoundationPO extends BasePO implements 
044:                HttpPresentation, BaseLayout {
045:            protected static String MAIN_PAGE = "/Welcome.po";
046:
047:            /**
048:             * Saved the session data.
049:             */
050:            protected FoundationSessionData mySessionData = null;
051:
052:            /**
053:             * @return The saved comms objects
054:             * to whichever subclass needs it
055:             */
056:            public FoundationSessionData getSessionData() {
057:                return this .mySessionData;
058:            }
059:
060:            /**
061:             * Method to remove the all session data.
062:             */
063:            public void removeAllSessionData() {
064:                this .getSessionData().getAndClearUserMessage();
065:            }
066:
067:            /**
068:             * Method to log the locale in to a session.
069:             */
070:            public void setLocale(Locale locale) throws FoundationPOException {
071:                this .getSessionData().setLocale(locale);
072:            }
073:
074:            /**
075:             * Get the locale.
076:             */
077:            public Locale getLocale() {
078:                return this .getSessionData().getLocale();
079:            }
080:
081:            /**
082:             * Superclass method override. For public means everybody can
083:             * access this, otherwise he or she needs to be activated first.
084:             */
085:            public boolean isForPublicAccess() throws BasePOException {
086:                // As a standard value, every pages are for the public
087:                // access -> true
088:                // You have to override this, if you want to change
089:                // this behaviour
090:                return true;
091:            }
092:
093:            /**
094:             * This implements the run method in HttpPresentation.
095:             */
096:            public void run(HttpPresentationComms comms) throws Exception {
097:                // Initialize new or get the existing session data
098:                initSessionData(comms);
099:
100:                // Check the security
101:                checkSecurity();
102:
103:                // Handle the incoming event request
104:                handleEvent(comms);
105:            }
106:
107:            /**
108:             * Method to get or create the AgSessionData object from the user session
109:             * This object is saved in the EbrokerPresentation object
110:             */
111:            protected void initSessionData(HttpPresentationComms comms)
112:                    throws FoundationPOException {
113:                this .myComms = comms;
114:
115:                try {
116:                    Object obj = comms.sessionData
117:                            .get(FoundationSessionData.SESSION_KEY);
118:
119:                    // If we found the session data, save it in a private data member
120:                    if (null != obj) {
121:                        this .mySessionData = (FoundationSessionData) obj;
122:                    } else {
123:                        // If no session data was found, create a new session data instance
124:                        this .mySessionData = new FoundationSessionData();
125:                        comms.sessionData.set(
126:                                FoundationSessionData.SESSION_KEY,
127:                                this .mySessionData);
128:                    }
129:                } catch (KeywordValueException ex) {
130:                    writeDebugMsg("Problem getting session data from session: "
131:                            + ex.getMessage());
132:                }
133:            }
134:
135:            /**
136:             * Checks the session data for a User, if not there then redirects to the login
137:             * page.
138:             */
139:            protected void checkForUserLogin()
140:                    throws ClientPageRedirectException, FoundationPOException {
141:                // Do nothing
142:            }
143:
144:            /**
145:             * Checks the session data for a AccessList, if not there then redirects
146:             * to the public login page, where the user can apply for the access.
147:             */
148:            protected void checkForAccessList()
149:                    throws ClientPageRedirectException, FoundationPOException {
150:                // Do nothing
151:            }
152:
153:            /**
154:             * Check the security.
155:             */
156:            protected void checkSecurity() throws Exception {
157:                // Check if the user needs to be logged in for this request
158:                if (this .loggedInUserRequired()) {
159:                    checkForUserLogin();
160:                }
161:            }
162:
163:            /**
164:             * This method has to be implemented. This write down the right-side
165:             * information on the right side of the page. "Treebar".
166:             */
167:            public void showTreebar(Object page) throws BasePOException {
168:                // Do nothing
169:            }
170:
171:            /**
172:             * This method has to be implemented. This updates the date on
173:             * the top right.
174:             */
175:            public void showUpdatedDate(Object page) throws BasePOException {
176:                // Do nothing
177:            }
178:
179:            /**
180:             * This method has to be implemented. This shows all the page
181:             * layout. All layout methods should be called within
182:             * this method.
183:             */
184:            public String showLayout(Object page) throws BasePOException {
185:                // Return nothing
186:                return null;
187:            }
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.