1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.actionitem; |
18 | |
|
19 | |
import javax.persistence.MappedSuperclass; |
20 | |
import javax.persistence.Transient; |
21 | |
|
22 | |
import org.kuali.rice.kew.actionlist.DisplayParameters; |
23 | |
import org.kuali.rice.kew.exception.WorkflowException; |
24 | |
import org.kuali.rice.kew.preferences.Preferences; |
25 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
26 | |
import org.kuali.rice.kew.util.KEWConstants; |
27 | |
import org.kuali.rice.kim.bo.Group; |
28 | |
import org.kuali.rice.kim.bo.Person; |
29 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
@MappedSuperclass |
39 | 0 | public class ActionItemActionListExtension extends ActionItem { |
40 | |
|
41 | |
private static final long serialVersionUID = -8801104028828059623L; |
42 | |
|
43 | 0 | @Transient |
44 | |
private Person delegatorPerson = null; |
45 | 0 | @Transient |
46 | |
private String delegatorName = ""; |
47 | |
@Transient |
48 | |
private DisplayParameters displayParameters; |
49 | 0 | @Transient |
50 | |
private boolean isInitialized = false; |
51 | 0 | @Transient |
52 | |
private Group delegatorGroup = null; |
53 | 0 | @Transient |
54 | |
private Group group = null; |
55 | |
|
56 | |
@Transient |
57 | |
public Person getDelegatorPerson() { |
58 | 0 | return delegatorPerson; |
59 | |
} |
60 | |
|
61 | |
@Transient |
62 | |
public String getDelegatorName() { |
63 | 0 | return delegatorName; |
64 | |
} |
65 | |
|
66 | |
public void initialize(Preferences preferences) throws WorkflowException { |
67 | 0 | if (isInitialized) { |
68 | 0 | return; |
69 | |
} |
70 | 0 | if (getGroupId() != null) { |
71 | 0 | group = super.getGroup(); |
72 | |
} |
73 | 0 | if (getDelegatorWorkflowId() != null) { |
74 | 0 | delegatorPerson = KIMServiceLocator.getPersonService().getPerson(getDelegatorWorkflowId()); |
75 | 0 | if (delegatorPerson != null) { |
76 | 0 | delegatorName = delegatorPerson.getName(); |
77 | |
} |
78 | |
} |
79 | |
|
80 | 0 | if (getDelegatorGroupId() != null) { |
81 | 0 | delegatorGroup = KIMServiceLocator.getIdentityManagementService().getGroup(getDelegatorGroupId()); |
82 | 0 | if (delegatorGroup !=null) |
83 | 0 | delegatorName = delegatorGroup.getGroupName(); |
84 | |
} |
85 | 0 | if (KEWConstants.PREFERENCES_YES_VAL.equals(preferences.getShowDateApproved())) { |
86 | 0 | setLastApprovedDate(KEWServiceLocator.getActionTakenService().getLastApprovedDate(getRouteHeaderId())); |
87 | |
} |
88 | 0 | isInitialized = true; |
89 | 0 | } |
90 | |
|
91 | |
@Transient |
92 | |
public boolean isInitialized() { |
93 | 0 | return isInitialized; |
94 | |
} |
95 | |
|
96 | |
@Transient |
97 | |
public DisplayParameters getDisplayParameters() { |
98 | 0 | return displayParameters; |
99 | |
} |
100 | |
|
101 | |
public void setDisplayParameters(DisplayParameters displayParameters) { |
102 | 0 | this.displayParameters = displayParameters; |
103 | 0 | } |
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | |
@Transient |
109 | |
public Group getGroup() { |
110 | 0 | return this.group; |
111 | |
} |
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
public void setGroup(Group group) { |
117 | 0 | this.group = group; |
118 | 0 | } |
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
@Transient |
124 | |
public Group getDelegatorGroup() { |
125 | 0 | return this.delegatorGroup; |
126 | |
} |
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
public void setDelegatorGroup(Group delegatorGroup) { |
132 | 0 | this.delegatorGroup = delegatorGroup; |
133 | 0 | } |
134 | |
|
135 | |
} |
136 | |
|