Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Texo] Problems unsetting attributes
|
Re: [Texo] Problems unsetting attributes [message #1553181 is a reply to message #1553161] |
Thu, 08 January 2015 14:54 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Bastian,
For the 0.9.0 release I did not change much in Texo itself, it was mostly changes in testcases and build infrastructure
to make the build/tests work on Luna and latest EMF versions.
However, I changed behavior related to bidirectional ereferences.
The values you refer to, are they eattributes or ereferences?
Did you also update the EMF version? And a final question, were you on the latest Texo 0.1.0 version or an earlier one?
gr. Martin
On 08-01-15 15:36, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I've got problems with unsetting (setting to null) attributes with the new 0.9.0 version. The version 0.1.0 works fine.
> The details: The RCP holds an EMF resource with all needed objects. The object has values in it, that are set to null.
> Afterwards the resource is saved, but the object holds the old values. Changing those values is not a problem, only
> setting them to null. No error message is displayed.
> The client uses the latest 0.9.0 version. If the server is running with 0.1.0 everything works fine.
> Are you able to reproduce this?
> Best regards
> Bastian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Texo] Problems unsetting attributes [message #1554366 is a reply to message #1553181] |
Fri, 09 January 2015 06:38 |
Bastian Wagenfeld Messages: 183 Registered: January 2013 |
Senior Member |
|
|
Hi,
now I see I wasn't right, that this only happens in the latest version, but my tests were not quite sufficient. And furthermore this occurs on the client. The EMFJsonConverter somehow removes the values that are marked as -<unset>. For example there is a Point with a max, min and average. The values are set like this:
{ "_eclass" : "request|ActionType",
"_title" : "PointName",
"delete" : [ ],
"insert" : [ ],
"update" : [ { "_eclass" : "inspections|Point",
"_id" : "1512169",
"_title" : "PointName",
"_uri" : "http://localhost:8080/test/jsonws/inspections|Point/1512169#",
"db_Id" : "1512169",
"db_version" : "21",
"max" : "7.0",
"min" : "1.5",
"average" : "6.0"
} ]
}
If one value is unset (e.g. the min) the JSON only looks like:
{ "_eclass" : "request|ActionType",
"_title" : "PointName",
"delete" : [ ],
"insert" : [ ],
"update" : [ { "_eclass" : "inspections|Point",
"_id" : "1512169",
"_title" : "PointName",
"_uri" : "http://localhost:8080/test/jsonws/inspections|Point/1512169#",
"db_Id" : "1512169",
"db_version" : "21",
"max" : "7.0",
"average" : "6.0"
} ]
}
The whole attribute is missing.
I'm going to debug into this further and let you know, why this happens.
Best regards
Bastian
|
|
| |
Re: [Texo] Problems unsetting attributes [message #1554676 is a reply to message #1554397] |
Fri, 09 January 2015 10:36 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Yes makes sense, can you enter a bugzilla? Then I will push the change shortly against that issue.
gr. Martin
On 09-01-15 08:03, Bastian Wagenfeld wrote:
> Hi,
>
> the method Object toJSON(Object source, final Object value, final EDataType eDataType) in class JSONValueConverter is
> called with value == null and eDataType of EDoubleObject. The condition if (eDataType.getEPackage() ==
> EcorePackage.eINSTANCE) evaluates to true, so EcoreFactory.eINSTANCE.convertToString(eDataType, value) is entered, which
> returns null. I expected it to return JSONObject.NULL. But that part won't be reached. My solution would be to overwrite
> this class and shift if (value == null) {
> return JSONObject.NULL;
> } a little higher.
> Best regards Bastian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
| | |
Goto Forum:
Current Time: Wed Sep 25 10:16:10 GMT 2024
Powered by FUDForum. Page generated in 0.03939 seconds
|