Source Code Cross Referenced for BatchMaintenanceAction.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » pdp » action » paymentmaintenance » 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.paymentmaintenance 
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 24, 2004
018:         */
019:        package org.kuali.module.pdp.action.paymentmaintenance;
020:
021:        import java.util.List;
022:
023:        import javax.servlet.http.HttpServletRequest;
024:        import javax.servlet.http.HttpServletResponse;
025:        import javax.servlet.http.HttpSession;
026:
027:        import org.apache.struts.action.ActionErrors;
028:        import org.apache.struts.action.ActionForm;
029:        import org.apache.struts.action.ActionForward;
030:        import org.apache.struts.action.ActionMapping;
031:        import org.apache.struts.action.ActionMessage;
032:        import org.kuali.kfs.context.SpringContext;
033:        import org.kuali.module.pdp.action.BaseAction;
034:        import org.kuali.module.pdp.bo.Batch;
035:        import org.kuali.module.pdp.form.paymentmaintenance.PaymentMaintenanceForm;
036:        import org.kuali.module.pdp.service.BatchMaintenanceService;
037:        import org.kuali.module.pdp.service.SecurityRecord;
038:        import org.kuali.module.pdp.utilities.GeneralUtilities;
039:
040:        /**
041:         * @author delyea
042:         */
043:        public class BatchMaintenanceAction extends BaseAction {
044:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
045:                    .getLogger(BatchMaintenanceAction.class);
046:            private BatchMaintenanceService batchMaintenanceService;
047:
048:            public BatchMaintenanceAction() {
049:                setBatchMaintenanceService(SpringContext
050:                        .getBean(BatchMaintenanceService.class));
051:            }
052:
053:            public void setBatchMaintenanceService(BatchMaintenanceService p) {
054:                this .batchMaintenanceService = p;
055:            }
056:
057:            protected boolean isAuthorized(ActionMapping mapping,
058:                    ActionForm form, HttpServletRequest request,
059:                    HttpServletResponse response) {
060:                SecurityRecord sr = getSecurityRecord(request);
061:                return sr.isLimitedViewRole() || sr.isViewAllRole()
062:                        || sr.isViewIdRole() || sr.isViewBankRole();
063:            }
064:
065:            protected ActionForward executeLogic(ActionMapping mapping,
066:                    ActionForm form, HttpServletRequest request,
067:                    HttpServletResponse response) throws Exception {
068:                LOG.debug("executeLogic() started");
069:
070:                HttpSession session = request.getSession();
071:                List batchSearchList = (List) session
072:                        .getAttribute("batchIndivSearchResults");
073:                SecurityRecord sr = (SecurityRecord) session
074:                        .getAttribute("SecurityRecord");
075:                Batch b = (Batch) session.getAttribute("BatchDetail");
076:                PaymentMaintenanceForm pmf = (PaymentMaintenanceForm) form;
077:                String forward = "update";
078:
079:                ActionErrors actionErrors = new ActionErrors();
080:                String buttonPressed = GeneralUtilities
081:                        .whichButtonWasPressed(request);
082:
083:                LOG
084:                        .debug("executeLogic() BatchMaintenanceAction ButtonPressed was "
085:                                + buttonPressed);
086:                if (buttonPressed != null) {
087:                    if (b == null) {
088:                        LOG.info("executeLogic() Batch object 'b' is null");
089:                        return mapping.findForward("pdp_session_timeout");
090:
091:                    } else if (buttonPressed.startsWith("btnBatch")) {
092:                        // Action Originated from BatchDetail Screen
093:                        if (buttonPressed.startsWith("btnBatchHold")) {
094:                            pmf.setAction("batchHold");
095:                            if (batchMaintenanceService
096:                                    .doBatchPaymentsHaveOpenStatus(b.getId())) {
097:                                pmf.setChangeId(b.getId());
098:                            } else {
099:                                actionErrors
100:                                        .add(
101:                                                "errors",
102:                                                new ActionMessage(
103:                                                        "batchMaintenanceAction.batchStatus.notAllOpen"));
104:                            }
105:                        } else if (buttonPressed.startsWith("btnBatchCancel")) {
106:                            pmf.setAction("batchCancel");
107:                            if (batchMaintenanceService
108:                                    .doBatchPaymentsHaveOpenOrHeldStatus(b
109:                                            .getId())) {
110:                                pmf.setChangeId(b.getId());
111:                            } else {
112:                                actionErrors
113:                                        .add(
114:                                                "errors",
115:                                                new ActionMessage(
116:                                                        "batchMaintenanceAction.batchStatus.notAllOpenOrHeld"));
117:                            }
118:                        } else if (buttonPressed
119:                                .startsWith("btnBatchRemoveHold")) {
120:                            pmf.setAction("batchRemoveHold");
121:                            if (batchMaintenanceService
122:                                    .doBatchPaymentsHaveHeldStatus(b.getId())) {
123:                                pmf.setChangeId(b.getId());
124:                            } else {
125:                                actionErrors
126:                                        .add(
127:                                                "errors",
128:                                                new ActionMessage(
129:                                                        "batchMaintenanceAction.batchStatus.notAllHeld"));
130:                            }
131:                        } else {
132:                            // Invalid Button was Pressed
133:                            return mapping.findForward("pdp_system_error");
134:                        }
135:                        if (!actionErrors.isEmpty()) {
136:                            forward = "batch";
137:                        }
138:
139:                    } else if (buttonPressed.startsWith("btnUpdate")) {
140:                        // Action Originated from Update page
141:                        if (buttonPressed.startsWith("btnUpdateClear")) {
142:                            pmf.setChangeText(null);
143:                            return mapping.findForward("update");
144:
145:                        } else if (buttonPressed.startsWith("btnUpdateSave")) {
146:                            String action = pmf.getAction();
147:                            LOG.debug("executeLogic() string 'action' is "
148:                                    + action);
149:
150:                            // All Actions must be performed on Payment Group that Payment Detail is a member of
151:                            if (action.equals("batchHold")) {
152:                                if (sr.isHoldRole()) {
153:                                    LOG
154:                                            .debug("executeLogic() running holdPendingBatch now");
155:                                    // ChangeID was previous set to BatchID
156:                                    batchMaintenanceService.holdPendingBatch(
157:                                            pmf.getChangeId(), pmf
158:                                                    .getChangeText(),
159:                                            getUser(request));
160:                                    actionErrors
161:                                            .add(
162:                                                    "success",
163:                                                    new ActionMessage(
164:                                                            "success.paymentUpdate.saved"));
165:                                } else {
166:                                    actionErrors
167:                                            .add(
168:                                                    "error",
169:                                                    new ActionMessage(
170:                                                            "paymentMaintenanceAction.paymentUpdate.notAuthorized"));
171:                                }
172:                            } else if (action.equals("batchRemoveHold")) {
173:                                if (sr.isHoldRole()) {
174:                                    LOG
175:                                            .debug("executeLogic() running removeBatchHold now");
176:                                    // ChangeID was previous set to BatchID
177:                                    batchMaintenanceService.removeBatchHold(pmf
178:                                            .getChangeId(),
179:                                            pmf.getChangeText(),
180:                                            getUser(request));
181:                                    actionErrors
182:                                            .add(
183:                                                    "success",
184:                                                    new ActionMessage(
185:                                                            "success.paymentUpdate.saved"));
186:                                } else {
187:                                    actionErrors
188:                                            .add(
189:                                                    "error",
190:                                                    new ActionMessage(
191:                                                            "paymentMaintenanceAction.paymentUpdate.notAuthorized"));
192:                                }
193:                            } else if (action.equals("batchCancel")) {
194:                                if (sr.isCancelRole()) {
195:                                    LOG
196:                                            .debug("executeLogic() running cancelPendingBatch now");
197:                                    // ChangeID was previous set to BatchID
198:                                    batchMaintenanceService.cancelPendingBatch(
199:                                            pmf.getChangeId(), pmf
200:                                                    .getChangeText(),
201:                                            getUser(request));
202:                                    actionErrors
203:                                            .add(
204:                                                    "success",
205:                                                    new ActionMessage(
206:                                                            "success.paymentUpdate.saved"));
207:                                } else {
208:                                    actionErrors
209:                                            .add(
210:                                                    "error",
211:                                                    new ActionMessage(
212:                                                            "paymentMaintenanceAction.paymentUpdate.notAuthorized"));
213:                                }
214:                            }
215:                        }
216:                        forward = "batch";
217:                    }
218:                }
219:
220:                // If we had errors, save them
221:                if (!actionErrors.isEmpty()) {
222:                    saveErrors(request, actionErrors);
223:                }
224:
225:                request.setAttribute("PaymentMaintenanceForm", pmf);
226:                return mapping.findForward(forward);
227:            }
228:
229:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.