diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-07-02 14:16:20 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-07-02 14:16:20 +0200 |
| commit | cc79e98c4763affba4fa2e17dfe5a412f9de66c3 (patch) | |
| tree | cc9bbf21bed983bec0a9320dc9a3504e3821dbdd | |
| parent | 11eb9557a35e17450c0aefb758471f1ff3148336 (diff) | |
Removed persistency of VertexOutlineCreator - containing subclasses
should set this.
Fixed persistency of GTimeStamp
Fixed CompActOutcome not showing when loaded
17 files changed, 46 insertions, 51 deletions
@@ -37,6 +37,11 @@ <groupId>com.novell.ldap</groupId>
<artifactId>jldap</artifactId>
</dependency>
+ <dependency>
+ <groupId>cristal</groupId>
+ <artifactId>cristal-dev</artifactId>
+ <version>0.3</version>
+ </dependency>
</dependencies>
<dependencyManagement>
<dependencies>
diff --git a/src/main/java/com/c2kernel/collection/Aggregation.java b/src/main/java/com/c2kernel/collection/Aggregation.java index f840d41..9c7b4ce 100644 --- a/src/main/java/com/c2kernel/collection/Aggregation.java +++ b/src/main/java/com/c2kernel/collection/Aggregation.java @@ -37,6 +37,7 @@ abstract public class Aggregation extends Parent2ChildCollection<AggregationMemb public void setLayout(GraphModel layout)
{
mLayout = layout;
+ layout.setVertexOutlineCreator(new AggregationVertexOutlineCreator());
}
public TypeNameAndConstructionInfo[] getVertexTypeNameAndConstructionInfo()
diff --git a/src/main/java/com/c2kernel/graph/model/GraphModel.java b/src/main/java/com/c2kernel/graph/model/GraphModel.java index c428e79..63fe0e3 100644 --- a/src/main/java/com/c2kernel/graph/model/GraphModel.java +++ b/src/main/java/com/c2kernel/graph/model/GraphModel.java @@ -528,22 +528,8 @@ public class GraphModel implements Serializable { }
public void setGraphModelCastorData(GraphModelCastorData data) {
- Class<?> vertexOutlineCreatorClass = null;
int i = 0;
- // Create the vertex outline creator
- if (data.mClassNameOfVertexOutlineCreator.equals("")) {
- mVertexOutlineCreator = null;
- }
- else {
- try {
- vertexOutlineCreatorClass = Class.forName(data.mClassNameOfVertexOutlineCreator);
- mVertexOutlineCreator = (VertexOutlineCreator)vertexOutlineCreatorClass.newInstance();
- }
- catch (Exception e) {
- e.printStackTrace();
- mVertexOutlineCreator = null;
- }
- }
+
// Create and populate the vertex hashtable
mVertexHashtable = new Hashtable<String, Vertex>();
for (i = 0; i < data.mVertexImpls.length; i++) {
@@ -575,13 +561,14 @@ public class GraphModel implements Serializable { for (i = 0; i < directedEdgeImpls.length; i++) {
directedEdgeImpls[i] = (DirectedEdge)edgeObjs[i];
}
+ // Disable persistency of the vertex outline creator: determined by container
// Determine the class name of the vertex outline creator
- if (mVertexOutlineCreator == null) {
- className = "";
- }
- else {
- className = mVertexOutlineCreator.getClass().getName();
- }
+// if (mVertexOutlineCreator == null) {
+// className = "";
+// }
+// else {
+// className = mVertexOutlineCreator.getClass().getName();
+// }
return new GraphModelCastorData(className, vertexImpls, directedEdgeImpls, mStartVertexId, mNextId);
}
}
diff --git a/src/main/java/com/c2kernel/graph/model/GraphModelCastorData.java b/src/main/java/com/c2kernel/graph/model/GraphModelCastorData.java index 7717c33..955c408 100644 --- a/src/main/java/com/c2kernel/graph/model/GraphModelCastorData.java +++ b/src/main/java/com/c2kernel/graph/model/GraphModelCastorData.java @@ -3,6 +3,7 @@ package com.c2kernel.graph.model; public class GraphModelCastorData
{
+ // Deprecated: Vertex outline creator is now set by the container
public String mClassNameOfVertexOutlineCreator = "";
public Vertex[] mVertexImpls = {};
public DirectedEdge[] mEdgeImpls = {};
diff --git a/src/main/java/com/c2kernel/graph/model/GraphableVertex.java b/src/main/java/com/c2kernel/graph/model/GraphableVertex.java index cb4724d..7c9adef 100644 --- a/src/main/java/com/c2kernel/graph/model/GraphableVertex.java +++ b/src/main/java/com/c2kernel/graph/model/GraphableVertex.java @@ -113,11 +113,6 @@ public abstract class GraphableVertex extends Vertex }
return null;
}
- // deprecated methods
- public GraphableVertex[] getCNonLayoutableChildren() {
- return new GraphableVertex[0];
- }
- public void setCNonLayoutableChildren(GraphableVertex[] dummy) { }
/**@returns the Graphable searched or null if not this or children*/
public GraphableVertex search(String ids)
diff --git a/src/main/java/com/c2kernel/lifecycle/CompositeActivityDef.java b/src/main/java/com/c2kernel/lifecycle/CompositeActivityDef.java index 54487f4..c430f20 100644 --- a/src/main/java/com/c2kernel/lifecycle/CompositeActivityDef.java +++ b/src/main/java/com/c2kernel/lifecycle/CompositeActivityDef.java @@ -18,12 +18,12 @@ public class CompositeActivityDef extends ActivityDef {
private final TypeNameAndConstructionInfo[] mVertexTypeNameAndConstructionInfo =
{
- new TypeNameAndConstructionInfo(Language.translate("Atomic"), "Atomic"),
+ new TypeNameAndConstructionInfo(Language.translate("Activity"), "Atomic"),
new TypeNameAndConstructionInfo(Language.translate("Composite"), "Composite"),
new TypeNameAndConstructionInfo(Language.translate("AND Split"), "And"),
new TypeNameAndConstructionInfo(Language.translate("OR Split"), "Or"),
new TypeNameAndConstructionInfo(Language.translate("XOR Split"), "XOr"),
- new TypeNameAndConstructionInfo(Language.translate("Junction"), "Join"),
+ new TypeNameAndConstructionInfo(Language.translate("Join"), "Join"),
new TypeNameAndConstructionInfo(Language.translate("Loop"), "Loop"),
};
private final TypeNameAndConstructionInfo[] mEdgeTypeNameAndConstructionInfo =
@@ -214,7 +214,11 @@ public class CompositeActivityDef extends ActivityDef return getName();
return super.getPath();
}
-
+ @Override
+ public void setChildrenGraphModel(GraphModel childrenGraph) {
+ super.setChildrenGraphModel(childrenGraph);
+ childrenGraph.setVertexOutlineCreator(new WfVertexDefOutlineCreator());
+ }
//deprecated
public String[] getCastorNonLayoutableChildren() {
return new String[0];
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java b/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java index 0928c83..45d04c0 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java @@ -39,6 +39,11 @@ public class CompositeActivity extends Activity setIsComposite(true);
}
+ @Override
+ public void setChildrenGraphModel(GraphModel childrenGraph) {
+ super.setChildrenGraphModel(childrenGraph);
+ childrenGraph.setVertexOutlineCreator(new WfVertexOutlineCreator());
+ }
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#verify()
*/
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java index c51d6fe..321e53e 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java @@ -31,12 +31,12 @@ public class Workflow extends CompositeActivity implements C2KLocalObject new TypeNameAndConstructionInfo(Language.translate("XOR Split"), "XOrSplit"),
new TypeNameAndConstructionInfo(Language.translate("Join"), "Join"),
new TypeNameAndConstructionInfo(Language.translate("Loop"), "LoopSplit"),
- new TypeNameAndConstructionInfo(Language.translate("Atomic"), "Atomic"),
+ new TypeNameAndConstructionInfo(Language.translate("Activity"), "Atomic"),
new TypeNameAndConstructionInfo(Language.translate("Composite"), "Composite")
};
private final TypeNameAndConstructionInfo[] mEdgeTypeNameAndConstructionInfo =
{
- new TypeNameAndConstructionInfo(Language.translate("Next Edge"), "Next")
+ new TypeNameAndConstructionInfo(Language.translate("Next"), "Next")
};
/**
* @see java.lang.Object#Object()
diff --git a/src/main/resources/boot/CA/ManageCompositeActDef.xml b/src/main/resources/boot/CA/ManageCompositeActDef.xml index 15a60b5..9eb8bf0 100644 --- a/src/main/resources/boot/CA/ManageCompositeActDef.xml +++ b/src/main/resources/boot/CA/ManageCompositeActDef.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="ManageCompositeActDef" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="13" NextId="26">
+ <GraphModelCastorData StartVertexId="13" NextId="26">
<LoopDef ID="15" Name="" Height="24" Width="60" IsLayoutable="true" IsComposite="false" isNext="0">
<CentrePoint x="358" y="360"/>
<OutlinePoint x="328" y="348"/>
@@ -214,6 +214,4 @@ <KeyValuePair Key="ScriptVersion" String=""/>
<KeyValuePair Key="Skippable" Boolean="false"/>
</Properties>
- <castorNonLayoutableChildren>AssignNewVersionFromLast</castorNonLayoutableChildren>
- <castorNonLayoutableChildren>EditActivityDef</castorNonLayoutableChildren>
</CompositeActivityDef>
diff --git a/src/main/resources/boot/CA/ManageElementaryActDef.xml b/src/main/resources/boot/CA/ManageElementaryActDef.xml index 90ffaf8..03f747a 100644 --- a/src/main/resources/boot/CA/ManageElementaryActDef.xml +++ b/src/main/resources/boot/CA/ManageElementaryActDef.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="ManageElementaryActDef" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="13" NextId="26">
+ <GraphModelCastorData StartVertexId="13" NextId="26">
<LoopDef ID="15" Name="" Height="24" Width="60" IsLayoutable="true" IsComposite="false" isNext="0">
<CentrePoint x="358" y="360"/>
<OutlinePoint x="328" y="348"/>
@@ -214,6 +214,4 @@ <KeyValuePair Key="ScriptVersion" String=""/>
<KeyValuePair Key="Skippable" Boolean="false"/>
</Properties>
- <castorNonLayoutableChildren>AssignNewVersionFromLast</castorNonLayoutableChildren>
- <castorNonLayoutableChildren>EditActivityDef</castorNonLayoutableChildren>
</CompositeActivityDef>
diff --git a/src/main/resources/boot/CA/ManageSchema.xml b/src/main/resources/boot/CA/ManageSchema.xml index d25ce70..69580fe 100644 --- a/src/main/resources/boot/CA/ManageSchema.xml +++ b/src/main/resources/boot/CA/ManageSchema.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="ManageSchema" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="13" NextId="22">
+ <GraphModelCastorData StartVertexId="13" NextId="22">
<LoopDef ID="15" Name="" Height="24" Width="60" IsLayoutable="true" IsComposite="false" isNext="0">
<CentrePoint x="358" y="360"/>
<OutlinePoint x="328" y="348"/>
@@ -213,6 +213,4 @@ <KeyValuePair Key="ScriptVersion" String=""/>
<KeyValuePair Key="Skippable" Boolean="false"/>
</Properties>
- <castorNonLayoutableChildren>AssignNewVersionFromLast</castorNonLayoutableChildren>
- <castorNonLayoutableChildren>EditSchema</castorNonLayoutableChildren>
</CompositeActivityDef>
diff --git a/src/main/resources/boot/CA/ManageScript.xml b/src/main/resources/boot/CA/ManageScript.xml index c629c8e..9dff06f 100644 --- a/src/main/resources/boot/CA/ManageScript.xml +++ b/src/main/resources/boot/CA/ManageScript.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="ManageScript" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="11" NextId="27">
+ <GraphModelCastorData StartVertexId="11" NextId="27">
<LoopDef ID="15" Name="" Height="24" Width="60" IsLayoutable="true" IsComposite="false" isNext="0">
<CentrePoint x="425" y="291"/>
<OutlinePoint x="395" y="279"/>
@@ -214,6 +214,4 @@ <KeyValuePair Key="Skippable" Boolean="false"/>
<KeyValuePair Key="ScriptVersion" String=""/>
</Properties>
- <castorNonLayoutableChildren>EditScriptDefinition</castorNonLayoutableChildren>
- <castorNonLayoutableChildren>AssignNewVersionFromLast</castorNonLayoutableChildren>
</CompositeActivityDef>
diff --git a/src/main/resources/boot/CA/NoWorkflow.xml b/src/main/resources/boot/CA/NoWorkflow.xml index e49b1cc..e0746f4 100644 --- a/src/main/resources/boot/CA/NoWorkflow.xml +++ b/src/main/resources/boot/CA/NoWorkflow.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="NoWorkflow" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="-1" NextId="0"/>
+ <GraphModelCastorData StartVertexId="-1" NextId="0"/>
</childrenGraphModel>
<Properties>
<KeyValuePair Key="Autostart" Boolean="true"/>
diff --git a/src/main/resources/boot/CA/ServerItemWorkflow.xml b/src/main/resources/boot/CA/ServerItemWorkflow.xml index 7d8531d..085f8ab 100644 --- a/src/main/resources/boot/CA/ServerItemWorkflow.xml +++ b/src/main/resources/boot/CA/ServerItemWorkflow.xml @@ -1,6 +1,6 @@ <CompositeActivityDef ID="-1" Name="ServerItemWorkflow" Height="0" Width="0" IsLayoutable="false" IsComposite="true">
<childrenGraphModel>
- <GraphModelCastorData ClassNameOfVertexOutlineCreator="com.c2kernel.lifecycle.WfVertexDefOutlineCreator" StartVertexId="4" NextId="21">
+ <GraphModelCastorData StartVertexId="4" NextId="21">
<JoinDef ID="9" Name="" Height="24" Width="60" IsLayoutable="true" IsComposite="false">
<CentrePoint x="244" y="378"/>
<OutlinePoint x="214" y="366"/>
@@ -212,6 +212,4 @@ <KeyValuePair Key="ScriptVersion" String=""/>
<KeyValuePair Key="Skippable" Boolean="false"/>
</Properties>
- <castorNonLayoutableChildren>CreateNewAgent</castorNonLayoutableChildren>
- <castorNonLayoutableChildren>CreateNewItem</castorNonLayoutableChildren>
</CompositeActivityDef>
diff --git a/src/main/resources/boot/OD/CompositeActivityDef.xsd b/src/main/resources/boot/OD/CompositeActivityDef.xsd index b6dc373..acdcae4 100644 --- a/src/main/resources/boot/OD/CompositeActivityDef.xsd +++ b/src/main/resources/boot/OD/CompositeActivityDef.xsd @@ -142,7 +142,7 @@ </xs:complexType>
</xs:element>
</xs:choice>
- <xs:attribute name="ClassNameOfVertexOutlineCreator" type="xs:string" use="required"/>
+ <xs:attribute name="ClassNameOfVertexOutlineCreator" type="xs:string" use="optional"/>
<xs:attribute name="StartVertexId" type="xs:byte" use="required"/>
<xs:attribute name="NextId" type="xs:byte" use="required"/>
</xs:complexType>
diff --git a/src/main/resources/mapFiles/KeyValuePairMap.xml b/src/main/resources/mapFiles/KeyValuePairMap.xml index dc67609..f709663 100644 --- a/src/main/resources/mapFiles/KeyValuePairMap.xml +++ b/src/main/resources/mapFiles/KeyValuePairMap.xml @@ -31,5 +31,15 @@ <bind-xml name="Boolean" node="attribute"/>
</field>
</class>
+ <class name="com.c2kernel.common.GTimeStamp">
+ <map-to xml="TimeStamp"/>
+ <field name="mYear" type="java.lang.Integer" direct="true"><bind-xml name="Y" node="attribute"/></field>
+ <field name="mMonth" type="java.lang.Integer" direct="true"><bind-xml name="Mo" node="attribute"/></field>
+ <field name="mDay" type="java.lang.Integer" direct="true"><bind-xml name="D" node="attribute"/></field>
+ <field name="mHour" type="java.lang.Integer" direct="true"><bind-xml name="H" node="attribute"/></field>
+ <field name="mMinute" type="java.lang.Integer" direct="true"><bind-xml name="Mi" node="attribute"/></field>
+ <field name="mSecond" type="java.lang.Integer" direct="true"><bind-xml name="S" node="attribute"/></field>
+ <field name="mTimeOffset" type="java.lang.Integer" direct="true"><bind-xml name="O" node="attribute"/></field>
+ </class>
</mapping>
diff --git a/src/main/resources/mapFiles/graphModelMap.xml b/src/main/resources/mapFiles/graphModelMap.xml index cebb589..58bf098 100644 --- a/src/main/resources/mapFiles/graphModelMap.xml +++ b/src/main/resources/mapFiles/graphModelMap.xml @@ -110,9 +110,6 @@ <field name="childrenGraphModel" type="com.c2kernel.graph.model.GraphModel" direct="false">
<bind-xml name="childrenGraphModel" node="element"/>
</field>
- <field name="cNonLayoutableChildren" type="com.c2kernel.graph.model.GraphableVertex" direct="false" collection="array">
- <bind-xml auto-naming="deriveByClass" node="element"/>
- </field>
<field name="mProperties"
type="com.c2kernel.utils.KeyValuePair"
collection="array"
|
