Source Code Cross Referenced for EpicPaymentDetailAction.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:        package org.kuali.module.pdp.action.paymentdetail;
017:
018:        import java.util.ArrayList;
019:        import java.util.Iterator;
020:        import java.util.List;
021:        import java.util.Map;
022:
023:        import javax.servlet.http.HttpServletRequest;
024:        import javax.servlet.http.HttpServletResponse;
025:
026:        import org.apache.struts.action.ActionErrors;
027:        import org.apache.struts.action.ActionForm;
028:        import org.apache.struts.action.ActionForward;
029:        import org.apache.struts.action.ActionMapping;
030:        import org.apache.struts.action.ActionMessage;
031:        import org.kuali.kfs.context.SpringContext;
032:        import org.kuali.module.pdp.action.BaseAction;
033:        import org.kuali.module.pdp.bo.PaymentDetail;
034:        import org.kuali.module.pdp.bo.PaymentGroup;
035:        import org.kuali.module.pdp.dao.PayeeTypeDao;
036:        import org.kuali.module.pdp.service.PaymentDetailService;
037:        import org.kuali.module.pdp.service.PaymentGroupService;
038:        import org.kuali.module.pdp.utilities.GeneralUtilities;
039:
040:        public class EpicPaymentDetailAction extends BaseAction {
041:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
042:                    .getLogger(EpicPaymentDetailAction.class);
043:            private PaymentDetailService paymentDetailService;
044:            private PaymentGroupService paymentGroupService;
045:            private PayeeTypeDao payeeTypeDao;
046:
047:            public EpicPaymentDetailAction() {
048:                setPaymentDetailService(SpringContext
049:                        .getBean(PaymentDetailService.class));
050:                setPaymentGroupService(SpringContext
051:                        .getBean(PaymentGroupService.class));
052:                setPayeeTypeDao(SpringContext.getBean(PayeeTypeDao.class));
053:            }
054:
055:            protected ActionForward executeLogic(ActionMapping mapping,
056:                    ActionForm form, HttpServletRequest request,
057:                    HttpServletResponse response) throws Exception {
058:                LOG.debug("executeLogic() started");
059:
060:                String buttonPressed = GeneralUtilities
061:                        .whichButtonWasPressed(request);
062:
063:                LOG.debug("executeLogic() btnPressed is " + buttonPressed);
064:                String custPaymentDocNbr = null;
065:                String fdocTypeCode = null;
066:                ActionErrors errors = new ActionErrors();
067:                PaymentDetail pd = (PaymentDetail) request.getSession()
068:                        .getAttribute("PaymentDetail");
069:                List indivList = (List) request.getSession().getAttribute(
070:                        "indivSearchResults");
071:                List batchIndivList = (List) request.getSession().getAttribute(
072:                        "batchIndivSearchResults");
073:
074:                if ((request.getParameter("sourceDocNbr") == null)
075:                        && (request.getParameter("docTypeCode") == null)
076:                        && (GeneralUtilities.isStringEmpty(buttonPressed))) {
077:                    // No Source Doc Number given and no button pressed
078:                    request.setAttribute("title",
079:                            "No Source Document Number Error");
080:                    errors.add("error", new ActionMessage(
081:                            "paymentDetail.epic.noSourceDocGiven"));
082:                    saveErrors(request, errors);
083:                    return mapping.findForward("pdp_message");
084:                } else if ((request.getParameter("sourceDocNbr") != null)
085:                        && (request.getParameter("docTypeCode") != null)) {
086:                    // Source Doc Number was passed - find payment Detail with the Sopurce Doc Number
087:                    LOG
088:                            .debug("executeLogic() Source Document Number passed in Parms: "
089:                                    + request.getParameter("sourceDocNbr"));
090:                    LOG.debug("executeLogic() Doc Type passed in Parms: "
091:                            + request.getParameter("docTypeCode"));
092:                    custPaymentDocNbr = (String) request
093:                            .getParameter("sourceDocNbr");
094:                    fdocTypeCode = (String) request.getParameter("docTypeCode");
095:                    pd = paymentDetailService.getDetailForEpic(
096:                            custPaymentDocNbr, fdocTypeCode);
097:
098:                    if (pd != null) {
099:                        pd.setLastDisbursementActionDate(this 
100:                                .getDisbursementActionExpirationDate(request));
101:                        getPayeeDescriptor(request, pd);
102:                        getDisbursementPaymentList(request, pd);
103:                        request.getSession().setAttribute(
104:                                "size",
105:                                new Integer(pd.getPaymentGroup()
106:                                        .getPaymentDetails().size()));
107:                        request.getSession().setAttribute("PaymentDetail", pd);
108:                    } else {
109:                        // No PDP Payment for Epic Source Doc Number given
110:                        request.setAttribute("title", "No Payment Found Error");
111:                        errors.add("error", new ActionMessage(
112:                                "paymentDetail.epic.noPaymentFound",
113:                                custPaymentDocNbr));
114:                        saveErrors(request, errors);
115:                        return mapping.findForward("pdp_message");
116:                    }
117:                } else {
118:                    if (pd == null) {
119:                        // Handle Session Expiration
120:                        return mapping.findForward("pdp_session_timeout");
121:                    } else if (buttonPressed.startsWith("btnUpdate")) {
122:                        // Update Payment Detail in Session after action has been performed
123:                        // (status might have changed)
124:                        Integer detailId = pd.getId();
125:                        pd = paymentDetailService.get(detailId);
126:
127:                        pd.setLastDisbursementActionDate(this 
128:                                .getDisbursementActionExpirationDate(request));
129:                        getPayeeDescriptor(request, pd);
130:                        getDisbursementPaymentList(request, pd);
131:                        request.getSession().setAttribute(
132:                                "size",
133:                                new Integer(pd.getPaymentGroup()
134:                                        .getPaymentDetails().size()));
135:                        request.getSession().setAttribute("PaymentDetail", pd);
136:                    }
137:                }
138:
139:                // Use of a default tab (Summary Tab)
140:                if ((GeneralUtilities.isStringEmpty(buttonPressed))
141:                        || (buttonPressed.startsWith("btnUpdate"))) {
142:                    request.setAttribute("btnPressed", "btnSummaryTab");
143:                } else {
144:                    request.setAttribute("btnPressed", buttonPressed);
145:                }
146:
147:                return mapping.findForward("display");
148:            }
149:
150:            public void getPayeeDescriptor(HttpServletRequest request,
151:                    PaymentDetail pd) {
152:                // Get descriptor of Payee ID Type based on Code in DB
153:                Map<String, String> payees = payeeTypeDao.getAll();
154:                Iterator i = payees.keySet().iterator();
155:                while (i.hasNext()) {
156:                    String key = (String) i.next();
157:                    if (pd != null) {
158:                        if (key.equals(pd.getPaymentGroup().getPayeeIdTypeCd())) {
159:                            request.getSession().setAttribute(
160:                                    "payeeIdTypeDesc", payees.get(key));
161:                        }
162:                        if (key.equals(pd.getPaymentGroup()
163:                                .getAlternatePayeeIdTypeCd())) {
164:                            request.getSession()
165:                                    .setAttribute("alternatePayeeIdTypeDesc",
166:                                            payees.get(key));
167:                        }
168:                    }
169:                }
170:            }
171:
172:            public void getDisbursementPaymentList(HttpServletRequest request,
173:                    PaymentDetail pd) {
174:                List paymentDetailList = new ArrayList();
175:                Integer disbNbr = pd.getPaymentGroup().getDisbursementNbr();
176:                request.getSession().removeAttribute("disbNbrTotalPayments");
177:                request.getSession().removeAttribute("disbursementDetailsList");
178:
179:                if ((disbNbr != null) && (disbNbr != new Integer(0))) {
180:                    List paymentGroupList = paymentGroupService
181:                            .getByDisbursementNumber(disbNbr);
182:                    for (Iterator iter = paymentGroupList.iterator(); iter
183:                            .hasNext();) {
184:                        PaymentGroup elem = (PaymentGroup) iter.next();
185:                        paymentDetailList.addAll(elem.getPaymentDetails());
186:                    }
187:                    request.getSession().setAttribute("disbNbrTotalPayments",
188:                            new Integer(paymentDetailList.size()));
189:                    request.getSession().setAttribute(
190:                            "disbursementDetailsList", paymentDetailList);
191:                }
192:            }
193:
194:            public void setPayeeTypeDao(PayeeTypeDao p) {
195:                payeeTypeDao = p;
196:            }
197:
198:            public void setPaymentDetailService(PaymentDetailService p) {
199:                paymentDetailService = p;
200:            }
201:
202:            public void setPaymentGroupService(PaymentGroupService p) {
203:                paymentGroupService = p;
204:            }
205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.