Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » How to reuse queries in multiple templates?
How to reuse queries in multiple templates? [message #1691658] Wed, 08 April 2015 19:01 Go to next message
Johan Van Noten is currently offline Johan Van NotenFriend
Messages: 87
Registered: July 2009
Member
In order to reuse ocl queries and potentially other ocl expressions throughout different templates, it would be convenient to assemble them in an Acceleo module.
This also allows to work around bug that I submitted (https://bugs.eclipse.org/bugs/show_bug.cgi?id=463902).
Moreover, it allows the use of the more convenient Acceleo editor than writing all expressions in Microsoft Word or LibreOffice Writer.

Unfortunately, I don't see how to realize this in gendoc. Are any examples available?
In the bug, I point to an earlier document that potentially explains this topic, but that document doesn't seem to be publicly available (topcased private).
Re: How to reuse queries in multiple templates? [message #1693155 is a reply to message #1691658] Wed, 22 April 2015 06:50 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hello
you can share multiple queries using Gendoc bundles. These bundles are Acceleo queries encapsulation so you can use them in your template
This is not yet described in the gendoc documentation but please find bellow explanations :

-create an acceleo project and your queries in one mtl
- in this eclipse plugin add org.eclipse.gendoc.script.acceleo plugin to your dependencies
- create an extension point org.eclipse.gendoc.script.acceleo.services
- define a name (the same as your mtl)
- reference the emtl corresponding to your mtl (search in your tree in the bin/* folder)
- set false to imported by default
- please take care that your emtl file is also referenced in build section of your plugin (build.properties)
- export your plugin or test in runtime
- now in your template you can reference your template in context tag using the name you defined your extension point. You can also use your queries in your acceleo code within <gendoc> section

<context ... importedBundles='yourBundle' />





[Updated on: Wed, 22 April 2015 12:21]

Report message to a moderator

Re: How to reuse queries in multiple templates? [message #1733314 is a reply to message #1693155] Thu, 26 May 2016 12:43 Go to previous messageGo to next message
Benajmin Schoenholzer is currently offline Benajmin SchoenholzerFriend
Messages: 33
Registered: March 2016
Member
Hello Tristan

Working with plugins in eclipse is completly new for me. But using bundles are important for creating documentations. Because asking for special stereotypes needs a lot of code in the word file. I downloaded the acceleo eclipse and created a project as you told in your post.
But it is hard to find all settings to create a own bundle. I am a little bit lost in the settings of eclipse and so on Smile. Do you have a little exampleproject? I think this would be very helpful.

Thanks for helping.

Greetings
Benny
icon5.gif  Re: How to reuse queries in multiple templates? [message #1734634 is a reply to message #1691658] Fri, 10 June 2016 06:56 Go to previous messageGo to next message
Benajmin Schoenholzer is currently offline Benajmin SchoenholzerFriend
Messages: 33
Registered: March 2016
Member
Hello Tristan

I tried to follow your points. I think it is not that bad. But loading the module in the bundels section does not work actually. I think it is because not all settings are correct. What do you mean with:

- reference the emtl corresponding to your mtl (search in your tree in the bin/* folder)
- set false to imported by default

Could you percise the steps above?

Thanks.
Benny


Re: How to reuse queries in multiple templates? [message #1734677 is a reply to message #1734634] Fri, 10 June 2016 09:08 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi
when you fill properties extensions tab in plugin.xml file you can
1. select a file, there you have to browse to find the emtl file in your plugin (containing your queries)
2. set importedByDefault to false

Do you have used the extension tab in the plugin.xml editor ?




Re: How to reuse queries in multiple templates? [message #1734703 is a reply to message #1734677] Fri, 10 June 2016 12:33 Go to previous messageGo to next message
Benajmin Schoenholzer is currently offline Benajmin SchoenholzerFriend
Messages: 33
Registered: March 2016
Member
Hello Tristan

Yes, you are right i need to fill out the extensions tab. But i am not able to find a way to add this Shocked.

Is that correct, that i have to define the extension point "org.eclipse.gendoc.script.acceleo.services" in the extensionpoint tab because i would only contribute a extension. However i am a little bit confused.
I attached the zipped acceleo project. May be you could shortly crossceck the plugin xml.

Thanks very much and best regards
Benny
Re: How to reuse queries in multiple templates? [message #1734720 is a reply to message #1734703] Fri, 10 June 2016 15:59 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi
you have to fill an extension and not an extension point
In Eclipse world : Extension point defines a schema and extensions instantiates it, I'm sorry my message was not clear

so you have to go to "extension" tab and not "extension point" tab. Find the extension point to fill : org.eclipse.gendoc.script.acceleo.service and then continue what I've explained in previous message

I hope it will be clearer for you




Re: How to reuse queries in multiple templates? [message #1734726 is a reply to message #1734720] Fri, 10 June 2016 16:45 Go to previous message
Benajmin Schoenholzer is currently offline Benajmin SchoenholzerFriend
Messages: 33
Registered: March 2016
Member
Hello Tristan

Ok now i understand. With the stable version (5.1) my eclipse didn't find the extension point (org.eclipse.gendoc.script.acceleo.service) . The dependcy was added and the package was browsable. But clicking on the extensionpoint of the package resulted in a warning. That was also confusing. Now i tried with updating and with the nightly build it works. I hope i can finish my work next week. Thanks for helping.

Best regards
Benny
Previous Topic: Use strange character without lost format
Next Topic:Relative path on static images
Goto Forum:
  


Current Time: Thu Mar 28 15:26:39 GMT 2024

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

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

Back to the top