Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Control over what is a proxy and what's not?
[Texo] Control over what is a proxy and what's not? [message #1079392] Sun, 04 August 2013 14:02 Go to next message
Micha-Jamie Guthmann is currently offline Micha-Jamie Guthmann
Messages: 13
Registered: October 2012
Junior Member
Hello,

when I call all instances of the eclass competence with .../jsonws/Competence it returns the following json-data.
Note that the first entry in data is not a proxy and the second is. Also note that the includesCompetence entry is also not a proxy.
Am I correct that the second entry is returned as proxy, because it is already contained in detail in the includesCompetence property?
Can I change this somehow, so that all data entries are not returned as proxy but all other references like includesCompetence are returned as proxy?

Thanks,
Micha
{
"endRow":"1",
"_eclass":"response|ResponseType",
"totalRows":"2",
"status":"success",
"startRow":"0",
"data":
[
{
     "_eclass":"cm|Competence",
     "db_version":1,
     "competenceEvidence":[],
     "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/1#",
     "hasCompetenceLevel":null,
     "db_Id":1,
     "_id":"1",
     "name":"TestCompetence1",
     "requiresSkill":[],
     "requiresKnowledge":[],
     "_title":"",
     "competenceWeight":null,
     "includesCompetence":[{
          "_eclass":"cm|Competence",
          "db_version":1,
          "competenceEvidence":[],
          "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/2#",
          "hasCompetenceLevel":null,
          "db_Id":2,
          "_id":"2",
          "name":"TestCompetence2",
          "requiresSkill":[],
          "requiresKnowledge":[],
          "_title":"",
          "competenceWeight":null,
          "includesCompetence":[],
          "userArea":null}
          ],
     "userArea":null
},
{"
     _eclass":"cm|Competence",
     "db_Id":2,
     "_id":"2",
     "_proxy":true,
     "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/2#",
     "_title":""
}
],
"_title":"success"
}
Re: [Texo] Control over what is a proxy and what's not? [message #1083062 is a reply to message #1079392] Fri, 09 August 2013 12:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Micha-Jamie,
It took some time... The second entry is returned as a proxy because the entry was already converted 'within' the first
entry. The logic is really there to prevent infinite cycles but it also shows up in your case.

This should work fine as the json de-serialization will first completely de-serialize the first object and its contained
child and then when encountering the proxy will resolve it automatically.

Actually this proxying and proxy resolution (remote or local) is really the complex part of JSON de-serialization, it is
not (de-)serializing just values (that's fairly simple), the associations are complex to handle, especially because you
don't want to read the whole db and generate huge json files.


gr. Martin

On 08/04/2013 04:02 PM, Micha-Jamie Guthmann wrote:
> Hello,
>
> when I call all instances of the eclass competence with .../jsonws/Competence it returns the following json-data.
> Note that the first entry in data is not a proxy and the second is. Also note that the includesCompetence entry is also
> not a proxy. Am I correct that the second entry is returned as proxy, because it is already contained in detail in the
> includesCompetence property? Can I change this somehow, so that all data entries are not returned as proxy but all other
> references like includesCompetence are returned as proxy?
>
> Thanks,
> Micha
>
> {
> "endRow":"1",
> "_eclass":"response|ResponseType",
> "totalRows":"2",
> "status":"success",
> "startRow":"0",
> "data":
> [
> {
> "_eclass":"cm|Competence",
> "db_version":1,
> "competenceEvidence":[],
> "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/1#",
> "hasCompetenceLevel":null,
> "db_Id":1,
> "_id":"1",
> "name":"TestCompetence1",
> "requiresSkill":[],
> "requiresKnowledge":[],
> "_title":"",
> "competenceWeight":null,
> "includesCompetence":[{
> "_eclass":"cm|Competence",
> "db_version":1,
> "competenceEvidence":[],
> "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/2#",
> "hasCompetenceLevel":null,
> "db_Id":2,
> "_id":"2",
> "name":"TestCompetence2",
> "requiresSkill":[],
> "requiresKnowledge":[],
> "_title":"",
> "competenceWeight":null,
> "includesCompetence":[],
> "userArea":null}
> ],
> "userArea":null
> },
> {"
> _eclass":"cm|Competence",
> "db_Id":2,
> "_id":"2",
> "_proxy":true,
> "_uri":"http://localhost:8080/de.raven.rml.texo.web/jsonws/cm|Competence/2#",
> "_title":""
> }
> ],
> "_title":"success"
> }
>


--

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] Control over what is a proxy and what's not? [message #1089390 is a reply to message #1083062] Sun, 18 August 2013 17:18 Go to previous message
Micha-Jamie Guthmann is currently offline Micha-Jamie Guthmann
Messages: 13
Registered: October 2012
Junior Member
kk thanks.
Previous Topic:[xcore] synchronized
Next Topic:[Edapt] How to migrate models serialized in binary files?
Goto Forum:
  


Current Time: Thu Oct 23 14:05:14 GMT 2014

Powered by FUDForum. Page generated in 0.01819 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software