Source Code Cross Referenced for WelcomePresentation.java in  » J2EE » Enhydra-Demos » tableappclient » presentation » 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 » tableappclient.presentation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         *  tableAppClient
03:         *
04:         *  Enhydra super-servlet presentation object
05:         *
06:         * Prozone
07:         *
08:         */
09:
10:        package tableappclient.presentation;
11:
12:        // Enhydra SuperServlet imports
13:        import com.lutris.appserver.server.httpPresentation.HttpPresentation;
14:        import com.lutris.appserver.server.httpPresentation.HttpPresentationComms;
15:        import com.lutris.appserver.server.httpPresentation.HttpPresentationException;
16:
17:        import org.w3c.dom.Node;
18:        import org.w3c.dom.Element;
19:        import org.w3c.dom.html.HTMLTableElement;
20:        import org.w3c.dom.html.HTMLTableRowElement;
21:        import org.w3c.dom.html.HTMLElement;
22:
23:        // Enhydra SuperServlet specification imports
24:        import tableappclient.spec.*;
25:
26:        // Standard imports
27:        import java.io.IOException;
28:
29:        public class WelcomePresentation implements  HttpPresentation {
30:            static final String FOUND = "The following table has been retrieved from the TableApp application and transferred in a Document object, via Axis/Soap:";
31:            static final String NOTFOUND = "The server application TableApp has not been accessed yet. Access and refresh it few times, then refresh this window.";
32:            static final String FOUNDOBJ = "The following data have been retrieved from the TableApp application and transferred in a custom serialized object, via Axis/Soap:";
33:            static final String NOTFOUNDOBJ = "The following data will be retrieved from the TableApp application and transferred in a custom serialized object, via Axis/Soap:";
34:
35:            public void run(HttpPresentationComms comms)
36:                    throws HttpPresentationException, IOException {
37:                String server = null;
38:                try {
39:                    server = comms.request.getServerName();
40:                } catch (Exception e) {
41:                }
42:                String port = null;
43:                try {
44:                    port = new Integer(comms.request.getServerPort())
45:                            .toString();
46:                } catch (Exception e) {
47:                }
48:
49:                String text = "1";
50:                String textObj = "2";
51:                WelcomeHTML welcome = (WelcomeHTML) comms.xmlcFactory
52:                        .create(WelcomeHTML.class);
53:                try {
54:                    TableNode tableNode = TableNodeFactory
55:                            .createTableNode("tableappclient.business.TableNodeImpl");
56:                    AccessData accessData = AccessDataFactory.createAccessData(
57:                            "tableappclient.business.AccessDataImpl", server,
58:                            port);
59:                    Node node = tableNode.getTableNode(server, port);
60:                    if (node == null) {
61:                        text = NOTFOUND;
62:                        textObj = NOTFOUNDOBJ;
63:                    } else {
64:                        text = FOUND;
65:                        textObj = FOUNDOBJ;
66:                        HTMLTableElement welcomeTable = welcome
67:                                .getElementTemplateTable();
68:                        Node welcomeNode = welcome.importNode(node, true);
69:                        Node parentNode = welcomeTable.getParentNode();
70:                        parentNode.appendChild(welcomeNode);
71:                        HTMLTableRowElement templateRow = welcome
72:                                .getElementTemplateRow();
73:                        HTMLElement noAccessesElement = welcome
74:                                .getElementAccNum();
75:                        HTMLElement timeElement = welcome.getElementAccTime();
76:                        templateRow.removeAttribute("id");
77:                        noAccessesElement.removeAttribute("id");
78:                        timeElement.removeAttribute("id");
79:                        Node parrent = templateRow.getParentNode();
80:                        welcome.setTextAccNum(new Integer(accessData
81:                                .getNoAccesses()).toString());
82:                        welcome.setTextAccTime(accessData.getAccessTime());
83:                        parrent.appendChild(templateRow.cloneNode(true));
84:                        parrent.removeChild(templateRow);
85:                    }
86:                } catch (Exception ex) {
87:                    System.out.println("Exception: " + ex);
88:                    text = "Could not get business object!!!";
89:                }
90:                welcome.setTextObjectTextTemplate(textObj);
91:                welcome.setTextTextTemplate(text);
92:                comms.response.writeDOM(welcome);
93:            }
94:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.