venkatapathy / oryx-editor

Automatically exported from code.google.com/p/oryx-editor
Other
0 stars 0 forks source link

Exporting does not trigger customized serialize event #470

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. For example, create a new WorkflowNet Model
2. Add an Activity Node
3. Export it (in JSON for example)

What is the expected output?
I am not entirely sure, but I Think that in JSON file, there should be an 
attribute "numOfOutgoings" somewhere... (see 
editor/client/scripts/Plugins/workflownets.js and 
editor/data/stencilsets/workflownets/workflownets.json)

To ensure that the event is not triggered, I have added an idiot 
alert('foobar'); in handleSerialize function. I don't see this alert box when I 
export in JSON.

What do you see instead?
There is no attribute of this name iny where in this file...

Please provide any additional information below.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by florent....@gmail.com on 7 Jun 2011 at 3:36

GoogleCodeExporter commented 9 years ago
OK, I modified some JS files to fix it.

I created a function named 
ORYX.Core.AbstractShape.triggerSerializeEvent(curRes, dataType) whose code has 
been extracted from ORYX.Core.Node.serialize(). This function triggers the 
custom function for the serialisation of the shape if it exists. 

The first argument curRes is the data we've already got from serialization.
The second argument dataType is a string that gives the data Type ("XML" or 
"JSON").

It is a patch I propose. Since I am not familiar with the code, it may be to be 
improved.

You need to update editor/client/scripts/Core/abstractshape.js and 
editor/client/scripts/Core/node.js.

Attached : 
- The new file abstractshape.js
- The new file node.js
To look for modification, search for 
"http://code.google.com/p/oryx-editor/issues/detail?id=470#c1" in these files

Cheers

Original comment by florent....@gmail.com on 8 Jun 2011 at 1:45

Attachments: