summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-24 05:55:48 (EDT)
committerStephan Born2012-08-24 05:55:48 (EDT)
commit41c1fe9a848f4e66b69454eefc8588df0339a680 (patch)
treed1f3ef33d3984f7cb2ba3c5e2985dad6e5c18d56
parent2f9d57851a1a792cda2d1997c4413719ee250b67 (diff)
downloadorg.eclipse.stardust.ui.web-41c1fe9a848f4e66b69454eefc8588df0339a680.zip
org.eclipse.stardust.ui.web-41c1fe9a848f4e66b69454eefc8588df0339a680.tar.gz
org.eclipse.stardust.ui.web-41c1fe9a848f4e66b69454eefc8588df0339a680.tar.bz2
CRNT-25842
1)set OID_PROPERTY for DATA in modelElementMarshaller toDataJSON 2)Made changes in refreshFromModelElement in m_dataSymbol.js to update the modelElement for dataSymbol. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58673 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java1
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js81
2 files changed, 32 insertions, 50 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
index 8651528..08a2fbf 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
@@ -760,6 +760,7 @@ public abstract class ModelElementMarshaller
dataJson.addProperty(ModelerConstants.NAME_PROPERTY, data.getName());
dataJson.addProperty(ModelerConstants.UUID_PROPERTY,
eObjectUUIDMapper().getUUID(data));
+ dataJson.addProperty(ModelerConstants.OID_PROPERTY, data.getElementOid());
ModelType model = ModelUtils.findContainingModel(data);
dataJson.addProperty(ModelerConstants.MODEL_UUID_PROPERTY,
eObjectUUIDMapper().getUUID(model));
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
index 71c6edd..3846059 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
@@ -11,7 +11,7 @@ define(
/**
* Invoked to create a data symbol and (during completion) a
* corresponding primitive data.
- *
+ *
* @param diagram
* @returns
*/
@@ -23,7 +23,7 @@ define(
var index = diagram.model.getNewDataIndex();
// TODO Need to create data before!
-
+
dataSymbol.dataId = "Data_" + index;
dataSymbol.dataName = "Data " + index;
dataSymbol.dataFullId = m_model.getFullId(diagram.model,
@@ -57,7 +57,7 @@ define(
};
/**
- *
+ *
*/
function DataSymbol() {
var symbol = m_symbol.createSymbol();
@@ -76,23 +76,23 @@ define(
DataSymbol.prototype.bind = function(diagram) {
this.type = m_constants.DATA_SYMBOL;
this.diagram = diagram;
-
+
this.diagram.lastSymbol = this;
-
+
this.propertiesPanel = m_dataPropertiesPanel.getInstance();
this.path = null;
this.text = null;
};
/**
- *
+ *
*/
DataSymbol.prototype.toString = function() {
return "Lightdust.DataSymbol";
};
/**
- *
+ *
*/
DataSymbol.prototype.initializeFromJson = function(lane) {
// TODO Should come from server
@@ -108,7 +108,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.createTransferObject = function() {
var transferObject = {};
@@ -121,14 +121,14 @@ define(
transferObject.text = null;
// Data are not transfered with the symbol
-
+
transferObject.modelElement = null;
return transferObject;
};
/**
- *
+ *
*/
DataSymbol.prototype.getPath = function(withId) {
var path = "/models/" + this.diagram.model.id
@@ -138,32 +138,12 @@ define(
if (withId) {
path += "/" + this.dataFullId;
}
-
- return path;
- };
-
- /**
- *
- */
- DataSymbol.prototype.createUpdateCommand = function() {
- return m_command.createUpdateCommand("/models/"
- + this.diagram.model.id + "/processes/"
- + this.diagram.process.id + "/dataSymbols/"
- + this.dataFullId, this.createTransferObject());
- };
- /**
- *
- */
- DataSymbol.prototype.createDeleteCommand = function() {
- return m_command.createDeleteCommand("/models/"
- + this.diagram.model.id + "/processes/"
- + this.diagram.process.id + "/dataSymbols/"
- + this.dataFullId, this.createTransferObject());
+ return path;
};
/**
- *
+ *
*/
DataSymbol.prototype.createPrimitives = function() {
this.path = m_canvasManager
@@ -189,7 +169,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.initializeEventHandling = function() {
};
@@ -201,13 +181,13 @@ define(
this.oid = transferObject.oid;
this.register();
-
+
if (transferObject.data != null) {
// Bind data to model if newly created
this.diagram.model.dataItems[transferObject.data.id] = transferObject.data;
}
-
+
m_messageDisplay.markModified();
};
@@ -220,7 +200,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.getPathSvgString = function() {
return "M "
@@ -256,7 +236,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.adjustPrimitives = function() {
this.path.attr({
@@ -273,23 +253,24 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.refreshFromModelElement = function() {
- var data = m_model.findData(this.dataFullId);
-
- // Data mayno have been created yet
+ if (this.modelElement) {
+ var data = m_model.findData(this.modelElement
+ .getFullId());
+ } else {
+ var data = m_model.findData(this.dataFullId);
+ }
+ // Data may not have been created yet
if (data != null) {
this.text.attr("text", data.name);
- if (null == this.modelElement) {
- this.modelElement = data;
- }
+ this.modelElement = data;
}
-
};
/**
- *
+ *
*/
DataSymbol.prototype.createFlyOutMenu = function() {
this.addFlyOutMenuItems([], [ {
@@ -306,7 +287,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.highlight = function() {
this.path.attr({
@@ -315,7 +296,7 @@ define(
};
/**
- *
+ *
*/
DataSymbol.prototype.dehighlight = function() {
this.path.attr({
@@ -325,7 +306,7 @@ define(
}
/**
- *
+ *
*/
function DataSymbol_connectToClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -333,7 +314,7 @@ define(
}
/**
- *
+ *
*/
function DataSymbol_removeClosure() {
this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();