Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius Tree Description(Order of the XML output file)
Sirius Tree Description [message #1804209] Wed, 20 March 2019 13:20 Go to next message
Rémi Roumiguié is currently offline Rémi RoumiguiéFriend
Messages: 2
Registered: March 2019
Junior Member
Hi all,
I am using Eclipse Sirius to create a tree representation and I am facing an ordering problem in the resulting XML file of the representation of my model.

Lets imagine I have the following tree:

Section 1
Section 2
...
Section n
----- Under-section 1
----- Under-section 2
----- Under-section 3
....

In the representation, the difference sections are re-organized (when I refresh the tree) in the same order of definition as in the creation in the *.odesign (which seems logical).
1st question: How can I modify the code to keep the order of creation of the user rather than the order defined in the *.odesign?

Secondary problem, in the output XML file corresponding to my representation, the order of the "Under-section" is not the same as in the repesentation: they are sorted alphabetically.
2nd question: How can I modify it and have the same order as in the representation ?

I hope my message is clear enough.
Thanks in advance
Remi
Re: Sirius Tree Description [message #1804217 is a reply to message #1804209] Wed, 20 March 2019 15:30 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

Concerning your first question, as you said the order is defined by the order of the mappings. If you want different type of elements to be displayed, you will need to have only one mapping where the Domain Class will be a common superclass (the Domain Class can be an abstract class) and a semantic candidate expression that return the element in this order. This may implies change in your metamodel to have this level of abstraction. For exemple, let's say that we have a family metamodel. If your metamodel has 3 class Family, Man and Woman where Family has 2 references men and women, then in your odesign you are stuck with 2 mappings, one for Man and one for Woman and they will be displayed separatly. Instead you update the metamodel with 4 class Family, FamilyMember, Man and Woman where Man and Woman inherits FamilyMember and Family only has 1 reference familyMembers. In your odesign under Family, you don't have 2 mappings but only one on FamilyMember and the members will be presented in the order of creation instead of one kind after the other.

I am not sure to understand your second question. The order of the elements displayed by a mapping is determined by the semantic candidate expression. The order displayed should be the same has the order serialized in the aird file.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius Tree Description [message #1804219 is a reply to message #1804217] Wed, 20 March 2019 15:48 Go to previous messageGo to next message
Rémi Roumiguié is currently offline Rémi RoumiguiéFriend
Messages: 2
Registered: March 2019
Junior Member
Concerning the first question : it means that I need to create a "fake level" to take into account the order of creation specified by the user. In my case:
Section 1
Section 2
...
Section n
--Fake-section
----- Under-section 1
--Fake-section
----- Under-section 2
--Fake-section
----- Under-section 3
....

Am I write?

Regarding my second question: I am not talking about *aird file but example.myproject file which is used to create the representation.
The order of the sub-section is alphabetical and does not follow the odesign. Maybe it is normal ?
But my concern is that the XML file that I will be able to generate with my representation needs to follow exactly the same order as the tree itself... Would it be the case?

Thanks
Remi
Re: Sirius Tree Description [message #1804263 is a reply to message #1804219] Thu, 21 March 2019 13:23 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

You do not need a fake level, you just need a mapping (and a submapping for your sublevel) with a domain class and semantic candidates expression matching all the element you want to present. The semantic candidates expression can be a reference (even derived if needed) an EOperation or a service.
If in your semantic model the sub-sections are listed in alphabetical order instead of the creation order, you must have changed how element are indexed in your metamodel or by custom code I guess. If in your odesign the semantic candidate expression calls the same process then it will be displayed in the same order. The displayed order does not have to be the same as the semantic order.
If when you add a new element, you need to refresh to have the element move to its correct position, you may be in manual refresh. Can you check in Preference/Sirius if the Automatic refresh property is checked. If it's in automatic refresh, it's strange but you can force having a refresh by checking the "force refresh" property on the creation tool of your Tree Description in the odesign file.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:How to set height and width
Next Topic:Reference between nodes
Goto Forum:
  


Current Time: Wed Oct 23 19:40:07 GMT 2019

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

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

Back to the top