Closed GoogleCodeExporter closed 9 years ago
Original comment by TimothyCLethbridge
on 13 Feb 2014 at 8:52
The issue is that when one changes the class name in the code section, the
class name in the layout editor does not change. The model generator thinks
that there are two different classes.
Original comment by cmw...@cornell.edu
on 15 Feb 2014 at 2:54
I think the "id" of the dom element of the class model should be assigned as a
number rather than the class name.
Original comment by CharlesH...@gmail.com
on 17 Feb 2014 at 6:58
May have solved this issue.
Performing test.
The only modified file is umpleonline/scripts/compiler_config.php .
There are two problems with this issue.
First problem is listed in Issue 542.
Second problem is in the compiler_config.php, the right actionCode has not been
sent.
The double quotes in the actionCode (json) are required to be escaped e.g. \" .
Lastly the first and last double quotes should not be escaped.
Will submit a patch shortly.
The demo file is attached.
Original comment by cmw...@cornell.edu
on 21 Apr 2014 at 8:03
Attachments:
I am adding a more detailed explanation.
As one creates a class, move it, and rename it, a form data of (removed some
characters for display purpose):
action=addPositioning&actionCode=<p>URL_SPLIT{"umpleClasses":[{"po....ciations":
[] }&...filename=../ump/tmp449776/model.ump
is sent to the php.
In the function handleUmpleTextChange() inside the compile_config.php, a java
command is executed. It sends this format to the server:
java -jar umplesync.jar -addPositioning
"\<p\>URL_SPLIT{"umpleClasses":[{"position": {"x":
50.”………umpleAssociations":[] }" ../ump/tmp777086/model.ump
Firstly, \<p\>URL_SPLIT needs to be removed in the actionCode as the
UmpleSync_Code.ump's json parser will always cause its ParserResult to fail.
This will send back the original umpleCode with the layout code not cleaned
(the old class still remained). The javascript files will parse the umpleCode
and as a result, will generate an extra class diagram.
Secondly, the double quotes in the actionCode need to be escaped. A shell
command is executed from the php and that without escaping the characters, it
thinks as multiple arguments are sent. By escaping the double quotes, the
actionCode is sent as one argument.
Thirdly, the escaped double quotes in the beginning and the end of the
actionCode needs to be replaced by non-escaped double quotes, which is
interpreted as a string in a shell.
So, by performing these, the result looks like:
java -jar umplesync.jar -addPositioning "{\"umpleClasses\":[{\"position\":
{\"x\": 50.”………umpleAssociations\":[] }" ../ump/tmp777086/model.ump
The result of this command returns an umpleCode with a layout part cleaned.
Original comment by cmw...@cornell.edu
on 21 Apr 2014 at 2:38
For the <p>URL_SPLIT, see Issue 542
Original comment by CharlesH...@gmail.com
on 21 Apr 2014 at 4:27
Original comment by TimothyCLethbridge
on 26 Apr 2014 at 6:51
Original issue reported on code.google.com by
cmw...@cornell.edu
on 9 Feb 2014 at 5:37