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


001:        /*
002:         * Copyright 2005-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.financial.web.struts.action;
017:
018:        import javax.servlet.http.HttpServletRequest;
019:        import javax.servlet.http.HttpServletResponse;
020:
021:        import org.apache.commons.lang.StringUtils;
022:        import org.apache.struts.action.ActionForm;
023:        import org.apache.struts.action.ActionForward;
024:        import org.apache.struts.action.ActionMapping;
025:        import org.kuali.core.document.Document;
026:        import org.kuali.core.document.authorization.DocumentAuthorizer;
027:        import org.kuali.core.service.DocumentAuthorizationService;
028:        import org.kuali.kfs.KFSConstants;
029:        import org.kuali.kfs.context.SpringContext;
030:        import org.kuali.module.financial.document.AuxiliaryVoucherDocument;
031:        import org.kuali.module.financial.web.struts.form.AuxiliaryVoucherForm;
032:
033:        /**
034:         * This class piggy backs on all of the functionality in the KualiTransactionalDocumentActionBase but is necessary for this document
035:         * type. The Auxiliary Voucher is unique in that it defines several fields that aren't typically used by the other financial
036:         * transaction processing eDocs (i.e. external system fields, object type override, credit and debit amounts).
037:         */
038:        public class AuxiliaryVoucherAction extends VoucherAction {
039:            /**
040:             * Overrides the parent and then calls the super method after checking to see if the user just changed the voucher type.
041:             * 
042:             * @see org.kuali.core.web.struts.action.KualiAction#execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
043:             *      HttpServletResponse response)
044:             */
045:            @Override
046:            public ActionForward execute(ActionMapping mapping,
047:                    ActionForm form, HttpServletRequest request,
048:                    HttpServletResponse response) throws Exception {
049:                AuxiliaryVoucherForm avForm = (AuxiliaryVoucherForm) form;
050:
051:                // now check to see if the voucher type was changed and if so, we want to
052:                // set the method to call so that the appropriate action can be invoked
053:                // did it this way b/c the changing of the type causes the page to re-submit
054:                // and we need to process some stuff if it's changed
055:                ActionForward returnForward;
056:                if (StringUtils.isNotBlank(avForm.getOriginalVoucherType())
057:                        && !avForm.getAuxiliaryVoucherDocument().getTypeCode()
058:                                .equals(avForm.getOriginalVoucherType())) {
059:                    returnForward = super .dispatchMethod(mapping, form,
060:                            request, response,
061:                            KFSConstants.AuxiliaryVoucher.CHANGE_VOUCHER_TYPE);
062:                    // must call this here, because execute in the super method will never have control for this particular action
063:                    // this is called in the parent by super.execute()
064:                    Document document = avForm.getDocument();
065:                    DocumentAuthorizer documentAuthorizer = SpringContext
066:                            .getBean(DocumentAuthorizationService.class)
067:                            .getDocumentAuthorizer(document);
068:                    avForm.populateAuthorizationFields(documentAuthorizer);
069:                } else { // otherwise call the super
070:                    returnForward = super .execute(mapping, avForm, request,
071:                            response);
072:                }
073:                return returnForward;
074:            }
075:
076:            /**
077:             * This action method is responsible for clearing the GLPEs for an AV after the voucher type changes, since a voucher type
078:             * change makes any previously generated GLPEs inaccurate.
079:             * 
080:             * @param mapping
081:             * @param form
082:             * @param request
083:             * @param response
084:             * @return ActionForward
085:             * @throws Exception
086:             */
087:            public ActionForward changeVoucherType(ActionMapping mapping,
088:                    ActionForm form, HttpServletRequest request,
089:                    HttpServletResponse response) throws Exception {
090:                AuxiliaryVoucherForm avForm = (AuxiliaryVoucherForm) form;
091:
092:                AuxiliaryVoucherDocument avDoc = avForm
093:                        .getAuxiliaryVoucherDocument();
094:
095:                // clear the glpes now
096:                avDoc.getGeneralLedgerPendingEntries().clear();
097:
098:                // make sure to set the original type to the new one now
099:                avForm.setOriginalVoucherType(avDoc.getTypeCode());
100:
101:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
102:            }
103:
104:            /**
105:             * @see org.kuali.core.web.struts.action.KualiDocumentActionBase#docHandler(org.apache.struts.action.ActionMapping,
106:             *      org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
107:             */
108:            @Override
109:            public ActionForward docHandler(ActionMapping mapping,
110:                    ActionForm form, HttpServletRequest request,
111:                    HttpServletResponse response) throws Exception {
112:                ActionForward forward = super .docHandler(mapping, form,
113:                        request, response);
114:
115:                // Fix for KULEDOCS-1701, update the original voucher type so that the execute method in
116:                // this class will call the right block of code
117:                AuxiliaryVoucherForm avForm = (AuxiliaryVoucherForm) form;
118:                AuxiliaryVoucherDocument avDoc = avForm
119:                        .getAuxiliaryVoucherDocument();
120:                avForm.setOriginalVoucherType(avDoc.getTypeCode());
121:
122:                return forward;
123:            }
124:        }
w___w_w___.j___a__v_a_2s___.c___om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.