Source Code Cross Referenced for CashManagementStatusAction.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 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.financial.web.struts.action;
017:
018:        import java.util.Properties;
019:
020:        import javax.servlet.http.HttpServletRequest;
021:        import javax.servlet.http.HttpServletResponse;
022:
023:        import org.apache.log4j.Logger;
024:        import org.apache.struts.Globals;
025:        import org.apache.struts.action.ActionForm;
026:        import org.apache.struts.action.ActionForward;
027:        import org.apache.struts.action.ActionMapping;
028:        import org.apache.struts.action.ActionMessage;
029:        import org.apache.struts.action.ActionMessages;
030:        import org.kuali.core.service.DocumentTypeService;
031:        import org.kuali.core.util.UrlFactory;
032:        import org.kuali.core.web.struts.action.KualiAction;
033:        import org.kuali.kfs.KFSConstants;
034:        import org.kuali.kfs.KFSKeyConstants;
035:        import org.kuali.kfs.context.SpringContext;
036:        import org.kuali.module.financial.document.CashManagementDocument;
037:        import org.kuali.module.financial.exceptions.CashDrawerStateException;
038:        import org.kuali.module.financial.web.struts.form.CashManagementStatusForm;
039:
040:        /**
041:         * Action class for CashManagementStatusForm
042:         */
043:        public class CashManagementStatusAction extends KualiAction {
044:            private static Logger LOG = Logger
045:                    .getLogger(CashManagementStatusAction.class);
046:
047:            /**
048:             * Default constructor
049:             */
050:            public CashManagementStatusAction() {
051:            }
052:
053:            /**
054:             * @see org.kuali.core.web.struts.action.KualiAction#execute(org.apache.struts.action.ActionMapping,
055:             *      org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
056:             */
057:            public ActionForward execute(ActionMapping mapping,
058:                    ActionForm form, HttpServletRequest request,
059:                    HttpServletResponse response) throws Exception {
060:                // populate with exception values, if any
061:                CashManagementStatusForm cform = (CashManagementStatusForm) form;
062:                CashDrawerStateException e = (CashDrawerStateException) request
063:                        .getAttribute(Globals.EXCEPTION_KEY);
064:                if (e != null) {
065:                    cform.setMethodToCall("displayPage");
066:
067:                    cform.setVerificationUnit(e.getVerificationUnit());
068:                    cform
069:                            .setControllingDocumentId(e
070:                                    .getControllingDocumentId());
071:                    cform.setCurrentDrawerStatus(e.getCurrentDrawerStatus());
072:                    cform.setDesiredDrawerStatus(e.getDesiredDrawerStatus());
073:                }
074:
075:                // generate the status message
076:                String[] msgParams = { cform.getVerificationUnit(),
077:                        cform.getControllingDocumentId(),
078:                        cform.getCurrentDrawerStatus(),
079:                        cform.getDesiredDrawerStatus() };
080:
081:                ActionMessage message = new ActionMessage(
082:                        KFSKeyConstants.CashDrawer.MSG_CASH_DRAWER_ALREADY_OPEN,
083:                        msgParams);
084:
085:                ActionMessages messages = new ActionMessages();
086:                messages.add(ActionMessages.GLOBAL_MESSAGE, message);
087:                saveMessages(request, messages);
088:
089:                return super .execute(mapping, form, request, response);
090:            }
091:
092:            /**
093:             * Displays the status page. When requests get redirected here, I need to reset the form's methodToCall to something nonblank or
094:             * the superclass will try to invoke a method which (probably) doesn't exist in this class.
095:             * 
096:             * @param mapping
097:             * @param form
098:             * @param request
099:             * @param response
100:             * @throws Exception
101:             */
102:            public ActionForward displayPage(ActionMapping mapping,
103:                    ActionForm form, HttpServletRequest request,
104:                    HttpServletResponse response) throws Exception {
105:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
106:            }
107:
108:            /**
109:             * Returns the user to the index page.
110:             * 
111:             * @param mapping
112:             * @param form
113:             * @param request
114:             * @param response
115:             * @throws Exception
116:             */
117:            public ActionForward returnToIndex(ActionMapping mapping,
118:                    ActionForm form, HttpServletRequest request,
119:                    HttpServletResponse response) throws Exception {
120:                return mapping.findForward(KFSConstants.MAPPING_CLOSE);
121:            }
122:
123:            /**
124:             * Sends the user to the existing CashManagementDocument.
125:             * 
126:             * @param mapping
127:             * @param form
128:             * @param request
129:             * @param response
130:             * @throws Exception
131:             */
132:            public ActionForward openExisting(ActionMapping mapping,
133:                    ActionForm form, HttpServletRequest request,
134:                    HttpServletResponse response) throws Exception {
135:                CashManagementStatusForm cform = (CashManagementStatusForm) form;
136:
137:                String cmDocTypeName = SpringContext.getBean(
138:                        DocumentTypeService.class).getDocumentTypeNameByClass(
139:                        CashManagementDocument.class);
140:
141:                Properties params = new Properties();
142:                params.setProperty("methodToCall", "docHandler");
143:                params.setProperty("command", "displayDocSearchView");
144:                params.setProperty("docId", cform.getControllingDocumentId());
145:
146:                String cmActionUrl = UrlFactory.parameterizeUrl(
147:                        KFSConstants.CASH_MANAGEMENT_DOCUMENT_ACTION, params);
148:
149:                return new ActionForward(cmActionUrl, true);
150:            }
151:        }
w_w___w__.ja___v__a__2___s_._c_o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.