1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.xml; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.rice.core.util.KeyValue; |
22 | |
import org.kuali.rice.core.xml.CoreNamespaceConstants; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | public class GroupNamespaceURIFilter extends AbstractTransformationFilter { |
32 | |
|
33 | |
public static final String GROUP_URI_OLD = "ns:workflow/Group"; |
34 | |
public static final String GROUP_URI_NEW = "http://rice.kuali.org/xsd/kim/group"; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
public List<KeyValue> getElementTransformationList() { |
43 | 0 | List<KeyValue> rList = new ArrayList<KeyValue>(); |
44 | |
|
45 | 0 | rList.add(new KeyValue("groups", GROUP_URI_OLD)); |
46 | 0 | rList.add(new KeyValue("groups.group", GROUP_URI_OLD)); |
47 | 0 | rList.add(new KeyValue("groups.group.groupName", GROUP_URI_OLD)); |
48 | 0 | rList.add(new KeyValue("groups.group.namespaceCode", GROUP_URI_OLD)); |
49 | 0 | rList.add(new KeyValue("groups.group.groupDescription", GROUP_URI_OLD)); |
50 | 0 | rList.add(new KeyValue("groups.group.active", GROUP_URI_OLD)); |
51 | 0 | rList.add(new KeyValue("groups.group.type", GROUP_URI_OLD)); |
52 | 0 | rList.add(new KeyValue("groups.group.type.namespace", GROUP_URI_OLD)); |
53 | 0 | rList.add(new KeyValue("groups.group.type.name", GROUP_URI_OLD)); |
54 | 0 | rList.add(new KeyValue("groups.group.attributes", GROUP_URI_OLD)); |
55 | 0 | rList.add(new KeyValue("groups.group.members", GROUP_URI_OLD)); |
56 | 0 | rList.add(new KeyValue("groups.group.members.principalName",GROUP_URI_OLD)); |
57 | 0 | rList.add(new KeyValue("groups.group.members.principalId", GROUP_URI_OLD)); |
58 | 0 | rList.add(new KeyValue("groups.group.members.groupName", GROUP_URI_OLD)); |
59 | 0 | rList.add(new KeyValue("groups.group.members.groupName.name",GROUP_URI_OLD)); |
60 | 0 | rList.add(new KeyValue("groups.group.members.groupName.namespace", GROUP_URI_OLD)); |
61 | |
|
62 | 0 | return rList; |
63 | |
} |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
public String getStartingElementPath() { |
71 | 0 | return "data"; |
72 | |
} |
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
public CurrentElement transformEndElement(CurrentElement currentElement) { |
80 | 0 | if("groups.group.attributes".equals(this.getTrimmedCurrentElementKey(currentElement.getNameKey()))){ |
81 | 0 | currentElement.setUri(CoreNamespaceConstants.CORE); |
82 | |
}else{ |
83 | 0 | currentElement.setUri(GROUP_URI_NEW); |
84 | |
} |
85 | 0 | return currentElement; |
86 | |
} |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
public CurrentElement transformStartElement(CurrentElement currentElement) { |
94 | 0 | currentElement.setUri(GROUP_URI_NEW); |
95 | 0 | return currentElement; |
96 | |
} |
97 | |
} |