Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Questions regarding the generated Testdata and other stuff
[Texo] Questions regarding the generated Testdata and other stuff [message #1028002] Wed, 27 March 2013 17:55 Go to next message
Micha-Jamie Guthmann is currently offline Micha-Jamie GuthmannFriend
Messages: 13
Registered: October 2012
Junior Member
I. Prefix:
These are some questions that I originally asked Martin Taal via email and he suggested to post them here for all to see. I have a couple of ecores that have EClasses with self-referencing bi-directional references in them. I ran into a couple of issues which got resolved with the help of Marting Taal. To demonstrate my issues I manipulated the default example project, and the following questions will reference this project.

Basically my setup is this (one reference is a containment, the other is its opposite a container)
EClass Resource
--EReference: isPartOfResource: Resource
--EReference: oppositeIsPartOfResource: Resource
--EAttribute: name: String

I took the default Library example project and expanded the EClass Book so that it has a reference to the EClass Resource (you can get the example project here). I deployed it on Tomcat and generated Tetsdata.



II. The actual questions/ notes
Maybe those are "bugs" or maybe all of this is expected:

1. Is it expected that only one Book has a Reference to the Resource in the testdata? I assume this will be not a problem in reality and is only "an issue" (if you may call it that) of the datagenerator.

2. Is it expected that despite Resources are being created in the datageneration step I cannot see an Entry for "Resource" in the "Types list for EPackage library" html site? See here and here of what I mean by this.

3. I really don't understand the html-view for Instances of EClasses (see here). At the bottom it says isPartofResource and on the right side of this isPartofResource ([name id of one Resource]) and below that a link to another Resource.
At first I thought that maybe this would portrait the isPartOfResource and the opposite Reference, but that's not the case.
Compare the html view of the Resource with id 18 and the corresponding json data (see here for the json)
The References are like this:
Resource 18
--isPartofResource 17
----17 isPartofResource 10
------10 isPartofResource 9
In the htmlview of Resource 18 (see again here) it says "isPartofResource ( nullum ea - 10 )" and below a link to Resource 9. Resource 9 is a pretty random object because 9 itself is part of another Resource.

3.1 Why does the wscall respond with the whole information of 17 and 10 and only with the proxy for 9?

3.2 Why does it display the isPartofResource like it does in the html-view? That's what confuses me the most.

3.3 Why get all OppositeIsPartOfResource-referenced Resources shown as proxies and the isPartofResource-referenced Resources not?

3.4 Why is the OppositeIsPartOfResource not shown in the html-view?



So are those bugs, am I doing something wrong, or am I understanding sth wrong?

Best regards,
Micha
Re: [Texo] Questions regarding the generated Testdata and other stuff [message #1028062 is a reply to message #1028002] Wed, 27 March 2013 19:47 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Micha-Jamie,
See the replies inline.

gr. Martin

On 03/27/2013 06:55 PM, Micha-Jamie Guthmann wrote:
> I. Prefix: These are some questions that I originally asked Martin Taal via email and he suggested to post them here for
> all to see. I have a couple of ecores that have EClasses with self-referencing bi-directional references in them. I ran
> into a couple of issues which got resolved with the help of Marting Taal. To demonstrate my issues I manipulated the
> default example project, and the following questions will reference this project.
> Basically my setup is this (one reference is a containment, the other is its opposite a container)
> EClass Resource
> --EReference: isPartOfResource: Resource
> --EReference: oppositeIsPartOfResource: Resource
> --EAttribute: name: String
>
> I took the default Library example project and expanded the EClass Book so that it has a reference to the EClass
> Resource (you can get the example project http://dl.dropbox.com/u/6568643/texopics/manipulatedtexowebexample.zip). I
> deployed it on Tomcat and generated Tetsdata.
>
>
>
> II. The actual questions/ notes Maybe those are "bugs" or maybe all of this is expected:
>
> 1. Is it expected that only one Book has a Reference to the Resource in the testdata? I assume this will be not a
> problem in reality and is only "an issue" (if you may call it that) of the datagenerator.
MT>> The test data generation works with any ecore model so it is sometimes smart and sometimes less smart...

> 2. Is it expected that despite Resources are being created in the datageneration step I cannot see an Entry for
> "Resource" in the "Types list for EPackage library" html site? See
> http://dl.dropbox.com/u/6568643/texopics/1_generated_objects.png and
> http://dl.dropbox.com/u/6568643/texopics/2_Types_list.png of what I mean by this.
MT>> The resource in your example is part of another epackage, you have to add the resource to the epackage
registration, see the TexoWebExampleContextListener class in the demo project, there you can find the Library package
registration. Add one for the resource model also.

> 3. I really don't understand the html-view for Instances of EClasses (see
> http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png). At the bottom it says isPartofResource and on the
> right side of this isPartofResource ([name id of one Resource]) and below that a link to another Resource.
> At first I thought that maybe this would portrait the isPartOfResource and the opposite Reference, but that's not the
> case. Compare the html view of the Resource with id 18 and the corresponding json data (see
> http://dl.dropbox.com/u/6568643/texopics/4_json_of_resource.png for the json)
> The References are like this:
> Resource 18
> --isPartofResource 17
> ----17 isPartofResource 10
> ------10 isPartofResource 9
> In the htmlview of Resource 18 (see again http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png) it says
> "isPartofResource ( nullum ea - 10 )" and below a link to Resource 9. Resource 9 is a pretty random object because 9
> itself is part of another Resource.
MT>> Hmm yes it seems that the xslt templates can not handle this model completely. These xslt templates are really ment
only for simple demo purposes...

>
> 3.1 Why does the wscall respond with the whole information of 17 and 10 and only with the proxy for 9?
MT>> You can select for how many levels the childs are read, the default is 2, try with the parameter childLevels set to
10 or so.

> 3.2 Why does it display the isPartofResource like it does in the html-view? That's what confuses me the most.
MT> seems to be a bug in the xslt template.

> 3.3 Why get all OppositeIsPartOfResource-referenced Resources shown as proxies and the isPartofResource-referenced
> Resources not?
MT>> The non-containment references are all send back as proxies while the containment/children upto a certain level are
included in the json/xml

> 3.4 Why is the OppositeIsPartOfResource not shown in the html-view?
MT>> Not sure myself, this seems to be a real bug, I don't see it in the xml either, can you enter a bugzilla for this one?

Can you also enter bugzillas for the xslt/template issues? You can also enter a single bugzilla for both the templates
and the opposite xml reference. I have the example project, so no need to attach the example project.

>
>
> So are those bugs, am I doing something wrong, or am I understanding sth wrong?
> Best regards,
> Micha


--

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] Questions regarding the generated Testdata and other stuff [message #1031166 is a reply to message #1028062] Mon, 01 April 2013 09:31 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Micha,
I published a new build which solves the template issue. The reason that the opposite resource ereference is not
serialized in xml is that it seems that container references are not serialized as the container-containment association
is reflected in the xml structure.

Maybe Ed or others know how to explicitly serialize the parent/container ereference. Please ask on the EMF newsgroup if
relevant for you.

gr. Martin

On 03/27/2013 08:47 PM, Martin Taal wrote:
> Hi Micha-Jamie,
> See the replies inline.
>
> gr. Martin
>
> On 03/27/2013 06:55 PM, Micha-Jamie Guthmann wrote:
>> I. Prefix: These are some questions that I originally asked Martin Taal via email and he suggested to post them here for
>> all to see. I have a couple of ecores that have EClasses with self-referencing bi-directional references in them. I ran
>> into a couple of issues which got resolved with the help of Marting Taal. To demonstrate my issues I manipulated the
>> default example project, and the following questions will reference this project.
>> Basically my setup is this (one reference is a containment, the other is its opposite a container)
>> EClass Resource
>> --EReference: isPartOfResource: Resource
>> --EReference: oppositeIsPartOfResource: Resource
>> --EAttribute: name: String
>>
>> I took the default Library example project and expanded the EClass Book so that it has a reference to the EClass
>> Resource (you can get the example project http://dl.dropbox.com/u/6568643/texopics/manipulatedtexowebexample.zip). I
>> deployed it on Tomcat and generated Tetsdata.
>>
>>
>>
>> II. The actual questions/ notes Maybe those are "bugs" or maybe all of this is expected:
>>
>> 1. Is it expected that only one Book has a Reference to the Resource in the testdata? I assume this will be not a
>> problem in reality and is only "an issue" (if you may call it that) of the datagenerator.
> MT>> The test data generation works with any ecore model so it is sometimes smart and sometimes less smart...
>
>> 2. Is it expected that despite Resources are being created in the datageneration step I cannot see an Entry for
>> "Resource" in the "Types list for EPackage library" html site? See
>> http://dl.dropbox.com/u/6568643/texopics/1_generated_objects.png and
>> http://dl.dropbox.com/u/6568643/texopics/2_Types_list.png of what I mean by this.
> MT>> The resource in your example is part of another epackage, you have to add the resource to the epackage
> registration, see the TexoWebExampleContextListener class in the demo project, there you can find the Library package
> registration. Add one for the resource model also.
>
>> 3. I really don't understand the html-view for Instances of EClasses (see
>> http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png). At the bottom it says isPartofResource and on the
>> right side of this isPartofResource ([name id of one Resource]) and below that a link to another Resource.
>> At first I thought that maybe this would portrait the isPartOfResource and the opposite Reference, but that's not the
>> case. Compare the html view of the Resource with id 18 and the corresponding json data (see
>> http://dl.dropbox.com/u/6568643/texopics/4_json_of_resource.png for the json)
>> The References are like this:
>> Resource 18
>> --isPartofResource 17
>> ----17 isPartofResource 10
>> ------10 isPartofResource 9
>> In the htmlview of Resource 18 (see again http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png) it says
>> "isPartofResource ( nullum ea - 10 )" and below a link to Resource 9. Resource 9 is a pretty random object because 9
>> itself is part of another Resource.
> MT>> Hmm yes it seems that the xslt templates can not handle this model completely. These xslt templates are really ment
> only for simple demo purposes...
>
>>
>> 3.1 Why does the wscall respond with the whole information of 17 and 10 and only with the proxy for 9?
> MT>> You can select for how many levels the childs are read, the default is 2, try with the parameter childLevels set to
> 10 or so.
>
>> 3.2 Why does it display the isPartofResource like it does in the html-view? That's what confuses me the most.
> MT> seems to be a bug in the xslt template.
>
>> 3.3 Why get all OppositeIsPartOfResource-referenced Resources shown as proxies and the isPartofResource-referenced
>> Resources not?
> MT>> The non-containment references are all send back as proxies while the containment/children upto a certain level are
> included in the json/xml
>
>> 3.4 Why is the OppositeIsPartOfResource not shown in the html-view?
> MT>> Not sure myself, this seems to be a real bug, I don't see it in the xml either, can you enter a bugzilla for this one?
>
> Can you also enter bugzillas for the xslt/template issues? You can also enter a single bugzilla for both the templates
> and the opposite xml reference. I have the example project, so no need to attach the example project.
>
>>
>>
>> So are those bugs, am I doing something wrong, or am I understanding sth wrong?
>> Best regards,
>> Micha
>
>


--

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] Questions regarding the generated Testdata and other stuff [message #1031183 is a reply to message #1031166] Mon, 01 April 2013 10:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Martin,

A container reference is only serialized for a root object and then only
if it is cross resource contained by another object and the container
reference itself isn't marked transient.


On 01/04/2013 11:31 AM, Martin Taal wrote:
> Hi Micha,
> I published a new build which solves the template issue. The reason
> that the opposite resource ereference is not serialized in xml is that
> it seems that container references are not serialized as the
> container-containment association is reflected in the xml structure.
>
> Maybe Ed or others know how to explicitly serialize the
> parent/container ereference. Please ask on the EMF newsgroup if
> relevant for you.
>
> gr. Martin
>
> On 03/27/2013 08:47 PM, Martin Taal wrote:
>> Hi Micha-Jamie,
>> See the replies inline.
>>
>> gr. Martin
>>
>> On 03/27/2013 06:55 PM, Micha-Jamie Guthmann wrote:
>>> I. Prefix: These are some questions that I originally asked Martin
>>> Taal via email and he suggested to post them here for
>>> all to see. I have a couple of ecores that have EClasses with
>>> self-referencing bi-directional references in them. I ran
>>> into a couple of issues which got resolved with the help of Marting
>>> Taal. To demonstrate my issues I manipulated the
>>> default example project, and the following questions will reference
>>> this project.
>>> Basically my setup is this (one reference is a containment, the
>>> other is its opposite a container)
>>> EClass Resource
>>> --EReference: isPartOfResource: Resource
>>> --EReference: oppositeIsPartOfResource: Resource
>>> --EAttribute: name: String
>>>
>>> I took the default Library example project and expanded the EClass
>>> Book so that it has a reference to the EClass
>>> Resource (you can get the example project
>>> http://dl.dropbox.com/u/6568643/texopics/manipulatedtexowebexample.zip).
>>> I
>>> deployed it on Tomcat and generated Tetsdata.
>>>
>>>
>>>
>>> II. The actual questions/ notes Maybe those are "bugs" or maybe all
>>> of this is expected:
>>>
>>> 1. Is it expected that only one Book has a Reference to the Resource
>>> in the testdata? I assume this will be not a
>>> problem in reality and is only "an issue" (if you may call it that)
>>> of the datagenerator.
>> MT>> The test data generation works with any ecore model so it is
>> sometimes smart and sometimes less smart...
>>
>>> 2. Is it expected that despite Resources are being created in the
>>> datageneration step I cannot see an Entry for
>>> "Resource" in the "Types list for EPackage library" html site? See
>>> http://dl.dropbox.com/u/6568643/texopics/1_generated_objects.png and
>>> http://dl.dropbox.com/u/6568643/texopics/2_Types_list.png of what I
>>> mean by this.
>> MT>> The resource in your example is part of another epackage, you
>> have to add the resource to the epackage
>> registration, see the TexoWebExampleContextListener class in the demo
>> project, there you can find the Library package
>> registration. Add one for the resource model also.
>>
>>> 3. I really don't understand the html-view for Instances of EClasses
>>> (see
>>> http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png). At
>>> the bottom it says isPartofResource and on the
>>> right side of this isPartofResource ([name id of one Resource]) and
>>> below that a link to another Resource.
>>> At first I thought that maybe this would portrait the
>>> isPartOfResource and the opposite Reference, but that's not the
>>> case. Compare the html view of the Resource with id 18 and the
>>> corresponding json data (see
>>> http://dl.dropbox.com/u/6568643/texopics/4_json_of_resource.png for
>>> the json)
>>> The References are like this:
>>> Resource 18
>>> --isPartofResource 17
>>> ----17 isPartofResource 10
>>> ------10 isPartofResource 9
>>> In the htmlview of Resource 18 (see again
>>> http://dl.dropbox.com/u/6568643/texopics/3_htmlview_of_resource.png)
>>> it says
>>> "isPartofResource ( nullum ea - 10 )" and below a link to Resource
>>> 9. Resource 9 is a pretty random object because 9
>>> itself is part of another Resource.
>> MT>> Hmm yes it seems that the xslt templates can not handle this
>> model completely. These xslt templates are really ment
>> only for simple demo purposes...
>>
>>>
>>> 3.1 Why does the wscall respond with the whole information of 17 and
>>> 10 and only with the proxy for 9?
>> MT>> You can select for how many levels the childs are read, the
>> default is 2, try with the parameter childLevels set to
>> 10 or so.
>>
>>> 3.2 Why does it display the isPartofResource like it does in the
>>> html-view? That's what confuses me the most.
>> MT> seems to be a bug in the xslt template.
>>
>>> 3.3 Why get all OppositeIsPartOfResource-referenced Resources shown
>>> as proxies and the isPartofResource-referenced
>>> Resources not?
>> MT>> The non-containment references are all send back as proxies
>> while the containment/children upto a certain level are
>> included in the json/xml
>>
>>> 3.4 Why is the OppositeIsPartOfResource not shown in the html-view?
>> MT>> Not sure myself, this seems to be a real bug, I don't see it in
>> the xml either, can you enter a bugzilla for this one?
>>
>> Can you also enter bugzillas for the xslt/template issues? You can
>> also enter a single bugzilla for both the templates
>> and the opposite xml reference. I have the example project, so no
>> need to attach the example project.
>>
>>>
>>>
>>> So are those bugs, am I doing something wrong, or am I understanding
>>> sth wrong?
>>> Best regards,
>>> Micha
>>
>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [Texo] Questions regarding the generated Testdata and other stuff [message #1031985 is a reply to message #1028002] Tue, 02 April 2013 12:42 Go to previous messageGo to next message
Micha-Jamie Guthmann is currently offline Micha-Jamie GuthmannFriend
Messages: 13
Registered: October 2012
Junior Member
Thanks again.

I've noticed one further minor thing. If I generate test data with both packages registered, I don't see all instances of EClass Resource in the html view.

See this:
1. generate test data with the library package creates 13 Resources
https://dl.dropbox.com/u/6568643/texopics/generated_test_data_library.png

2. only 1 instance is shown for EClass Resource
https://dl.dropbox.com/u/6568643/texopics/instances_resource1.png

3. generate test data with the resourcemodel creates 3 Resources
https://dl.dropbox.com/u/6568643/texopics/generated_test_data_resource.png

4. now 2 are beeing shown
https://dl.dropbox.com/u/6568643/texopics/instances_resource2.png


Looking at the json I noticed that the Resources that are beeing shown both have the OppositeIsPartOfResource set to null.
Is this expected? (Disclaimer: I have not used your new build, testing that out next)


Best regards,
Micha
Re: [Texo] Questions regarding the generated Testdata and other stuff [message #1031994 is a reply to message #1031985] Tue, 02 April 2013 12:57 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Micha,
Yes I guess the resources being shown are root resources, so they are not contained in anything else. This probably
happens in the xml serialization on the server side.

gr. Martin

On 04/02/2013 02:42 PM, Micha-Jamie Guthmann wrote:
> Thanks again.
> I've noticed one further minor thing. If I generate test data with both packages registered, I don't see all instances
> of EClass Resource in the html view.
>
> See this: 1. generate test data with the library package creates 13 Resources
> https://dl.dropbox.com/u/6568643/texopics/generated_test_data_library.png
>
> 2. only 1 instance is shown for EClass Resource
> https://dl.dropbox.com/u/6568643/texopics/instances_resource1.png
>
> 3. generate test data with the resourcemodel creates 3 Resources
> https://dl.dropbox.com/u/6568643/texopics/generated_test_data_resource.png
>
> 4. now 2 are beeing shown
> https://dl.dropbox.com/u/6568643/texopics/instances_resource2.png
>
>
> Looking at the json I noticed that the Resources that are beeing shown both have the OppositeIsPartOfResource set to
> null. Is this expected? (Disclaimer: I have not used your new build, testing that out next)
>
>
> Best regards,
> Micha


--

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
Previous Topic:[Texo] Resolve proxies
Next Topic:[Texo] Persist already deleted objects
Goto Forum:
  


Current Time: Fri Mar 29 11:07:27 GMT 2024

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

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

Back to the top