diff options
Diffstat (limited to 'src/main/java/com/c2kernel/entity/imports/ImportDependency.java')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/imports/ImportDependency.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java index e6ce909..a43f6e3 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java @@ -1,10 +1,12 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
+import java.util.UUID;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescription;
import com.c2kernel.property.PropertyDescriptionList;
import com.c2kernel.property.PropertyUtility;
@@ -42,7 +44,7 @@ public class ImportDependency implements java.io.Serializable { public com.c2kernel.collection.Dependency create() throws MembershipException, ObjectNotFoundException {
com.c2kernel.collection.Dependency newDep = isDescription?new com.c2kernel.collection.DependencyDescription(name):new com.c2kernel.collection.Dependency(name);
if (itemDescriptionPath != null && itemDescriptionPath.length()>0) {
- PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getSysKey());
+ PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getItemPath());
StringBuffer classProps = new StringBuffer();
for (PropertyDescription pd : propList.list) {
props.put(pd.getName(), pd.getDefaultValue());
@@ -54,10 +56,16 @@ public class ImportDependency implements java.io.Serializable { }
for (ImportDependencyMember thisMem : dependencyMemberList) {
- int syskey = new DomainPath(thisMem.itemPath).getSysKey();
- if (syskey == -1)
+ ItemPath itemPath;
+ try {
+ itemPath = new ItemPath(UUID.fromString(thisMem.itemPath));
+ } catch (IllegalArgumentException ex) {
+ itemPath = new DomainPath(thisMem.itemPath).getItemPath();
+ }
+
+ if (itemPath == null)
throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection.");
- com.c2kernel.collection.DependencyMember newDepMem = newDep.addMember(syskey);
+ com.c2kernel.collection.DependencyMember newDepMem = newDep.addMember(itemPath);
newDepMem.getProperties().putAll(thisMem.props);
}
return newDep;
|
