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


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