Source Code Cross Referenced for ClearFYIAction.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.Iterator;
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.actionrequests.ActionRequestValue;
026:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
027:        import edu.iu.uis.eden.exception.InvalidActionTakenException;
028:        import edu.iu.uis.eden.exception.ResourceUnavailableException;
029:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
030:        import edu.iu.uis.eden.user.WorkflowUser;
031:        import edu.iu.uis.eden.util.Utilities;
032:
033:        /**
034:         *
035:         * ClearFYIAction deactivates the user requests.
036:         *
037:         * The routeheader is first checked to make sure the action is valid for the document.
038:         * Next the user is checked to make sure he/she has not taken a previous action on this
039:         * document at the actions responsibility or below. Any requests related to this user
040:         * are deactivated.
041:         *
042:         *  @author rkirkend
043:         *  @author ewestfal
044:         *  @author seiffert
045:         */
046:        public class ClearFYIAction extends ActionTakenEvent {
047:            private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
048:                    .getLogger(ClearFYIAction.class);
049:
050:            /**
051:             * @param rh
052:             *            RouteHeader for the document upon which the action is taken.
053:             * @param user
054:             *            User taking the action.
055:             */
056:            public ClearFYIAction(DocumentRouteHeaderValue rh, WorkflowUser user) {
057:                super (rh, user);
058:                setActionTakenCode(EdenConstants.ACTION_TAKEN_FYI_CD);
059:            }
060:
061:            /**
062:             * @param rh
063:             *            RouteHeader for the document upon which the action is taken.
064:             * @param user
065:             *            User taking the action.
066:             * @param annotation
067:             *            User comment on the action taken
068:             */
069:            public ClearFYIAction(DocumentRouteHeaderValue rh,
070:                    WorkflowUser user, String annotation) {
071:                super (rh, user, annotation);
072:                setActionTakenCode(EdenConstants.ACTION_TAKEN_FYI_CD);
073:            }
074:
075:            /* (non-Javadoc)
076:             * @see edu.iu.uis.eden.actions.ActionTakenEvent#requireInitiatorCheck()
077:             */
078:            @Override
079:            protected boolean requireInitiatorCheck() {
080:                return false;
081:            }
082:
083:            /**
084:             * Method to check if the Action is currently valid on the given document
085:             * @return  returns an error message to give system better identifier for problem
086:             */
087:            public String validateActionRules()
088:                    throws EdenUserNotFoundException {
089:                return validateActionRules(getActionRequestService()
090:                        .findAllValidRequests(getUser(),
091:                                routeHeader.getRouteHeaderId(),
092:                                EdenConstants.ACTION_REQUEST_FYI_REQ));
093:            }
094:
095:            private String validateActionRules(List actionRequests)
096:                    throws EdenUserNotFoundException {
097:                String super Error = super .validateActionTakenRules();
098:                if (!Utilities.isEmpty(super Error)) {
099:                    return super Error;
100:                }
101:                if (!getRouteHeader().isValidActionToTake(
102:                        getActionPerformedCode())) {
103:                    return "Document is not in a state to have FYI processed";
104:                }
105:                if (!isActionCompatibleRequest(actionRequests)) {
106:                    return "No request for the user is compatible "
107:                            + "with the ClearFYI action";
108:                }
109:                return "";
110:            }
111:
112:            public boolean isActionCompatibleRequest(List requests)
113:                    throws EdenUserNotFoundException {
114:
115:                // can always cancel saved or initiated document
116:                if (routeHeader.isStateInitiated()
117:                        || routeHeader.isStateSaved()) {
118:                    return true;
119:                }
120:
121:                boolean actionCompatible = false;
122:                Iterator ars = requests.iterator();
123:                ActionRequestValue actionRequest = null;
124:
125:                while (ars.hasNext()) {
126:                    actionRequest = (ActionRequestValue) ars.next();
127:
128:                    //FYI request matches all but deny and cancel
129:                    if (EdenConstants.ACTION_REQUEST_FYI_REQ
130:                            .equals(actionRequest.getActionRequested())) {
131:                        actionCompatible = true;
132:                        break;
133:                    }
134:                }
135:
136:                return actionCompatible;
137:            }
138:
139:            /**
140:             * Processes the clear FYI action. - Checks to make sure the document status allows the action. - Checks that the user has not taken a previous action. - Deactivates the pending requests for this user
141:             *
142:             * @throws InvalidActionTakenException
143:             * @throws ResourceUnavailableException
144:             */
145:            public void recordAction() throws InvalidActionTakenException,
146:                    EdenUserNotFoundException {
147:                MDC.put("docId", getRouteHeader().getRouteHeaderId());
148:                checkLocking();
149:                updateSearchableAttributesIfPossible();
150:
151:                LOG.debug("Clear FYI for document : " + annotation);
152:                LOG.debug("Checking to see if the action is legal");
153:
154:                List actionRequests = getActionRequestService()
155:                        .findAllValidRequests(getUser(), getRouteHeaderId(),
156:                                EdenConstants.ACTION_REQUEST_FYI_REQ);
157:                String errorMessage = validateActionRules(actionRequests);
158:                if (!Utilities.isEmpty(errorMessage)) {
159:                    throw new InvalidActionTakenException(errorMessage);
160:                }
161:
162:                //        if (!getRouteHeader().isValidActionToTake(getActionTakenCode())) {
163:                //            LOG.warn("Document not in state to have FYI processed.");
164:                //            throw new InvalidActionTakenException("Document is not in a state to have FYI processed");
165:                //        }
166:                //
167:                //        List actionRequests = getActionRequestService().findAllValidRequests(getUser(), getRouteHeaderId(), EdenConstants.ACTION_REQUEST_FYI_REQ);
168:                //        if (!isActionCompatibleRequest(actionRequests, getActionTakenCode())) {
169:                //            throw new InvalidActionTakenException("No request for the user is compatible with the ClearFYI Action");
170:                //        }
171:
172:                saveActionTaken(findDelegatorForActionRequests(actionRequests));
173:
174:                LOG.debug("Deactivate all pending action requests");
175:                getActionRequestService().deactivateRequests(actionTaken,
176:                        actionRequests);
177:                notifyActionTaken(this.actionTaken);
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.