Source Code Cross Referenced for SavePage.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.httpPresentation.*;
012:
013:        //import com.lutris.xml.xmlc.*;
014:
015:        import java.io.*;
016:
017:        import java.text.*;
018:
019:        import java.util.*;
020:
021:        import net.sourceforge.ejosa.piggybank.spec.*;
022:        import net.sourceforge.ejosa.piggybank.spec.business.*;
023:        import net.sourceforge.ejosa.piggybank.spec.system.*;
024:
025:        import org.openuss.presentation.enhydra.framework.*;
026:
027:        import org.openuss.utility.*;
028:
029:        import org.w3c.dom.*;
030:        import org.w3c.dom.html.*;
031:
032:        /**
033:         * Save Page
034:         *
035:         * @author  B. Lofi Dewanto, T. Menzel
036:         * @version 1.1
037:         */
038:        public class SavePage extends FoundationPO {
039:            // Form parameter
040:            protected String amount = null;
041:
042:            // Page
043:            private SaveHTML mPage;
044:
045:            /**
046:             * Default event. Just show the page.
047:             */
048:            public String handleDefault() throws HttpPresentationException {
049:                // Create the page
050:                mPage = (SaveHTML) this .getComms().xmlcFactory
051:                        .create(SaveHTML.class);
052:
053:                // Look for an error
054:                String errorMsg = this .getSessionData()
055:                        .getAndClearUserMessage();
056:
057:                if (errorMsg == null) {
058:                    // No error
059:                    mPage.getElementTStatusbar().getParentNode().removeChild(
060:                            mPage.getElementTStatusbar());
061:                } else {
062:                    // Error, put it in the statusbar
063:                    mPage.setTextTStatusbar(errorMsg);
064:                }
065:
066:                // Work with the page
067:                return showLayout(mPage);
068:            }
069:
070:            /**
071:             * Superclass method override.
072:             */
073:            public boolean loggedInUserRequired() {
074:                // This page doesn't need a login
075:                return false;
076:            }
077:
078:            /**
079:             * Show the page, override the method.
080:             */
081:            public String showLayout(Object page) throws BasePOException {
082:                // Format the statusbar and treebar
083:                super .showLayout(mPage);
084:
085:                // Save
086:                showSave();
087:
088:                // Return the result
089:                return mPage.toDocument();
090:            }
091:
092:            /**
093:             * Save.
094:             */
095:            private void showSave() throws FoundationPOException {
096:                // Get the form data
097:                // -----------------
098:                try {
099:                    amount = "0";
100:
101:                    if (this .getComms().request.getParameter("amount") != null) {
102:                        try {
103:                            int temp = Integer.parseInt(this .getComms().request
104:                                    .getParameter("amount"));
105:                            amount = "" + temp;
106:                        } catch (NumberFormatException nfe) {
107:                            //System.out.println("Error: NumberFormatException: " + nfe);
108:                        }
109:                    }
110:                } catch (Exception ex) {
111:                    System.out.println("Form Reader Error: " + ex);
112:                }
113:
114:                // Business access
115:                // !!!Only access to the specification!!!
116:                try {
117:                    // Get the workflow object
118:                    CoinManager coinManager = CoinManagerFactory
119:                            .createCoinManager("net.sourceforge.ejosa.piggybank.business.session.CoinManagerImpl");
120:
121:                    //System.out.println("Coin: create a coin manager!");
122:                    // Create a value object / state object / data transfer object
123:                    Coin coin = CoinFactory
124:                            .createCoin("net.sourceforge.ejosa.piggybank.business.entity.CoinImpl");
125:
126:                    String now = DateFormat.getDateInstance(DateFormat.SHORT,
127:                            Locale.ENGLISH).format(new Date());
128:
129:                    coin.setDate(now);
130:                    coin.setAmount(amount);
131:                    coin.setCurrency("Dollar");
132:
133:                    coinManager.createCoin(coin);
134:
135:                    //System.out.println("Coin: create it!");
136:                } catch (Exception ex) {
137:                    System.out.println("EJB Error: " + ex);
138:                    ex.printStackTrace();
139:                }
140:
141:                // Show...
142:                mPage.setTextVAmount(amount);
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.