summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-06-05 16:47:41 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-06-05 16:47:41 +0200
commite73468fd08cc27aa31f76a27c916e45d5987c628 (patch)
tree36e5683c7e79f21d4f610c956a3267179da64983 /src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
parent8dbf947eb6e84ec6a3c6e9ba421c682d847a8b00 (diff)
Moved old entitycreation package from the predefined step package to a
new 'imports' package under entity. Renamed most classed with an 'Import' prefix to avoid clashes with other API classes. Fixes #194
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java')
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
deleted file mode 100644
index 40e0604..0000000
--- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.c2kernel.lifecycle.instance.predefined.entitycreation;
-
-import java.util.ArrayList;
-
-import com.c2kernel.collection.MembershipException;
-import com.c2kernel.common.ObjectNotFoundException;
-import com.c2kernel.graph.model.GraphPoint;
-import com.c2kernel.lookup.DomainPath;
-import com.c2kernel.property.PropertyDescription;
-import com.c2kernel.property.PropertyDescriptionList;
-import com.c2kernel.property.PropertyUtility;
-
-public class Aggregation implements java.io.Serializable {
-
- public boolean isDescription;
- public ArrayList<AggregationMember> aggregationMemberList = new ArrayList<AggregationMember>();
- public String name;
-
- public Aggregation() {
- super();
- }
-
- public Aggregation(String name, boolean isDescription) {
- this();
- this.name = name;
- this.isDescription = isDescription;
- }
-
- public com.c2kernel.collection.Aggregation create() throws MembershipException, ObjectNotFoundException {
- com.c2kernel.collection.Aggregation newAgg = isDescription?new com.c2kernel.collection.AggregationDescription(name):new com.c2kernel.collection.AggregationInstance(name);
- newAgg.setName(name);
- for (AggregationMember thisMem : aggregationMemberList) {
- StringBuffer classProps = new StringBuffer();
- if (thisMem.itemDescriptionPath != null && thisMem.itemDescriptionPath.length()>0) {
- PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(thisMem.itemDescriptionPath).getSysKey());
- for (PropertyDescription pd : propList.list) {
- thisMem.props.put(pd.getName(), pd.getDefaultValue());
- if (pd.getIsClassIdentifier())
- classProps.append((classProps.length()>0?",":"")).append(pd.getName());
- }
- }
- if (thisMem.itemPath != null && thisMem.itemPath.length()>0) {
- int syskey = new DomainPath(thisMem.itemPath).getSysKey();
- if (syskey == -1)
- throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection.");
- newAgg.addMember(syskey, thisMem.props, classProps.toString(), new GraphPoint(thisMem.geometry.x, thisMem.geometry.y), thisMem.geometry.width, thisMem.geometry.height);
- }
- }
- return newAgg;
- }
-}