1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.bo.ui; |
17 | |
|
18 | |
import org.hibernate.annotations.GenericGenerator; |
19 | |
import org.hibernate.annotations.Parameter; |
20 | |
import org.kuali.rice.kew.util.CodeTranslator; |
21 | |
import org.kuali.rice.kim.api.responsibility.Responsibility; |
22 | |
import org.kuali.rice.kim.api.services.KimApiServiceLocator; |
23 | |
import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo; |
24 | |
import org.kuali.rice.kim.impl.role.RoleResponsibilityBo; |
25 | |
import org.kuali.rice.krad.service.KRADServiceLocator; |
26 | |
import org.kuali.rice.krad.util.ObjectUtils; |
27 | |
|
28 | |
import javax.persistence.Column; |
29 | |
import javax.persistence.Entity; |
30 | |
import javax.persistence.GeneratedValue; |
31 | |
import javax.persistence.Id; |
32 | |
import javax.persistence.IdClass; |
33 | |
import javax.persistence.Table; |
34 | |
import javax.persistence.Transient; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
@IdClass(KimDocumentRoleResponsibilityActionId.class) |
43 | |
@Entity |
44 | |
@Table(name="KRIM_PND_ROLE_RSP_ACTN_MT") |
45 | 0 | public class KimDocumentRoleResponsibilityAction extends KimDocumentBoEditableBase { |
46 | |
private static final long serialVersionUID = 696663543888096105L; |
47 | |
@Id |
48 | |
@GeneratedValue(generator="KRIM_ROLE_RSP_ACTN_ID_S") |
49 | |
@GenericGenerator(name="KRIM_ROLE_RSP_ACTN_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters={ |
50 | |
@Parameter(name="sequence_name",value="KRIM_ROLE_RSP_ACTN_ID_S"), |
51 | |
@Parameter(name="value_column",value="id") |
52 | |
}) |
53 | |
@Column(name="ROLE_RSP_ACTN_ID") |
54 | |
protected String roleResponsibilityActionId; |
55 | |
@Column(name="ROLE_RSP_ID") |
56 | |
protected String roleResponsibilityId; |
57 | |
@Column(name="ROLE_MBR_ID") |
58 | |
protected String roleMemberId; |
59 | |
@Column(name="ACTN_TYP_CD") |
60 | |
protected String actionTypeCode; |
61 | |
@Column(name="ACTN_PLCY_CD") |
62 | |
protected String actionPolicyCode; |
63 | |
@Column(name="PRIORITY_NBR") |
64 | |
protected Integer priorityNumber; |
65 | |
@Column(name="FRC_ACTN") |
66 | |
protected boolean forceAction; |
67 | |
@Transient |
68 | |
protected ResponsibilityBo kimResponsibility; |
69 | |
@Transient |
70 | |
protected RoleResponsibilityBo roleResponsibility; |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
public ResponsibilityBo getKimResponsibility() { |
84 | 0 | if ( ObjectUtils.isNull( kimResponsibility ) && ObjectUtils.isNotNull( getRoleResponsibility() ) ) { |
85 | |
|
86 | |
|
87 | |
|
88 | 0 | Responsibility info = KimApiServiceLocator.getResponsibilityService().getResponsibility(getRoleResponsibility().getResponsibilityId()); |
89 | 0 | kimResponsibility = ResponsibilityBo.from(info); |
90 | |
} |
91 | 0 | return kimResponsibility; |
92 | |
} |
93 | |
|
94 | |
|
95 | |
|
96 | |
public void setKimResponsibility(ResponsibilityBo kimResponsibility) { |
97 | 0 | this.kimResponsibility = kimResponsibility; |
98 | 0 | } |
99 | |
public String getRoleResponsibilityActionId() { |
100 | 0 | return this.roleResponsibilityActionId; |
101 | |
} |
102 | |
public void setRoleResponsibilityActionId(String roleResponsibilityResolutionId) { |
103 | 0 | this.roleResponsibilityActionId = roleResponsibilityResolutionId; |
104 | 0 | } |
105 | |
public String getRoleResponsibilityId() { |
106 | 0 | return this.roleResponsibilityId; |
107 | |
} |
108 | |
public void setRoleResponsibilityId(String roleResponsibilityId) { |
109 | 0 | this.roleResponsibilityId = roleResponsibilityId; |
110 | 0 | } |
111 | |
public String getActionTypeCode() { |
112 | 0 | return this.actionTypeCode; |
113 | |
} |
114 | |
public void setActionTypeCode(String actionTypeCode) { |
115 | 0 | this.actionTypeCode = actionTypeCode; |
116 | 0 | } |
117 | |
public Integer getPriorityNumber() { |
118 | 0 | return this.priorityNumber; |
119 | |
} |
120 | |
public void setPriorityNumber(Integer priorityNumber) { |
121 | 0 | this.priorityNumber = priorityNumber; |
122 | 0 | } |
123 | |
|
124 | |
public String getActionPolicyCode() { |
125 | 0 | return this.actionPolicyCode; |
126 | |
} |
127 | |
public void setActionPolicyCode(String actionPolicyCode) { |
128 | 0 | this.actionPolicyCode = actionPolicyCode; |
129 | 0 | } |
130 | |
public String getRoleMemberId() { |
131 | 0 | return this.roleMemberId; |
132 | |
} |
133 | |
public void setRoleMemberId(String roleMemberId) { |
134 | 0 | this.roleMemberId = roleMemberId; |
135 | 0 | } |
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
public String getActionPolicyDescription() { |
144 | 0 | return (String)CodeTranslator.approvePolicyLabels.get(this.actionPolicyCode); |
145 | |
} |
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
public String getActionTypeDescription() { |
154 | 0 | return (String)CodeTranslator.arLabels.get(this.actionTypeCode); |
155 | |
} |
156 | |
|
157 | |
|
158 | |
|
159 | |
public RoleResponsibilityBo getRoleResponsibility() { |
160 | 0 | if ( ObjectUtils.isNull( roleResponsibility ) && roleResponsibilityId != null ) { |
161 | |
|
162 | |
|
163 | |
|
164 | 0 | roleResponsibility = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(RoleResponsibilityBo.class, getRoleResponsibilityId()); |
165 | |
} |
166 | 0 | return roleResponsibility; |
167 | |
} |
168 | |
|
169 | |
|
170 | |
|
171 | |
public void setRoleResponsibility(RoleResponsibilityBo roleResponsibility) { |
172 | 0 | this.roleResponsibility = roleResponsibility; |
173 | 0 | } |
174 | |
|
175 | |
|
176 | |
|
177 | |
|
178 | |
public boolean isForceAction() { |
179 | 0 | return this.forceAction; |
180 | |
} |
181 | |
|
182 | |
|
183 | |
|
184 | |
public void setForceAction(boolean forceAction) { |
185 | 0 | this.forceAction = forceAction; |
186 | 0 | } |
187 | |
|
188 | |
} |