Source Code Cross Referenced for MockRuleServiceImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » mocks » 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 » mocks 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2007 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 mocks;
018:
019:        import java.io.InputStream;
020:        import java.sql.Timestamp;
021:        import java.util.ArrayList;
022:        import java.util.Collection;
023:        import java.util.HashMap;
024:        import java.util.Iterator;
025:        import java.util.List;
026:        import java.util.Map;
027:
028:        import org.jdom.Element;
029:
030:        import edu.iu.uis.eden.EdenConstants;
031:        import edu.iu.uis.eden.doctype.DocumentType;
032:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
033:        import edu.iu.uis.eden.export.ExportDataSet;
034:        import edu.iu.uis.eden.routetemplate.MyRules2;
035:        import edu.iu.uis.eden.routetemplate.RuleBaseValues;
036:        import edu.iu.uis.eden.routetemplate.RuleDelegation;
037:        import edu.iu.uis.eden.routetemplate.RuleResponsibility;
038:        import edu.iu.uis.eden.routetemplate.RuleService;
039:        import edu.iu.uis.eden.user.UserId;
040:        import edu.iu.uis.eden.user.WorkflowUser;
041:        import edu.iu.uis.eden.workgroup.GroupId;
042:
043:        public class MockRuleServiceImpl implements  RuleService {
044:
045:            Map rules = new HashMap();
046:            Map responsibilitiesByKey = new HashMap();
047:            Map responsibilitiesById = new HashMap();
048:            Map responsibilitiesByReviewer = new HashMap();
049:            Map rulesByRouteHeaderId = new HashMap();
050:
051:            public RuleBaseValues getParentRule(Long ruleBaseValuesId) {
052:                return null;
053:            }
054:
055:            public List fetchAllCurrentRulesForTemplateDocCombination(
056:                    String ruleTemplateName, String documentType,
057:                    boolean ignoreCache) {
058:                return null;
059:            }
060:
061:            public Long isLockedForRouting(Long currentRuleBaseValuesId) {
062:                return null;
063:            }
064:
065:            public Long route2(Long routeHeaderId, MyRules2 myRules,
066:                    WorkflowUser user, String annotation, boolean blanketApprove)
067:                    throws Exception {
068:                return null;
069:            }
070:
071:            public Long routeRuleWithDelegate(Long routeHeaderId,
072:                    RuleBaseValues parentRule, RuleBaseValues delegateRule,
073:                    WorkflowUser user, String annotation, boolean blanketApprove)
074:                    throws Exception {
075:                return null;
076:            }
077:
078:            public List search(String docTypeName, Long ruleId,
079:                    Long ruleTemplateId, String ruleDescription,
080:                    Long workgroupId, String workflowId, String roleName,
081:                    Boolean delegateRule, Boolean activeInd, Map extensionValues) {
082:                return null;
083:            }
084:
085:            public List search(String docTypeName, String ruleTemplateName,
086:                    String ruleDescription, GroupId workgroupId, UserId userId,
087:                    String roleName, Boolean workgroupMember,
088:                    Boolean delegateRule, Boolean activeInd,
089:                    Map extensionValues, Collection<String> actionRequestCodes)
090:                    throws EdenUserNotFoundException {
091:                return null;
092:            }
093:
094:            public void notifyCacheOfRuleChange(RuleBaseValues rule,
095:                    DocumentType documentType) {
096:            }
097:
098:            public void addRule(RuleBaseValues rule) {
099:                rules.put(rule.getRuleBaseValuesId(), rule);
100:
101:                List routeHeaderList = null;
102:                if (rulesByRouteHeaderId.get(rule.getRouteHeaderId()) != null) {
103:                    routeHeaderList = (List) rulesByRouteHeaderId.get(rule
104:                            .getRouteHeaderId());
105:                } else {
106:                    routeHeaderList = new ArrayList();
107:                }
108:                routeHeaderList.add(rule);
109:                rulesByRouteHeaderId.put(rule.getRouteHeaderId(),
110:                        routeHeaderList);
111:
112:                for (Iterator iter = rule.getResponsibilities().iterator(); iter
113:                        .hasNext();) {
114:                    RuleResponsibility resp = (RuleResponsibility) iter.next();
115:                    responsibilitiesByKey.put(resp.getRuleResponsibilityKey(),
116:                            resp);
117:                    responsibilitiesById.put(resp.getResponsibilityId(), resp);
118:
119:                    List respList = null;
120:                    if (responsibilitiesByReviewer.get(resp
121:                            .getRuleResponsibilityName()) != null) {
122:                        respList = (List) responsibilitiesByReviewer.get(resp
123:                                .getRuleResponsibilityName());
124:                    } else {
125:                        respList = new ArrayList();
126:                    }
127:                    respList.add(resp);
128:                    responsibilitiesByReviewer.put(resp
129:                            .getRuleResponsibilityName(), respList);
130:                }
131:            }
132:
133:            public Long route2(MyRules2 myRules, WorkflowUser user,
134:                    String annotation) throws Exception {
135:                throw new UnsupportedOperationException(
136:                        "not implemented in MockRuleServiceImpl");
137:            }
138:
139:            public void delete(Long ruleBaseValuesId) {
140:                throw new UnsupportedOperationException(
141:                        "not implemented in MockRuleServiceImpl");
142:            }
143:
144:            public RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId) {
145:                return (RuleBaseValues) rules.get(ruleBaseValuesId);
146:            }
147:
148:            public List search(String docTypeName, Long ruleTemplateId,
149:                    Long workgroupId, String workflowId, String roleName,
150:                    Boolean delegateRule, Boolean activeInd, Map extensionValues) {
151:                throw new UnsupportedOperationException(
152:                        "not implemented in MockRuleServiceImpl");
153:            }
154:
155:            public RuleResponsibility findRuleResponsibility(
156:                    Long responsibilityId) {
157:                return (RuleResponsibility) responsibilitiesById
158:                        .get(responsibilityId);
159:            }
160:
161:            public void deleteRuleResponsibilityById(Long ruleResponsibilityId) {
162:                throw new UnsupportedOperationException(
163:                        "not implemented in MockRuleServiceImpl");
164:            }
165:
166:            public RuleResponsibility findByRuleResponsibilityId(
167:                    Long ruleResponsibilityId) {
168:                return (RuleResponsibility) responsibilitiesByKey
169:                        .get(ruleResponsibilityId);
170:            }
171:
172:            public List fetchAllCurrentRulesForTemplateDocCombination(
173:                    String ruleTemplateName, String documentType) {
174:                List ruleBaseValues = new ArrayList();
175:
176:                for (Iterator iter = rules.values().iterator(); iter.hasNext();) {
177:                    RuleBaseValues rule = (RuleBaseValues) iter.next();
178:                    if (rule.getRuleTemplate().getName().equals(
179:                            ruleTemplateName)
180:                            && rule.getDocTypeName().equals(documentType)) {
181:                        ruleBaseValues.add(rule);
182:                    }
183:                }
184:                return ruleBaseValues;
185:            }
186:
187:            public List findByRouteHeaderId(Long routeHeaderId) {
188:                return (List) rulesByRouteHeaderId.get(routeHeaderId);
189:            }
190:
191:            public void makeCurrent(Long routeHeaderId)
192:                    throws EdenUserNotFoundException {
193:                throw new UnsupportedOperationException(
194:                        "not implemented in MockRuleServiceImpl");
195:            }
196:
197:            public List findRuleBaseValuesByResponsibilityReviewer(
198:                    String reviewerName, String type) {
199:                List rules = new ArrayList();
200:                for (Iterator iter = ((List) responsibilitiesByReviewer
201:                        .get(reviewerName)).iterator(); iter.hasNext();) {
202:                    RuleResponsibility resp = (RuleResponsibility) iter.next();
203:                    if (resp.getRuleResponsibilityType().equals(type)) {
204:                        rules.add(resp.getRuleBaseValues());
205:                    }
206:                }
207:                return rules;
208:            }
209:
210:            public List fetchAllRules(boolean currentRules) {
211:                return new ArrayList(rules.values());
212:            }
213:
214:            public void saveDeactivationDate(RuleBaseValues rule) {
215:                // do anything?
216:            }
217:
218:            public void validate2(RuleBaseValues ruleBaseValues,
219:                    RuleDelegation ruleDelegation, List errors)
220:                    throws Exception {
221:                throw new UnsupportedOperationException(
222:                        "not implemented in MockRuleServiceImpl");
223:            }
224:
225:            public List fetchAllCurrentRulesForTemplateDocCombination(
226:                    String ruleTemplateName, String documentType,
227:                    Timestamp effectiveDate) {
228:                return null;
229:            }
230:
231:            public RuleBaseValues findDefaultRuleByRuleTemplateId(
232:                    Long ruleTemplateId) {
233:                return null;
234:            }
235:
236:            public void save2(RuleBaseValues ruleBaseValues) throws Exception {
237:                throw new UnsupportedOperationException(
238:                        "not implemented in MockRuleServiceImpl");
239:            }
240:
241:            public void loadXml(InputStream inputStream, WorkflowUser user) {
242:                throw new UnsupportedOperationException(
243:                        "not implemented in MockRuleServiceImpl");
244:            }
245:
246:            public Element export(ExportDataSet dataSet) {
247:                throw new UnsupportedOperationException(
248:                        "not implemented in MockRuleServiceImpl");
249:            }
250:
251:            public void notifyCacheOfDocumentTypeChange(
252:                    DocumentType documentType) {
253:
254:            }
255:
256:            public String getRuleDocmentTypeName(List rules) {
257:                return EdenConstants.DEFAULT_RULE_DOCUMENT_NAME;
258:            }
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.