How to reuse queries in multiple templates? [message #1691658] |
Wed, 08 April 2015 19:01  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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] by Moderator 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   |
Eclipse User |
|
|
|
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 . Do you have a little exampleproject? I think this would be very helpful.
Thanks for helping.
Greetings
Benny
|
|
|
Re: How to reuse queries in multiple templates? [message #1734634 is a reply to message #1691658] |
Fri, 10 June 2016 06:56   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 .
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04376 seconds