Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Dynamic Template Plugin(I want to be able to generate with a Acceleo Template in the Workspace from a Eclipse Plugin I have made.)
[Acceleo] Dynamic Template Plugin [message #1702120] Mon, 20 July 2015 07:02 Go to next message
Samuel Windall is currently offline Samuel WindallFriend
Messages: 6
Registered: July 2015
Junior Member
I want to run an Acceleo Project from an Installed Plugin. i.e. I want to be able to generate with a Acceleo Template in the Workspace from a Eclipse Plugin I have made.

Currently, I have an Acceleo project which I run from my Eclipse Plugin programmatically:
try {
final File outputDir = new File("C:/outputDir/");
List<String> arguments = new ArrayList<String>();
/*fc is an instance of a EMF Compare Comparison object
 * the nsURI for it is
Generate generator = new Generate(fc, outputDir, arguments);                                 
            generator.doGenerate(new BasicMonitor());
} catch (IOException e) {

The template is simple at the moment:
[comment encoding = UTF-8 /]
[module generate('')]
[template public generateElement(comparison : Comparison)]
[comment @main/]
[file ('update.sql', false, 'UTF-8')]
[comparison.getDifferences().toString() /]

This generates perfectly.

The issue is that I need to deploy the plugin but I still need end users to be able to modify the templates. The end goal is to have the Acceleo project in the end users' Workspace and let my plugin call it at runtime, but no matter how I set it up, I have to include the Acceleo project in my Plugin Feature.

Things I have attempted:
Overriding the Acceleo Module from a project in the end users workspace
Various attempts with java class loaders - I feel this is the way to go but I can't seem to get a working example

I am running:
Eclipse Luna SR2 (4.4.2)
Windows 7 Pro - 64bit - SP1
JRE 1.8.0_45
Re: [Acceleo] Dynamic Template Plugin [message #1742927 is a reply to message #1702120] Thu, 08 September 2016 15:36 Go to previous message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 47
Registered: October 2014
have you tried to put a platform:/resource/workspaceproject/path... URI on the template path of the extension point? don't know if it would work....
Previous Topic:Best method for generating code from XSD
Next Topic:Unable to generate code
Goto Forum:

Current Time: Wed Feb 21 23:15:28 GMT 2024

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

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

Back to the top