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.apache.commons.lang.StringUtils;
22 import org.kuali.rice.kew.api.identity.Id;
23 import org.kuali.rice.kew.api.rule.RoleName;
24 import org.kuali.rice.kew.util.Utilities;
25 import org.kuali.rice.kew.workgroup.GroupNameId;
26
27
28
29
30
31
32
33
34 public class WorkgroupRoleAttribute extends AbstractIdRoleAttribute {
35
36 private static final long serialVersionUID = 5562142284908152678L;
37
38 private static final String WORKGROUP_ROLE_NAME = "workgroupName";
39 private static final String ATTRIBUTE_ELEMENT = "WorkgroupRoleAttribute";
40 private static final String WORKGROUP_ELEMENT = "workgroupName";
41
42 public List<RoleName> getRoleNames() {
43 List<RoleName> roleNames = new ArrayList<RoleName>();
44 roleNames.add(new RoleName(getClass().getName(), WORKGROUP_ROLE_NAME, "Workgroup Name"));
45 return roleNames;
46 }
47
48 protected String getAttributeElementName() {
49 return ATTRIBUTE_ELEMENT;
50 }
51
52 protected Id resolveId(String id) {
53 if (StringUtils.isBlank(id)) {
54 return null;
55 }
56 String groupName = Utilities.parseGroupName(id);
57 String namespace = Utilities.parseGroupNamespaceCode(id);
58 return new GroupNameId(namespace, groupName);
59 }
60
61 protected String getIdName() {
62 return WORKGROUP_ELEMENT;
63 }
64
65 public String getWorkgroupName() {
66 return getIdValue();
67 }
68
69 public void setWorkgroupName(String workgroupName) {
70 setIdValue(workgroupName);
71 }
72
73 }