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 10:02  |
Eclipse User |
|
|
|
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 08:13   |
Eclipse User |
|
|
|
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
|
|
| |
Goto Forum:
Current Time: Tue Jul 22 20:15:21 EDT 2025
Powered by FUDForum. Page generated in 0.03569 seconds
|