diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-06-22 10:11:17 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-06-22 10:11:17 +0200 |
| commit | 0baa46d5ee4f62adb58f436af4978d9468454870 (patch) | |
| tree | cb88cda1ed564b8bb445fd4180728fd0db25192f /src/main/java/com/c2kernel/collection | |
| parent | e0b01f55e2be314ee60df092aa75f34c5f4cb8f2 (diff) | |
Modules and entitycreation support Aggregations, collection properties
and class identifiers
Diffstat (limited to 'src/main/java/com/c2kernel/collection')
5 files changed, 13 insertions, 7 deletions
diff --git a/src/main/java/com/c2kernel/collection/Aggregation.java b/src/main/java/com/c2kernel/collection/Aggregation.java index e869621..f840d41 100644 --- a/src/main/java/com/c2kernel/collection/Aggregation.java +++ b/src/main/java/com/c2kernel/collection/Aggregation.java @@ -73,8 +73,10 @@ abstract public class Aggregation extends Parent2ChildCollection<AggregationMemb AggregationMember aggMem = new AggregationMember();
aggMem.setProperties(props);
aggMem.setClassProps(classProps);
- aggMem.assignEntity(entityKey);
-
+ if (entityKey > -1) {
+ aggMem.assignEntity(entityKey);
+ aggMem.setIsComposite( RelationshipUtils.getIsComposite(entityKey) );
+ }
// create vertex
com.c2kernel.graph.model.Vertex vertex = new com.c2kernel.graph.model.Vertex();
vertex.setHeight(h); vertex.setWidth(w);
@@ -82,7 +84,7 @@ abstract public class Aggregation extends Parent2ChildCollection<AggregationMemb aggMem.setCollection(this);
aggMem.setID(vertex.getID());
aggMem.setIsLayoutable(true);
- aggMem.setIsComposite( RelationshipUtils.getIsComposite(entityKey) );
+
mMembers.list.add(aggMem);
Logger.msg(8, "AggregationDescription::addMember(" + entityKey + ") added to children linked to vertexid " + vertex.getID());
return aggMem;
diff --git a/src/main/java/com/c2kernel/collection/AggregationDescription.java b/src/main/java/com/c2kernel/collection/AggregationDescription.java index a046871..6021ed6 100644 --- a/src/main/java/com/c2kernel/collection/AggregationDescription.java +++ b/src/main/java/com/c2kernel/collection/AggregationDescription.java @@ -5,6 +5,7 @@ package com.c2kernel.collection; * @author $Author: abranson $
*/
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.graph.model.Vertex;
import com.c2kernel.property.PropertyDescriptionList;
import com.c2kernel.property.PropertyUtility;
@@ -25,7 +26,7 @@ public class AggregationDescription extends Aggregation implements CollectionDes @Override
- public Aggregation newInstance()
+ public Aggregation newInstance() throws ObjectNotFoundException
{
AggregationInstance newInstance = new AggregationInstance(getName());
newInstance.setURLInfo(getURLInfo());
diff --git a/src/main/java/com/c2kernel/collection/CollectionDescription.java b/src/main/java/com/c2kernel/collection/CollectionDescription.java index 69b569e..15c6928 100644 --- a/src/main/java/com/c2kernel/collection/CollectionDescription.java +++ b/src/main/java/com/c2kernel/collection/CollectionDescription.java @@ -1,5 +1,7 @@ package com.c2kernel.collection;
+import com.c2kernel.common.ObjectNotFoundException;
+
/**************************************************************************
*
* $Revision: 1.1 $
@@ -10,5 +12,5 @@ package com.c2kernel.collection; **************************************************************************/
public interface CollectionDescription<E extends CollectionMember> extends Collection<E> {
- public Collection<E> newInstance();
+ public Collection<E> newInstance() throws ObjectNotFoundException;
}
diff --git a/src/main/java/com/c2kernel/collection/DependencyDescription.java b/src/main/java/com/c2kernel/collection/DependencyDescription.java index 547a286..681e98b 100644 --- a/src/main/java/com/c2kernel/collection/DependencyDescription.java +++ b/src/main/java/com/c2kernel/collection/DependencyDescription.java @@ -1,5 +1,6 @@ package com.c2kernel.collection;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.property.PropertyDescriptionList;
import com.c2kernel.property.PropertyUtility;
import com.c2kernel.utils.CastorHashMap;
@@ -17,7 +18,7 @@ public class DependencyDescription extends Dependency implements CollectionDescr }
@Override
- public Collection<DependencyMember> newInstance() {
+ public Collection<DependencyMember> newInstance() throws ObjectNotFoundException{
String depName = getName().replaceFirst("\'$", ""); // HACK: Knock the special 'prime' off the end for the case of descriptions of descriptions
Dependency newDep = new Dependency(depName);
if (mMembers.list.size() == 1) { // constrain the members based on the property description
diff --git a/src/main/java/com/c2kernel/collection/RelationshipUtils.java b/src/main/java/com/c2kernel/collection/RelationshipUtils.java index 6e35ac8..0151b7e 100644 --- a/src/main/java/com/c2kernel/collection/RelationshipUtils.java +++ b/src/main/java/com/c2kernel/collection/RelationshipUtils.java @@ -19,7 +19,7 @@ public class RelationshipUtils if (entityKey == -1) return false;
try
{
- if ( ((Aggregation) Gateway.getProxyManager().getProxy(new EntityPath(entityKey)).getObject(ClusterStorage.COLLECTION+"/Composition" )).size() > 0 )
+ if ( Gateway.getProxyManager().getProxy(new EntityPath(entityKey)).getContents(ClusterStorage.COLLECTION).length > 0 )
return true;
}
catch (Exception ex)
|
