Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326392 - extension of org.eclipse.gmt.modisco.java
Summary: extension of org.eclipse.gmt.modisco.java
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Contribution (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 0.9.0 M3   Edit
Assignee: Fabien Giquel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 05:53 EDT by Björn Tietjens CLA
Modified: 2010-10-05 05:15 EDT (History)
4 users (show)

See Also:
fabien.giquel: indigo+


Attachments
contains: DiscoverKdmModelFromJavaModel: added a few lines see line 43 and line 73++. And TranslateJavaModelToKdm added attributes lines 55 and 56 and changed method line 103++ (4.42 KB, application/zip)
2010-09-28 05:53 EDT, Björn Tietjens CLA
fabien.giquel: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Tietjens CLA 2010-09-28 05:53:31 EDT
Created attachment 179723 [details]
contains: DiscoverKdmModelFromJavaModel: added a few lines see line 43 and line 73++. And TranslateJavaModelToKdm added attributes lines 55 and 56 and changed method line 103++

Hi,

in my project I am using from the org.eclipse.gmt.modisco.java.actions package the class "DiscoverKdmModelFromJavaModel" directly and with it indirectly the class "TranslateJavaModelToKdm". Since I want to extend the transformation being used in kdmTranslater I needed a way to define the path to transformation.

To do this I have extended the "DiscoverKdmModelFromJavaModel" class with a new parameter called: "PARAMETER_PATH_TO_TRANSFORMATION" which is passed to the kdmTranslater if it was set.

To pass that path to transformation to the kdmTranslater I added to variables:    

private String pathToTransformation = "";
private String pathToTransformationDefault = "resources/transformations/javaToKdm.asm";

to the TranslateJavaModelToKdm class with their getters and setters.

In addition I changed the method: "public Resource getKDMModelFromJavaModelWithCustomTransformation(final URI javaSourceModelUri,
            final URI kdmTargetModelUri) throws ATLCoreException"

checking whether the pathToTransformation is not-null and not-empty and if resource can be found, otherwise using the pathToTransformationDefault set to the value it was before changing anything: "resources/transformations/javaToKdm.asm".

Since this was done anyway I wanted to contribute this as a way to be able to extend the transformation mechanism.

Since these are only minor changes I have done them directly in the code from svn and marked them with comments containing my name.

Thank you for considering these extensions.

Cheers
Björn Tietjens
Comment 1 Fabien Giquel CLA 2010-09-29 03:55:46 EDT
Hi Bjorn,

thank you for proposing this new parameter for java to kdm discovery process.
I will have a look and integrate this contribution as soon as possible.

Fabien.
Comment 2 Fabien Giquel CLA 2010-09-29 04:07:21 EDT
From a legal point of view, can you make the following confirmations on this bug :

"(a) I, XXX, wrote 100% of the code of the conribution, and
(b) I have the right to contribute the code to Eclipse ? (--> Typically, this
means that your employer, if you have one, agrees to this contribution.)
(c) I want to contribute this code under EPL"
Comment 3 Björn Tietjens CLA 2010-09-29 14:13:13 EDT
(a) I, Björn Tietjens, wrote 100% of the code of the conribution, and
(b) I have the right to contribute the code to Eclipse, since I created the code while working on my thesis for University.
(c) I want to contribute this code under EPL
Comment 4 Fabien Giquel CLA 2010-09-30 04:37:33 EDT
The contribution (less than 250 lines) has been commited into SVN.

I complete the parameter management to accept URL kind of parameter (ex : "file//C:/MyPath/MyTransformation.asm"), additionaly to the relative kind (/resources/MyTransformation.asm").

Thank you again.
Fabien.
Comment 5 Hugo Bruneliere CLA 2010-10-05 05:15:50 EDT
Contribution integrated.