summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/entity/imports/ImportDependency.java')
-rw-r--r--src/main/java/com/c2kernel/entity/imports/ImportDependency.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
index c235ba4..dc26551 100644
--- a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
+++ b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
@@ -2,6 +2,8 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
+import com.c2kernel.collection.Dependency;
+import com.c2kernel.collection.DependencyDescription;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.DomainPath;
@@ -16,8 +18,10 @@ import com.c2kernel.utils.KeyValuePair;
public class ImportDependency {
public String name;
+ public Integer version;
public boolean isDescription;
public String itemDescriptionPath;
+ public String itemDescriptionVersion = null;
public ArrayList<ImportDependencyMember> dependencyMemberList = new ArrayList<ImportDependencyMember>();
public CastorHashMap props = new CastorHashMap();
@@ -42,9 +46,17 @@ public class ImportDependency {
* @return
*/
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);
+ Dependency newDep = isDescription?new DependencyDescription(name):new Dependency(name);
+ if (version!= null) newDep.setVersion(version);
if (itemDescriptionPath != null && itemDescriptionPath.length()>0) {
- PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getItemPath());
+ ItemPath itemPath;
+ try {
+ itemPath = new ItemPath(itemDescriptionPath);
+ } catch (InvalidItemPathException ex) {
+ itemPath = new DomainPath(itemDescriptionPath).getItemPath();
+ }
+ String descVer = itemDescriptionVersion==null?"last":itemDescriptionVersion;
+ PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(itemPath, descVer);
StringBuffer classProps = new StringBuffer();
for (PropertyDescription pd : propList.list) {
props.put(pd.getName(), pd.getDefaultValue());