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


001:        /*
002:         * Copyright 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.document.authorization;
017:
018:        import java.util.ArrayList;
019:        import java.util.HashMap;
020:        import java.util.List;
021:        import java.util.Map;
022:
023:        import org.kuali.core.authorization.AuthorizationConstants;
024:        import org.kuali.core.bo.user.UniversalUser;
025:        import org.kuali.core.document.Document;
026:        import org.kuali.core.document.authorization.DocumentActionFlags;
027:        import org.kuali.core.document.authorization.TransactionalDocumentActionFlags;
028:        import org.kuali.core.exceptions.DocumentTypeAuthorizationException;
029:        import org.kuali.core.workflow.service.KualiWorkflowDocument;
030:        import org.kuali.kfs.KFSConstants;
031:        import org.kuali.kfs.document.authorization.AccountingDocumentAuthorizerBase;
032:        import org.kuali.workflow.KualiWorkflowUtils.RouteLevelNames;
033:
034:        /**
035:         * Document Authorizer for the Procurement Card document.
036:         */
037:        public class ProcurementCardDocumentAuthorizer extends
038:                AccountingDocumentAuthorizerBase {
039:
040:            /**
041:             * Overrides to call super and then blanketly reset the actions not allowed on the procurment card document.
042:             * 
043:             * @see org.kuali.core.authorization.DocumentAuthorizer#getDocumentActionFlags(org.kuali.core.document.Document,
044:             *      org.kuali.core.bo.user.KualiUser)
045:             */
046:            @Override
047:            public DocumentActionFlags getDocumentActionFlags(
048:                    Document document, UniversalUser user) {
049:                TransactionalDocumentActionFlags flags = new TransactionalDocumentActionFlags(
050:                        super .getDocumentActionFlags(document, user));
051:
052:                flags.setCanErrorCorrect(false); // PCDO doesn't allow error correction
053:
054:                flags.setCanCancel(false); // PCDO cannot be cancelled
055:
056:                flags.setCanDisapprove(false); // PCDO cannot be disapproved
057:
058:                flags.setCanCopy(false); // PCDO cannot be copied
059:
060:                return flags;
061:            }
062:
063:            /**
064:             * Override to set the editMode to fullEntry if the routing is at the first account review node (PCDO has 2), second account
065:             * review functions as normal.
066:             * 
067:             * @see org.kuali.core.authorization.DocumentAuthorizer#getEditMode(org.kuali.core.document.Document,
068:             *      org.kuali.core.bo.user.KualiUser)
069:             */
070:            @Override
071:            public Map getEditMode(Document document, UniversalUser user,
072:                    List sourceLines, List targetLines) {
073:                KualiWorkflowDocument workflowDocument = document
074:                        .getDocumentHeader().getWorkflowDocument();
075:                List activeNodes = getCurrentRouteLevels(workflowDocument);
076:
077:                List lineList = new ArrayList();
078:                lineList.addAll(sourceLines);
079:                lineList.addAll(targetLines);
080:
081:                Map editModeMap = new HashMap();
082:                // FULL_ENTRY only if: a) person has an approval request, b) we are at the correct level, c) it's not a correction
083:                // document, d) it is not an ADHOC request (important so that ADHOC don't get full entry).
084:                if (workflowDocument.isApprovalRequested()
085:                        && activeNodes
086:                                .contains(RouteLevelNames.ACCOUNT_REVIEW_FULL_EDIT)
087:                        && (document.getDocumentHeader()
088:                                .getFinancialDocumentInErrorNumber() == null)
089:                        && !document.getDocumentHeader().getWorkflowDocument()
090:                                .isAdHocRequested()) {
091:                    editModeMap
092:                            .put(
093:                                    AuthorizationConstants.TransactionalEditMode.FULL_ENTRY,
094:                                    "TRUE");
095:                } else {
096:                    editModeMap = super .getEditMode(document, user,
097:                            sourceLines, targetLines);
098:                }
099:
100:                return editModeMap;
101:            }
102:
103:            /**
104:             * Override to only allow the SYSTEM user to initiate a PCDO document
105:             * 
106:             * @see org.kuali.core.authorization.DocumentAuthorizer#canInitiate(java.lang.String, org.kuali.core.bo.user.KualiUser)
107:             */
108:            @Override
109:            public void canInitiate(String documentTypeName, UniversalUser user) {
110:                if (!KFSConstants.SYSTEM_USER.equalsIgnoreCase(user
111:                        .getPersonUserIdentifier())) {
112:                    throw new DocumentTypeAuthorizationException(user
113:                            .getPersonUserIdentifier(), "initiate",
114:                            documentTypeName);
115:                }
116:            }
117:
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.