Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Keeping package hierarchy in the documentation
Keeping package hierarchy in the documentation [message #1766910] Wed, 28 June 2017 16:52 Go to next message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
Hello,
I'm able to sort the packages by name, with the following command:
[for(p:Package|self.ownedElement->filter(Package)->sortedBy(name))]

It seems that without the sortedBy, the packages are not ordered like in the project hierarchy, is there a way to do this (ie specifying an id attached to the package, or a specific diagram) ?

Samuel
Re: Keeping package hierarchy in the documentation [message #1766953 is a reply to message #1766910] Thu, 29 June 2017 06:03 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Not sure what you mean by "project hierarchy" according to your code. To me "hierarchy" implies that you have more than one level of nesting, while your code only consider one. If you want to address more than one level you will need to nest loops.

Yves
Re: Keeping package hierarchy in the documentation [message #1766966 is a reply to message #1766953] Thu, 29 June 2017 07:42 Go to previous messageGo to next message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
Hello Yves,
I'm ok with your definition of hierarchy: by considering multiple elements at the same level (ie: Root element with packages) as in the attached picture, I would like to keep the ordering as in the "project"...
  • Attachment: Packages.png
    (Size: 3.81KB, Downloaded 112 times)
Re: Keeping package hierarchy in the documentation [message #1766970 is a reply to message #1766966] Thu, 29 June 2017 08:01 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hello
I don't remember if a query exists in the standard gendoc API (but it should ;))
But you can try something like that :

[for(p:Package|self.ownedElement->filter(Package)->sortedBy( e | e.eContainer().eContents()->indexOf(e))/]

The sortedBy expression will use the value returned by index of to sort the elements

(Simpler) You can also do : [for(p:Package|self.eContents()->filter(Package))/]




[Updated on: Thu, 29 June 2017 08:02]

Report message to a moderator

Re: Keeping package hierarchy in the documentation [message #1766980 is a reply to message #1766970] Thu, 29 June 2017 08:58 Go to previous message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
Hello Tristan,
I used the simpler solution and works fine.

Tx, Samuel
Previous Topic:detecting empty collection
Next Topic:Gendoc with Papyrus 3.0.0 (Oxygen)
Goto Forum:
  


Current Time: Thu Mar 28 17:37:13 GMT 2024

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

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

Back to the top