Source Code Cross Referenced for SuperUserActionRequestApproveEvent.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » actions » 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 » edu.iu.uis.eden.actions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2006 The Kuali Foundation.
003:         *
004:         *
005:         * Licensed under the Educational Community License, Version 1.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * You may obtain a copy of the License at
008:         *
009:         * http://www.opensource.org/licenses/ecl1.php
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package edu.iu.uis.eden.actions;
018:
019:        import java.util.ArrayList;
020:        import java.util.List;
021:
022:        import org.apache.log4j.MDC;
023:
024:        import edu.iu.uis.eden.EdenConstants;
025:        import edu.iu.uis.eden.KEWServiceLocator;
026:        import edu.iu.uis.eden.WorkflowServiceErrorException;
027:        import edu.iu.uis.eden.WorkflowServiceErrorImpl;
028:        import edu.iu.uis.eden.actionrequests.ActionRequestFactory;
029:        import edu.iu.uis.eden.actionrequests.ActionRequestValue;
030:        import edu.iu.uis.eden.doctype.DocumentType;
031:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
032:        import edu.iu.uis.eden.exception.InvalidActionTakenException;
033:        import edu.iu.uis.eden.exception.WorkflowException;
034:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
035:        import edu.iu.uis.eden.user.WorkflowUser;
036:        import edu.iu.uis.eden.util.Utilities;
037:
038:        /**
039:         * Super user Approves a single action request.
040:         *
041:         * @author rkirkend
042:         * @author temay
043:         */
044:        public class SuperUserActionRequestApproveEvent extends
045:                SuperUserActionTakenEvent {
046:            private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
047:                    .getLogger(SuperUserActionRequestApproveEvent.class);
048:            private Long actionRequestId;
049:
050:            public SuperUserActionRequestApproveEvent(
051:                    DocumentRouteHeaderValue routeHeader, WorkflowUser user) {
052:                super (routeHeader, user);
053:                this .super UserAction = EdenConstants.SUPER_USER_ACTION_REQUEST_APPROVE;
054:            }
055:
056:            public SuperUserActionRequestApproveEvent(
057:                    DocumentRouteHeaderValue routeHeader, WorkflowUser user,
058:                    Long actionRequestId, String annotation) {
059:                super (routeHeader, user, annotation);
060:                this .super UserAction = EdenConstants.SUPER_USER_ACTION_REQUEST_APPROVE;
061:                this .actionRequestId = actionRequestId;
062:            }
063:
064:            public void setActionTaken() {
065:                String actionRequestCode = "";
066:
067:                ActionRequestValue actionRequest = getActionRequestService()
068:                        .findByActionRequestId(actionRequestId);
069:
070:                setActionRequest(actionRequest);
071:
072:                actionRequestCode = actionRequest.getActionRequested();
073:                //This has been set up for all of the actions, but this class only does approvals
074:                if (EdenConstants.ACTION_REQUEST_APPROVE_REQ
075:                        .equals(actionRequestCode)) {
076:                    this 
077:                            .setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_APPROVED_CD);
078:                } else if (EdenConstants.ACTION_REQUEST_COMPLETE_REQ
079:                        .equals(actionRequestCode)) {
080:                    this 
081:                            .setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_COMPLETED_CD);
082:                } else if (EdenConstants.ACTION_REQUEST_FYI_REQ
083:                        .equals(actionRequestCode)) {
084:                    this 
085:                            .setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_FYI_CD);
086:                } else if (EdenConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ
087:                        .equals(actionRequestCode)) {
088:                    this 
089:                            .setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_ACKNOWLEDGED_CD);
090:                } else {
091:                    //TODO this should be checked
092:                    LOG.error("Invalid SU delegation action request code: "
093:                            + actionRequestCode);
094:                    throw new RuntimeException(
095:                            "Invalid SU delegation action request code: "
096:                                    + actionRequestCode);
097:                }
098:            }
099:
100:            protected void processActionRequests()
101:                    throws InvalidActionTakenException,
102:                    EdenUserNotFoundException {
103:                //this method has been written to process all of the actions though only approvals are currently processed
104:
105:                DocumentType docType = getRouteHeader().getDocumentType();
106:                //        boolean userAuthorized = getDocumentTypeService().verifySUAuthority(docType, getUser());
107:
108:                String errorMessage = super .validateActionRules();
109:                if (!Utilities.isEmpty(errorMessage)) {
110:                    LOG.info("User not authorized");
111:                    List errors = new ArrayList();
112:                    errors.add(new WorkflowServiceErrorImpl(errorMessage,
113:                            SuperUserActionTakenEvent.AUTHORIZATION));
114:                    throw new WorkflowServiceErrorException(errorMessage,
115:                            errors);
116:                }
117:                //        if (!docType.isSuperUser(getUser())) {
118:                //            List errors = new ArrayList();
119:                //            errors.add(new WorkflowServiceErrorImpl("User not authorized for super user action", SuperUserActionTakenEvent.AUTHORIZATION));
120:                //            throw new WorkflowServiceErrorException("Super User Authorization Error", errors);
121:                //        }
122:
123:                this .setActionTaken();
124:
125:                MDC.put("docId", getRouteHeader().getRouteHeaderId());
126:
127:                if (annotation == null) {
128:                    annotation = "";
129:                }
130:
131:                LOG.debug("Super User Delegation Action on action request: "
132:                        + annotation);
133:                this .saveActionTaken(getActionRequest().getWorkflowUser());
134:
135:                LOG.debug("Deactivate this action request");
136:
137:                ActionRequestValue request = getActionRequest();
138:                getActionRequestService().deactivateRequest(actionTaken,
139:                        request);
140:                if (docType.getSuperUserApproveNotificationPolicy()
141:                        .getPolicyValue().booleanValue()
142:                        && request.isApproveOrCompleteRequest()) {
143:                    KEWServiceLocator
144:                            .getActionRequestService()
145:                            .activateRequest(
146:                                    new ActionRequestFactory(this 
147:                                            .getRouteHeader())
148:                                            .createNotificationRequest(
149:                                                    EdenConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ,
150:                                                    request.getWorkflowUser(),
151:                                                    this .getActionTakenCode(),
152:                                                    this .getUser(), null));
153:                }
154:                notifyActionTaken(this .actionTaken);
155:
156:                if (!(EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_FYI_CD
157:                        .equals(this .getActionTakenCode()) && EdenConstants.ACTION_TAKEN_SU_ACTION_REQUEST_ACKNOWLEDGED_CD
158:                        .equals(this .getActionTakenCode()))) {
159:                    if (getRouteHeader().isInException()) {
160:                        LOG
161:                                .debug("Moving document back to Enroute from Exception");
162:
163:                        String oldStatus = getRouteHeader().getDocRouteStatus();
164:                        this .getRouteHeader().markDocumentEnroute();
165:
166:                        String newStatus = getRouteHeader().getDocRouteStatus();
167:                        this .notifyStatusChange(newStatus, oldStatus);
168:                        getRouteHeaderService().saveRouteHeader(
169:                                getRouteHeader());
170:                    }
171:                }
172:            }
173:
174:            public void recordAction() throws InvalidActionTakenException,
175:                    EdenUserNotFoundException {
176:                checkLocking();
177:                this .processActionRequests();
178:                this .queueDocument();
179:            }
180:
181:            protected void markDocument() throws WorkflowException {
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.