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


001:        /*
002:         * Copyright 2006-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.kra.budget.web.struts.action;
017:
018:        import javax.servlet.http.HttpServletRequest;
019:        import javax.servlet.http.HttpServletResponse;
020:
021:        import org.apache.struts.action.ActionForm;
022:        import org.apache.struts.action.ActionForward;
023:        import org.apache.struts.action.ActionMapping;
024:        import org.kuali.core.authorization.AuthorizationConstants;
025:        import org.kuali.core.service.DocumentAuthorizationService;
026:        import org.kuali.core.service.KualiRuleService;
027:        import org.kuali.kfs.KFSConstants;
028:        import org.kuali.kfs.context.SpringContext;
029:        import org.kuali.module.kra.budget.bo.BudgetModular;
030:        import org.kuali.module.kra.budget.rules.event.EnterModularEvent;
031:        import org.kuali.module.kra.budget.rules.event.SaveModularEvent;
032:        import org.kuali.module.kra.budget.service.BudgetModularService;
033:        import org.kuali.module.kra.budget.web.struts.form.BudgetForm;
034:
035:        /**
036:         * This class handles Actions for the Budget Modular page.
037:         */
038:        public class BudgetModularAction extends BudgetAction {
039:
040:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
041:                    .getLogger(BudgetModularAction.class);
042:
043:            /**
044:             * Save the form, and then reload/recalculate values.
045:             * 
046:             * @param mapping
047:             * @param form
048:             * @param request
049:             * @param response
050:             * @throws Exception
051:             */
052:            public ActionForward saveAndRegenerate(ActionMapping mapping,
053:                    ActionForm form, HttpServletRequest request,
054:                    HttpServletResponse response) throws Exception {
055:
056:                BudgetForm budgetForm = (BudgetForm) form;
057:
058:                ActionForward forward = save(mapping, form, request, response);
059:
060:                SpringContext.getBean(BudgetModularService.class)
061:                        .generateModularBudget(
062:                                budgetForm.getBudgetDocument().getBudget(),
063:                                budgetForm.getNonpersonnelCategories());
064:
065:                SpringContext.getBean(KualiRuleService.class).applyRules(
066:                        new EnterModularEvent(budgetForm.getDocument()));
067:
068:                return forward;
069:            }
070:
071:            /**
072:             * Save the form.
073:             * 
074:             * @param mapping
075:             * @param form
076:             * @param request
077:             * @param response
078:             * @throws Exception
079:             */
080:            public ActionForward save(ActionMapping mapping, ActionForm form,
081:                    HttpServletRequest request, HttpServletResponse response)
082:                    throws Exception {
083:
084:                BudgetForm budgetForm = (BudgetForm) form;
085:                BudgetModular modular = budgetForm.getBudgetDocument()
086:                        .getBudget().getModularBudget();
087:
088:                this .load(mapping, budgetForm, request, response);
089:                budgetForm.getBudgetDocument().getBudget().setModularBudget(
090:                        modular);
091:
092:                // check business rules
093:                boolean rulePassed = true;
094:                budgetForm.populateAuthorizationFields(SpringContext.getBean(
095:                        DocumentAuthorizationService.class)
096:                        .getDocumentAuthorizer(budgetForm.getBudgetDocument()));
097:                if (!"TRUE".equals(budgetForm.getEditingMode().get(
098:                        AuthorizationConstants.EditMode.VIEW_ONLY))) {
099:                    rulePassed = SpringContext.getBean(KualiRuleService.class)
100:                            .applyRules(
101:                                    new SaveModularEvent(budgetForm
102:                                            .getDocument()));
103:                }
104:
105:                ActionForward super Forward = mapping
106:                        .findForward(KFSConstants.MAPPING_BASIC);
107:                if (rulePassed
108:                        && !budgetForm.getBudgetDocument().getBudget()
109:                                .getModularBudget().isInvalidMode()) {
110:                    super Forward = super .save(mapping, form, request, response);
111:                }
112:
113:                return super Forward;
114:            }
115:
116:            /**
117:             * Recalculate the form values without saving/reloading.
118:             * 
119:             * @param mapping
120:             * @param form
121:             * @param request
122:             * @param response
123:             * @throws Exception
124:             */
125:            public ActionForward recalculate(ActionMapping mapping,
126:                    ActionForm form, HttpServletRequest request,
127:                    HttpServletResponse response) throws Exception {
128:                BudgetForm budgetForm = (BudgetForm) form;
129:                BudgetModular modular = budgetForm.getBudgetDocument()
130:                        .getBudget().getModularBudget();
131:
132:                this .load(mapping, budgetForm, request, response);
133:                budgetForm.getBudgetDocument().getBudget().setModularBudget(
134:                        modular);
135:
136:                SpringContext.getBean(BudgetModularService.class)
137:                        .generateModularBudget(
138:                                budgetForm.getBudgetDocument().getBudget(),
139:                                budgetForm.getNonpersonnelCategories());
140:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
141:            }
142:
143:            /**
144:             * Reload from the database & recalculate all derived values.
145:             * 
146:             * @param mapping
147:             * @param form
148:             * @param request
149:             * @param response
150:             * @throws Exception
151:             */
152:            public ActionForward reload(ActionMapping mapping, ActionForm form,
153:                    HttpServletRequest request, HttpServletResponse response)
154:                    throws Exception {
155:                super .reload(mapping, form, request, response);
156:                BudgetForm budgetForm = (BudgetForm) form;
157:
158:                SpringContext.getBean(BudgetModularService.class)
159:                        .generateModularBudget(
160:                                budgetForm.getBudgetDocument().getBudget(),
161:                                budgetForm.getNonpersonnelCategories());
162:                SpringContext.getBean(KualiRuleService.class).applyRules(
163:                        new EnterModularEvent(budgetForm.getDocument()));
164:
165:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
166:            }
167:        }
w__w__w_._j___a_va__2s.__c___o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.