1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.rule;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.rice.kew.api.identity.Id;
22 import org.kuali.rice.kew.api.identity.PrincipalId;
23 import org.kuali.rice.kew.api.rule.RoleName;
24
25
26
27
28
29
30
31
32 public class PrincipalIdRoleAttribute extends AbstractIdRoleAttribute {
33
34 private static final long serialVersionUID = 8784036641718163820L;
35
36 private static final String PRINCIPAL_ID_ROLE_NAME = "principalId";
37 private static final String ATTRIBUTE_ELEMENT = "PrincipalIdRoleAttribute";
38 private static final String PRINCIPAL_ID_ELEMENT = "principalId";
39
40 public List<RoleName> getRoleNames() {
41 List<RoleName> roleNames = new ArrayList<RoleName>();
42 roleNames.add(new RoleName(getClass().getName(), PRINCIPAL_ID_ROLE_NAME, "Principal ID"));
43 return roleNames;
44 }
45
46 protected String getAttributeElementName() {
47 return ATTRIBUTE_ELEMENT;
48 }
49
50 protected Id resolveId(String id) {
51 return id == null ? null : new PrincipalId(id);
52 }
53
54 protected String getIdName() {
55 return PRINCIPAL_ID_ELEMENT;
56 }
57
58 public String getPrincipalId() {
59 return getIdValue();
60 }
61
62 public void setPrincipalId(String principalId) {
63 setIdValue(principalId);
64 }
65
66 }