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


001:        package projectmanagement.presentation.projects;
002:
003:        import projectmanagement.presentation.*;
004:        import projectmanagement.spec.project.*;
005:        import com.lutris.appserver.server.httpPresentation.*;
006:        import org.enhydra.xml.xmlc.XMLObject;
007:
008:        import org.w3c.dom.*;
009:        import org.w3c.dom.html.*;
010:
011:        /**
012:         * Shows a list of projects to administer.
013:         *
014:         * @author Sasa Bojanic
015:         * @version 1.0
016:         */
017:        public class Administering extends BasePO {
018:
019:            /**
020:             * Constants
021:             */
022:            private static String CUSTOMER = "customer";
023:
024:            /**
025:             * Superclass method override. Returns 2.
026:             */
027:            protected int getRequiredAuthLevel() {
028:                return 2;
029:            }
030:
031:            /**
032:             *  Default event. Just show the page.
033:             */
034:            public XMLObject handleDefault() throws HttpPresentationException {
035:
036:                AdministeringHTML page = new AdministeringHTML();
037:
038:                String customer = this .getComms().request
039:                        .getParameter(CUSTOMER);
040:                if (customer != null && customer.length() == 0) {
041:                    customer = null;
042:                }
043:
044:                String errorMsg = this .getSessionData()
045:                        .getAndClearUserMessage();
046:                /*if(null != errorMsg) {
047:                   page.setTextLblErrorText(errorMsg);
048:                } else {
049:                   page.getElementLblErrorText().getParentNode().removeChild(page.getElementLblErrorText());
050:                }*/
051:
052:                try {
053:                    ProjectManager projectManager = ProjectManagerFactory
054:                            .getProjectManager("projectmanagement.business.project.ProjectManagerImpl");
055:                    Project[] projects = projectManager
056:                            .getAllProjectsForCustomer(customer);
057:
058:                    // fetches the table element from HTML document
059:                    HTMLTableElement table = page.getElementTblProjects();
060:
061:                    if (projects != null) {
062:                        for (int i = 0; i < projects.length; i++) {
063:                            // creating row in HTML table which describes table properties
064:                            HTMLTableRowElement htmlRE = createNewRow(page,
065:                                    projects[i]);
066:                            // appending row at the end of table
067:                            table.appendChild(htmlRE);
068:                        }
069:                    }
070:                    //Remove template selection row from table
071:                    table.removeChild(page.getElementTemplateRow());
072:
073:                    /*  Catch Null pointer exception ( we canot make a instances of classes from business layer  when we run ProjectManagement_pres )
074:                     * We need  to allow ProjectManagement_pres to be functional ,  response
075:                     * will be default HTML page 
076:                     */
077:                } catch (NullPointerException ex) {
078:
079:                } catch (Exception ex) {
080:                    this .writeDebugMsg("Error populating list of projects: "
081:                            + ex);
082:                    throw new ProjectManagementPresentationException(
083:                            "Error getting list of projects: ", ex);
084:                }
085:
086:                // write out HTML
087:                return page;
088:            }
089:
090:            /**
091:             * Creates the new row of HTML table element, based on given parameters.
092:             */
093:            private HTMLTableRowElement createNewRow(
094:                    AdministeringHTML administeringHTML, Project project) {
095:
096:                String projectID = "";
097:
098:                try {
099:                    projectID = project.getHandle();
100:                    administeringHTML.setTextTxtCustomer(project.getCustomer()
101:                            .getCompanyName());
102:                    administeringHTML.setTextTxtName(project.getName());
103:                    administeringHTML.setTextTxtMoneyPerHour(String
104:                            .valueOf(project.getMoneyPerHour()));
105:                } catch (Exception ex) {
106:                }
107:
108:                // image to get details on project
109:                HTMLImageElement detailsImg = administeringHTML
110:                        .getElementImgDetails();
111:                detailsImg.setName(projectID);
112:
113:                // image to modify project information
114:                HTMLImageElement modifyImg = administeringHTML
115:                        .getElementImgModify();
116:                modifyImg.setName(projectID);
117:
118:                // image to delete project
119:                HTMLImageElement deleteImg = administeringHTML
120:                        .getElementImgDelete();
121:                deleteImg.setName(projectID);
122:
123:                HTMLTableRowElement row = (HTMLTableRowElement) administeringHTML
124:                        .getElementTemplateRow().cloneNode(true);
125:
126:                return row;
127:            }
128:
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.