Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » QVTO Transformation in a Eclipse Plugin
QVTO Transformation in a Eclipse Plugin [message #847753] Tue, 17 April 2012 16:10 Go to next message
Benjamin Kaltenbrunn is currently offline Benjamin Kaltenbrunn
Messages: 3
Registered: March 2012
Junior Member
Hi

I'm trying to develop a Eclipse Plugin, in which a QVTO Transformation is executed by clicking in a Wizard on a Button.

So I created a Plugin with a Wizard and added the TransformationExecuter classes as described here in the forum for a QVTO Transformation execution by code.

But now I have to reference from my Plugin - Project the corresponding QVTO - Project, where I've implementented my metamodels, transformations and modelinstances.

I'm completely new with developing PlugIns so I've no idea how to realise this. Because on the one side I can't make a PlugIn Project with QVTO Support and on the other side I can't reference my QVTO Project from my PlugIn Project.

What have I to do to realise this ?

Thanks

Benni
Re: QVTO Transformation in a Eclipse Plugin [message #847834 is a reply to message #847753] Tue, 17 April 2012 17:51 Go to previous messageGo to next message
Fabio L. S. is currently offline Fabio L. S.
Messages: 15
Registered: July 2010
Location: Brazil
Junior Member
Hello Benni;

You don't need to reference a project in another. First, you have to create plugins for your Ecore metamodels (using EMF). Use the wizard to export them as jars and copy these jars to the "plugin" directory in Eclipse. Now you can use the metamodels in your "plugin project". Copy the needed files (transformation in .qvto and other models you use) to a folder in the "plugin project". And use:

URL url = YourEditorPlugin.getPlugin().getBundle().getEntry("transformation.qvto"));
URL resolved = FileLocator.toFileURL(url);
URI uri = URI.createURI(url.toString(), true);

To obtain the Uri to be used by the TransformationExecutor.

Maybe there is another way... But this one worked for me.

Regards;
Fábio L. S.


Fabio Levy Siqueira
Re: QVTO Transformation in a Eclipse Plugin [message #848822 is a reply to message #847834] Wed, 18 April 2012 15:52 Go to previous message
Alan McMorran is currently offline Alan McMorran
Messages: 55
Registered: July 2009
Member
The other alternative is to do:

URI uri =
URI.createPlatformPluginURI(MyPlugin.PLUGIN_ID+"/transform/transformation.qvto",
true);

This assumes the transformation was in the path
transform/transformation.qvto within your plugin and you're accessing
the plug-in ID using the static string PLUGIN_ID. Alternatively
assuming the plugin was of ID com.example.plugin you would have:

URI uri =
URI.createPlatformPluginURI("com.example.plugin/transform/transformation.qvto",
true);

Alan

On 2012-04-17 17:51:20 +0000, Fabio L. S. said:

> Hello Benni;
>
> You don't need to reference a project in another. First, you have to
> create plugins for your Ecore metamodels (using EMF). Use the wizard to
> export them as jars and copy these jars to the "plugin" directory in
> Eclipse. Now you can use the metamodels in your "plugin project". Copy
> the needed files (transformation in .qvto and other models you use) to
> a folder in the "plugin project". And use:
>
> URL url =
> YourEditorPlugin.getPlugin().getBundle().getEntry("transformation.qvto"));
URL
>
> resolved = FileLocator.toFileURL(url);
> URI uri = URI.createURI(url.toString(), true);
>
> To obtain the Uri to be used by the TransformationExecutor.
>
> Maybe there is another way... But this one worked for me.
>
> Regards;
> Fábio L. S.
> --
Previous Topic:[Solved][ATL] Memory error
Next Topic:[ATL] and GMF
Goto Forum:
  


Current Time: Wed Sep 03 02:12:27 GMT 2014

Powered by FUDForum. Page generated in 0.01765 seconds