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


001:        /*
002:         *  multibaseExemple
003:         *
004:         *  Enhydra super-servlet presentation object
005:         *
006:         */
007:
008:        package multibase.presentation;
009:
010:        // Enhydra SuperServlet imports
011:        import com.lutris.appserver.server.httpPresentation.HttpPresentation;
012:        import com.lutris.appserver.server.httpPresentation.HttpPresentationComms;
013:        import com.lutris.appserver.server.httpPresentation.HttpPresentationException;
014:        import org.w3c.dom.html.*;
015:        import org.w3c.dom.Node;
016:
017:        // Standard imports
018:        import java.io.IOException;
019:        import java.util.Date;
020:        import java.text.DateFormat;
021:
022:        // App imports
023:        import multibase.spec.*;
024:        import org.w3c.dom.Node;
025:
026:        public class MultibasePresentation implements  HttpPresentation {
027:
028:            public void run(HttpPresentationComms comms)
029:                    throws HttpPresentationException, IOException {
030:
031:                MultibaseHTML multibase;
032:                MyDataManager dataManager;
033:
034:                multibase = (MultibaseHTML) comms.xmlcFactory
035:                        .create(MultibaseHTML.class);
036:
037:                dataManager = MyDataManagerFactory
038:                        .getMyDataManager("multibase.business.MyDataManagerImpl");
039:
040:                try {
041:                    String event = comms.request.getParameter("AppActionRg");
042:                    if (event != null) {
043:                        if (event.equals("loadPr")) {
044:                            dataManager.loadPr();
045:
046:                        } else if (event.equals("loadEm")) {
047:                            dataManager.loadEm();
048:
049:                        } else if (event.equals("transferPr")) {
050:                            dataManager.transferPr();
051:
052:                        } else if (event.equals("deleteTr")) {
053:                            dataManager.deleteTr();
054:
055:                        } else if (event.equals("deleteAll")) {
056:                            dataManager.deleteAll();
057:                        }
058:                    }
059:
060:                    String[][] programerArray = dataManager.getProgramers();
061:                    String[][] employeeArray = dataManager.getEmployees();
062:
063:                    HTMLTableRowElement prTemplateRow = multibase
064:                            .getElementPrTemplateRow();
065:                    HTMLElement pFirstNameCellTemplate = multibase
066:                            .getElementPFirstName();
067:                    HTMLElement pLastNameCellTemplate = multibase
068:                            .getElementPLastName();
069:                    HTMLElement expirienceCellTemplate = multibase
070:                            .getElementExpirience();
071:                    HTMLElement projectCellTemplate = multibase
072:                            .getElementProject();
073:                    Node prTable = prTemplateRow.getParentNode();
074:
075:                    prTemplateRow.removeAttribute("id");
076:                    pFirstNameCellTemplate.removeAttribute("id");
077:                    pLastNameCellTemplate.removeAttribute("id");
078:                    expirienceCellTemplate.removeAttribute("id");
079:                    projectCellTemplate.removeAttribute("id");
080:
081:                    if (programerArray != null) {
082:                        for (int numDiscs = 0; numDiscs < programerArray.length; numDiscs++) {
083:                            multibase
084:                                    .setTextPFirstName(programerArray[numDiscs][0]);
085:                            multibase
086:                                    .setTextPLastName(programerArray[numDiscs][1]);
087:                            multibase
088:                                    .setTextExpirience(programerArray[numDiscs][2]);
089:                            multibase
090:                                    .setTextProject(programerArray[numDiscs][3]);
091:                            prTable.appendChild(prTemplateRow.cloneNode(true));
092:                        }
093:                    }
094:
095:                    HTMLTableRowElement emTemplateRow = multibase
096:                            .getElementEmTemplateRow();
097:                    HTMLElement eFirstNameCellTemplate = multibase
098:                            .getElementEFirstName();
099:                    HTMLElement eLastNameCellTemplate = multibase
100:                            .getElementELastName();
101:                    HTMLElement occupationCellTemplate = multibase
102:                            .getElementOccupation();
103:                    HTMLElement departmentCellTemplate = multibase
104:                            .getElementDepartment();
105:                    Node emTable = emTemplateRow.getParentNode();
106:
107:                    emTemplateRow.removeAttribute("id");
108:                    eFirstNameCellTemplate.removeAttribute("id");
109:                    eLastNameCellTemplate.removeAttribute("id");
110:                    occupationCellTemplate.removeAttribute("id");
111:                    departmentCellTemplate.removeAttribute("id");
112:
113:                    if (employeeArray != null) {
114:                        for (int numDiscs = 0; numDiscs < employeeArray.length; numDiscs++) {
115:                            multibase
116:                                    .setTextEFirstName(employeeArray[numDiscs][0]);
117:                            multibase
118:                                    .setTextELastName(employeeArray[numDiscs][1]);
119:                            multibase
120:                                    .setTextOccupation(employeeArray[numDiscs][2]);
121:                            multibase
122:                                    .setTextDepartment(employeeArray[numDiscs][3]);
123:                            emTable.appendChild(emTemplateRow.cloneNode(true));
124:                        }
125:                    }
126:
127:                    prTemplateRow.getParentNode().removeChild(prTemplateRow);
128:                    emTemplateRow.getParentNode().removeChild(emTemplateRow);
129:
130:                    /*
131:                     * We want to allow multibase_pres to be functional , we cannot create instances of business layer when we run bultibase_pres
132:                     * catch NullPointerException and show default HTML page
133:                     */
134:                } catch (NullPointerException e) {
135:                    multibase.setTextMessage("MultiDb default page");
136:                }
137:                comms.response.writeDOM(multibase);
138:            }
139:
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.