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