Source Code Cross Referenced for PaymentDetailAction.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » pdp » action » paymentdetail » 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 » ERP CRM Financial » Kuali Financial System » org.kuali.module.pdp.action.paymentdetail 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         * http://www.opensource.org/licenses/ecl1.php
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * Created on Aug 11, 2004
018:         *
019:         */
020:        package org.kuali.module.pdp.action.paymentdetail;
021:
022:        import java.sql.Timestamp;
023:        import java.util.ArrayList;
024:        import java.util.HashMap;
025:        import java.util.Iterator;
026:        import java.util.List;
027:        import java.util.Map;
028:
029:        import javax.servlet.http.HttpServletRequest;
030:        import javax.servlet.http.HttpServletResponse;
031:        import javax.servlet.http.HttpSession;
032:
033:        import org.apache.struts.action.ActionForm;
034:        import org.apache.struts.action.ActionForward;
035:        import org.apache.struts.action.ActionMapping;
036:        import org.kuali.kfs.context.SpringContext;
037:        import org.kuali.module.pdp.PdpConstants;
038:        import org.kuali.module.pdp.action.BaseAction;
039:        import org.kuali.module.pdp.bo.PaymentDetail;
040:        import org.kuali.module.pdp.bo.PaymentGroup;
041:        import org.kuali.module.pdp.service.PaymentDetailService;
042:        import org.kuali.module.pdp.service.PaymentGroupService;
043:        import org.kuali.module.pdp.service.SecurityRecord;
044:        import org.kuali.module.pdp.utilities.GeneralUtilities;
045:
046:        /**
047:         * @author delyea
048:         */
049:        public class PaymentDetailAction extends BaseAction {
050:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
051:                    .getLogger(PaymentDetailAction.class);
052:            private PaymentDetailService paymentDetailService;
053:            private PaymentGroupService paymentGroupService;
054:            private Map payees;
055:
056:            public PaymentDetailAction() {
057:                setPaymentGroupService(SpringContext
058:                        .getBean(PaymentGroupService.class));
059:                setPaymentDetailService(SpringContext
060:                        .getBean(PaymentDetailService.class));
061:
062:                // TODO This should probably be a table
063:                payees = new HashMap();
064:                payees.put(PdpConstants.PayeeIdTypeCodes.PAYEE_ID, "Payee ID");
065:                payees.put(PdpConstants.PayeeIdTypeCodes.SSN, "SSN");
066:                payees.put(PdpConstants.PayeeIdTypeCodes.EMPLOYEE_ID,
067:                        "Employee ID");
068:                payees.put(PdpConstants.PayeeIdTypeCodes.FEIN, "FEIN");
069:                payees
070:                        .put(PdpConstants.PayeeIdTypeCodes.VENDOR_ID,
071:                                "Vendor ID");
072:                payees.put(PdpConstants.PayeeIdTypeCodes.OTHER, "Other");
073:            }
074:
075:            protected boolean isAuthorized(ActionMapping mapping,
076:                    ActionForm form, HttpServletRequest request,
077:                    HttpServletResponse response) {
078:                SecurityRecord sr = getSecurityRecord(request);
079:                return sr.isLimitedViewRole() || sr.isViewAllRole()
080:                        || sr.isViewIdRole() || sr.isViewBankRole();
081:            }
082:
083:            protected ActionForward executeLogic(ActionMapping mapping,
084:                    ActionForm form, HttpServletRequest request,
085:                    HttpServletResponse response) throws Exception {
086:                LOG.debug("executeLogic() started");
087:                HttpSession session = request.getSession();
088:                LOG
089:                        .debug("executeLogic() ************* SESSION ID = "
090:                                + session.getId()
091:                                + "  and created "
092:                                + (new Timestamp(session.getCreationTime()))
093:                                        .toString());
094:
095:                String buttonPressed = GeneralUtilities
096:                        .whichButtonWasPressed(request);
097:                LOG.debug("executeLogic() btnPressed is " + buttonPressed);
098:                Integer detailId;
099:                PaymentDetail pd = (PaymentDetail) session
100:                        .getAttribute("PaymentDetail");
101:                List indivList = (List) session
102:                        .getAttribute("indivSearchResults");
103:                List batchIndivList = (List) session
104:                        .getAttribute("batchIndivSearchResults");
105:
106:                if ((indivList == null) && (batchIndivList == null)
107:                        && (pd == null)) {
108:                    // Handle Session Expiration
109:                    LOG
110:                            .info("executeLogic() Payment Detail and both search results are null");
111:                    return mapping.findForward("pdp_session_timeout");
112:                } else {
113:                    if (request.getParameter("DetailId") != null) {
114:                        // Payment Detail ID was passed - find payment Detail with the ID
115:                        LOG.debug("executeLogic() Detail ID passed in Parms: "
116:                                + request.getParameter("DetailId"));
117:                        detailId = new Integer(request.getParameter("DetailId"));
118:                        pd = paymentDetailService.get(detailId);
119:
120:                        pd.setLastDisbursementActionDate(this 
121:                                .getDisbursementActionExpirationDate(request));
122:                        getPayeeDescriptor(session, pd);
123:                        getDisbursementPaymentList(session, pd);
124:                        session.setAttribute("size", new Integer(pd
125:                                .getPaymentGroup().getPaymentDetails().size()));
126:                        session.setAttribute("PaymentDetail", pd);
127:                    } else if (pd == null) {
128:                        // Handle Session Expiration
129:                        LOG
130:                                .info("executeLogic() Payment Detail object 'pd' is null");
131:                        return mapping.findForward("pdp_session_timeout");
132:                    } else if (buttonPressed.startsWith("btnUpdate")) {
133:                        // Update Payment Detail in Session after action has been performed
134:                        // (status might have changed)
135:                        detailId = pd.getId();
136:                        pd = paymentDetailService.get(detailId);
137:
138:                        pd.setLastDisbursementActionDate(this 
139:                                .getDisbursementActionExpirationDate(request));
140:                        getPayeeDescriptor(session, pd);
141:                        getDisbursementPaymentList(session, pd);
142:                        session.setAttribute("size", new Integer(pd
143:                                .getPaymentGroup().getPaymentDetails().size()));
144:                        session.setAttribute("PaymentDetail", pd);
145:                    }
146:                    // Use of a default tab (Summary Tab)
147:                    if ((GeneralUtilities.isStringEmpty(buttonPressed))
148:                            || (buttonPressed.startsWith("btnUpdate"))) {
149:                        request.setAttribute("btnPressed", "btnSummaryTab");
150:                    } else {
151:                        request.setAttribute("btnPressed", buttonPressed);
152:                    }
153:                }
154:
155:                return mapping.findForward("display");
156:            }
157:
158:            private void getPayeeDescriptor(HttpSession session,
159:                    PaymentDetail pd) {
160:                // Get descriptor of Payee ID Type based on Code in DB
161:                Iterator i = payees.keySet().iterator();
162:                while (i.hasNext()) {
163:                    String key = (String) i.next();
164:                    if (pd != null) {
165:                        if (key.equals(pd.getPaymentGroup().getPayeeIdTypeCd())) {
166:                            session.setAttribute("payeeIdTypeDesc", payees
167:                                    .get(key));
168:                        }
169:                        if (key.equals(pd.getPaymentGroup()
170:                                .getAlternatePayeeIdTypeCd())) {
171:                            session.setAttribute("alternatePayeeIdTypeDesc",
172:                                    payees.get(key));
173:                        }
174:                    }
175:                }
176:            }
177:
178:            private void getDisbursementPaymentList(HttpSession session,
179:                    PaymentDetail pd) {
180:                List paymentDetailList = new ArrayList();
181:                Integer disbNbr = pd.getPaymentGroup().getDisbursementNbr();
182:                session.removeAttribute("disbNbrTotalPayments");
183:                session.removeAttribute("disbursementDetailsList");
184:
185:                if ((disbNbr != null) && (disbNbr != new Integer(0))) {
186:                    List paymentGroupList = paymentGroupService
187:                            .getByDisbursementNumber(disbNbr);
188:                    for (Iterator iter = paymentGroupList.iterator(); iter
189:                            .hasNext();) {
190:                        PaymentGroup elem = (PaymentGroup) iter.next();
191:                        paymentDetailList.addAll(elem.getPaymentDetails());
192:                    }
193:                    session.setAttribute("disbNbrTotalPayments", new Integer(
194:                            paymentDetailList.size()));
195:                    session.setAttribute("disbursementDetailsList",
196:                            paymentDetailList);
197:                }
198:            }
199:
200:            public void setPayees(Map m) {
201:                payees = m;
202:            }
203:
204:            public void setPaymentDetailService(PaymentDetailService p) {
205:                paymentDetailService = p;
206:            }
207:
208:            public void setPaymentGroupService(PaymentGroupService p) {
209:                paymentGroupService = p;
210:            }
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.