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.identity.Id;
22 import org.kuali.rice.kew.identity.PrincipalId;
23
24
25
26
27
28
29
30
31 public class PrincipalIdRoleAttribute extends AbstractIdRoleAttribute {
32
33 private static final long serialVersionUID = 8784036641718163820L;
34
35 private static final String PRINCIPAL_ID_ROLE_NAME = "principalId";
36 private static final String ATTRIBUTE_ELEMENT = "PrincipalIdRoleAttribute";
37 private static final String PRINCIPAL_ID_ELEMENT = "principalId";
38
39 public List<Role> getRoleNames() {
40 List<Role> roleNames = new ArrayList<Role>();
41 roleNames.add(new Role(getClass(), PRINCIPAL_ID_ROLE_NAME, "Principal ID"));
42 return roleNames;
43 }
44
45 protected String getAttributeElementName() {
46 return ATTRIBUTE_ELEMENT;
47 }
48
49 protected Id resolveId(String id) {
50 return id == null ? null : new PrincipalId(id);
51 }
52
53 protected String getIdName() {
54 return PRINCIPAL_ID_ELEMENT;
55 }
56
57 public String getPrincipalId() {
58 return getIdValue();
59 }
60
61 public void setPrincipalId(String principalId) {
62 setIdValue(principalId);
63 }
64
65 }