Source Code Cross Referenced for ActionTakenValue.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » actiontaken » 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.actiontaken 
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.actiontaken;
018:
019:        import java.sql.Timestamp;
020:        import java.util.ArrayList;
021:        import java.util.Collection;
022:
023:        import org.apache.commons.beanutils.BeanUtils;
024:
025:        import edu.iu.uis.eden.EdenConstants;
026:        import edu.iu.uis.eden.KEWServiceLocator;
027:        import edu.iu.uis.eden.WorkflowPersistable;
028:        import edu.iu.uis.eden.actionrequests.ActionRequestService;
029:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
030:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
031:        import edu.iu.uis.eden.user.Recipient;
032:        import edu.iu.uis.eden.user.UserService;
033:        import edu.iu.uis.eden.user.WorkflowUser;
034:        import edu.iu.uis.eden.user.WorkflowUserId;
035:        import edu.iu.uis.eden.util.CodeTranslator;
036:        import edu.iu.uis.eden.workgroup.WorkflowGroupId;
037:        import edu.iu.uis.eden.workgroup.Workgroup;
038:        import edu.iu.uis.eden.workgroup.WorkgroupService;
039:
040:        /**
041:         * Model object mapped to ojb for representing actions taken on documents by 
042:         * users.
043:         *
044:         * @author rkirkend
045:         * @author ewestfal
046:         */
047:        public class ActionTakenValue implements  WorkflowPersistable {
048:
049:            /**
050:             * 
051:             */
052:            private static final long serialVersionUID = -81505450567067594L;
053:            private Long actionTakenId;
054:            private Long routeHeaderId;
055:            private String actionTaken;
056:            private Timestamp actionDate;
057:            private String annotation = "";
058:            private Integer docVersion;
059:            private Integer lockVerNbr;
060:            private String workflowId;
061:            private String delegatorWorkflowId;
062:            private Long delegatorWorkgroupId;
063:            private DocumentRouteHeaderValue routeHeader;
064:            private Collection actionRequests;
065:            private Boolean currentIndicator = new Boolean(true);
066:            private String actionDateString;
067:
068:            public WorkflowUser getWorkflowUser()
069:                    throws EdenUserNotFoundException {
070:                return getWorkflowUserForWorkflowId(workflowId);
071:            }
072:
073:            public WorkflowUser getDelegatorUser()
074:                    throws EdenUserNotFoundException {
075:                return getWorkflowUserForWorkflowId(delegatorWorkflowId);
076:            }
077:
078:            public Workgroup getDelegatorWorkgroup() {
079:                return getWorkgroupService().getWorkgroup(
080:                        new WorkflowGroupId(delegatorWorkgroupId));
081:            }
082:
083:            public void setDelegator(Recipient recipient) {
084:                if (recipient instanceof  WorkflowUser) {
085:                    setDelegatorWorkflowId(((WorkflowUser) recipient)
086:                            .getWorkflowUserId().getWorkflowId());
087:                } else if (recipient instanceof  Workgroup) {
088:                    setDelegatorWorkgroupId(((Workgroup) recipient)
089:                            .getWorkflowGroupId().getGroupId());
090:                } else {
091:                    setDelegatorWorkflowId(null);
092:                    setDelegatorWorkgroupId(null);
093:                }
094:            }
095:
096:            public boolean isForDelegator() {
097:                return getDelegatorWorkflowId() != null
098:                        || getDelegatorWorkgroupId() != null;
099:            }
100:
101:            public String getDelegatorDisplayName()
102:                    throws EdenUserNotFoundException {
103:                if (!isForDelegator()) {
104:                    return "";
105:                }
106:                if (getDelegatorWorkflowId() != null) {
107:                    return getDelegatorUser().getDisplayName();
108:                } else {
109:                    return getDelegatorWorkgroup().getGroupNameId().getNameId();
110:                }
111:            }
112:
113:            private WorkflowUser getWorkflowUserForWorkflowId(String id)
114:                    throws EdenUserNotFoundException {
115:                WorkflowUser w = null;
116:
117:                if ((id != null) && (id.trim().length() > 0)) {
118:                    w = getUserService()
119:                            .getWorkflowUser(new WorkflowUserId(id));
120:                }
121:
122:                return w;
123:            }
124:
125:            public String getActionTakenLabel() {
126:                return CodeTranslator.getActionTakenLabel(actionTaken);
127:            }
128:
129:            public Collection getActionRequests() {
130:                if (actionRequests == null) {
131:                    setActionRequests(new ArrayList());
132:                }
133:                return actionRequests;
134:            }
135:
136:            public void setActionRequests(Collection actionRequests) {
137:                this .actionRequests = actionRequests;
138:            }
139:
140:            public DocumentRouteHeaderValue getRouteHeader() {
141:                return routeHeader;
142:            }
143:
144:            public void setRouteHeader(DocumentRouteHeaderValue routeHeader) {
145:                this .routeHeader = routeHeader;
146:            }
147:
148:            public Timestamp getActionDate() {
149:                return actionDate;
150:            }
151:
152:            public void setActionDate(Timestamp actionDate) {
153:                this .actionDate = actionDate;
154:            }
155:
156:            public String getActionTaken() {
157:                return actionTaken;
158:            }
159:
160:            public void setActionTaken(String actionTaken) {
161:                this .actionTaken = actionTaken;
162:            }
163:
164:            public Long getActionTakenId() {
165:                return actionTakenId;
166:            }
167:
168:            public void setActionTakenId(Long actionTakenId) {
169:                this .actionTakenId = actionTakenId;
170:            }
171:
172:            public String getAnnotation() {
173:                return annotation;
174:            }
175:
176:            public void setAnnotation(String annotation) {
177:                this .annotation = annotation;
178:            }
179:
180:            public String getDelegatorWorkflowId() {
181:                return delegatorWorkflowId;
182:            }
183:
184:            public void setDelegatorWorkflowId(String delegatorWorkflowId) {
185:                this .delegatorWorkflowId = delegatorWorkflowId;
186:            }
187:
188:            public Long getDelegatorWorkgroupId() {
189:                return delegatorWorkgroupId;
190:            }
191:
192:            public void setDelegatorWorkgroupId(Long delegatorWorkgroupId) {
193:                this .delegatorWorkgroupId = delegatorWorkgroupId;
194:            }
195:
196:            public Integer getDocVersion() {
197:                return docVersion;
198:            }
199:
200:            public void setDocVersion(Integer docVersion) {
201:                this .docVersion = docVersion;
202:            }
203:
204:            public Integer getLockVerNbr() {
205:                return lockVerNbr;
206:            }
207:
208:            public void setLockVerNbr(Integer lockVerNbr) {
209:                this .lockVerNbr = lockVerNbr;
210:            }
211:
212:            public Long getRouteHeaderId() {
213:                return routeHeaderId;
214:            }
215:
216:            public void setRouteHeaderId(Long routeHeaderId) {
217:                this .routeHeaderId = routeHeaderId;
218:            }
219:
220:            public String getWorkflowId() {
221:                return workflowId;
222:            }
223:
224:            public void setWorkflowId(String workflowId) {
225:                this .workflowId = workflowId;
226:            }
227:
228:            public Boolean getCurrentIndicator() {
229:                return currentIndicator;
230:            }
231:
232:            public void setCurrentIndicator(Boolean currentIndicator) {
233:                this .currentIndicator = currentIndicator;
234:            }
235:
236:            public Collection getRootActionRequests() {
237:                return getActionRequestService().getRootRequests(
238:                        getActionRequests());
239:            }
240:
241:            public Object copy(boolean preserveKeys) {
242:                ActionTakenValue clone = new ActionTakenValue();
243:                try {
244:                    BeanUtils.copyProperties(clone, this );
245:                } catch (Exception e) {
246:                    throw new RuntimeException(e);
247:                }
248:
249:                if (!preserveKeys) {
250:                    clone.setActionTakenId(null);
251:                }
252:                return clone;
253:            }
254:
255:            private UserService getUserService() {
256:                return (UserService) KEWServiceLocator
257:                        .getService(KEWServiceLocator.USER_SERVICE);
258:            }
259:
260:            private WorkgroupService getWorkgroupService() {
261:                return (WorkgroupService) KEWServiceLocator
262:                        .getService(KEWServiceLocator.WORKGROUP_SRV);
263:            }
264:
265:            private ActionRequestService getActionRequestService() {
266:                return (ActionRequestService) KEWServiceLocator
267:                        .getService(KEWServiceLocator.ACTION_REQUEST_SRV);
268:            }
269:
270:            public String getActionDateString() {
271:                if (actionDateString == null
272:                        || actionDateString.trim().equals("")) {
273:                    return EdenConstants.getDefaultDateFormat().format(
274:                            getActionDate());
275:                } else {
276:                    return actionDateString;
277:                }
278:            }
279:
280:            public void setActionDateString(String actionDateString) {
281:                this .actionDateString = actionDateString;
282:            }
283:
284:            public boolean isApproval() {
285:                return EdenConstants.ACTION_TAKEN_APPROVED_CD
286:                        .equals(getActionTaken());
287:            }
288:
289:            public boolean isCompletion() {
290:                return EdenConstants.ACTION_TAKEN_COMPLETED_CD
291:                        .equals(getActionTaken());
292:            }
293:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.