Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Overriding templates (provided by an installed plugin) in a dev project
[Acceleo] Overriding templates (provided by an installed plugin) in a dev project [message #666743] Fri, 22 April 2011 06:39 Go to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi,
I want to achieve the following:
- I provide templates through a plugin, this plugin makes it possible for people to right click on an ecore file and
generate some code. This plugin is installed inside eclipse.
- A user has a development project with a model (an ecore file), in a templates folder he/she overrides one of my
templates provided through the plugin installed in the IDE
- the user sets the extension point for dynamic overrides and adds the installed plugin as a dependency

What will happen when the user right clicks the model file and select the menu option I provide to generate code? I
mean, will Acceleo find the overriding template in the users development project?

Did I miss a setting which can be important, or is it fine as I describe it above?

--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Acceleo] Overriding templates (provided by an installed plugin) in a dev project [message #666749 is a reply to message #666743] Fri, 22 April 2011 07:45 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Martin,

The overriding templates need to be in an installed plugin. The project being in the workspace, its extension points are not registered in the current Eclipse instance and thus are not accessible for your Acceleo generator deployed as a plugin.

Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com



Re: [Acceleo] Overriding templates (provided by an installed plugin) in a dev project [message #666774 is a reply to message #666749] Fri, 22 April 2011 12:27 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Okay this won't work for me, is there another way I can override change the template import process of Acceleo? So that
I can read the templates from another place?

I mean my logic knows that there are templates located in a certain folder, can it force acceleo to import/read them
(and their emtl) files?

gr. Martin

On 04/22/2011 09:45 AM, Stephane Begaudeau wrote:
> Hi Martin,
>
> The overriding templates need to be in an installed plugin. The project being in the workspace, its extension points are
> not registered in the current Eclipse instance and thus are not accessible for your Acceleo generator deployed as a plugin.
>
> Stephane Begaudeau, Obeo
> --
> Twitter: http://twitter.com/#!/sbegaudeau
> Acceleo wiki: http://wiki.eclipse.org/Acceleo
> Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com/
>


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Acceleo] Overriding templates (provided by an installed plugin) in a dev project [message #667059 is a reply to message #666743] Tue, 26 April 2011 15:05 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Martin,

I mean my logic knows that there are templates located in a certain folder, can it force acceleo to import/read them (and their emtl) files?


The dynamic module mechanism will only work with deployed Eclipse plugin but if you know where your modules are, you just have to load them (ModelUtils.load) in the resource set containing the modules of your generator.

Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com



Re: [Acceleo] Overriding templates (provided by an installed plugin) in a dev project [message #667539 is a reply to message #666743] Fri, 29 April 2011 12:54 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Martin,

It seems that my answer was incomplete. You should look at org.eclipse.acceleo.engine.service.AcceleoDynamicTemplatesRe gistry. If you want to programmatically contribute dynamic modules.

Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com



Previous Topic:[Xpand] Incremental generation with Xtext models
Next Topic:[JET2] Is output to file system location or string possible?
Goto Forum:
  


Current Time: Thu Oct 23 14:39:06 GMT 2014

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

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