| Summary: | Diagram generation does not respect the Interface Name Pattern supplied in genmodel | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] GMF-Tooling | Reporter: | Josh M <public.web.josh> | ||||||||||||||
| Component: | Core | Assignee: | Andres Alvarez Mattos <aamattos> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | major | ||||||||||||||||
| Priority: | P3 | CC: | aamattos, andres.alvarez.mattos, borlander, mistria | ||||||||||||||
| Version: | unspecified | Flags: | borlander:
iplog-
mistria: review+ |
||||||||||||||
| Target Milestone: | --- | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows XP | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
[GMF Restructure] Bug 319140 : product GMF and component Generation was the original product and component for this bug Created attachment 198634 [details]
Proposed Patch
This is a suggested solution to this bug.
I declared via the org.eclipse.m2m.qvt.oml.javaBlackboxUnits extension point, an utility class to be called from the MetaModel.qvto template
Created attachment 198635 [details]
Modified Template
Template with the modifications to call an utility class registered via org.eclipse.m2m.qvt.oml.javaBlackboxUnits extension point
The patch you attached is in binary format, so that I cannot take a look at it. Can you please resend it in a diff format? Created attachment 198636 [details]
Proposed Patch
The Code is generated incorrectly because the template MetaModel.qvto is not calculating the generated Factories, Packages and Interfaces names according to the user specified patterns. I suggest to modify the org.eclipse.gmf.codegen plugin, declaring via the org.eclipse.m2m.qvt.oml.javaBlackboxUnits extension point an utility class (for example GenPackageUtils) with the methods to correctly use the user custom patterns, and modify the MetaModetl.qvto file to call the appropiate methods in the utility class. I tested this solution with the Utility class defined in a plugin called org.eclipse.gmf.codegen.patch using Dynamic Templates in my GMF project to overwrite the MetaModetl.qvto file Hi Mickael, I incorrectly marked the attachment as a patch. Its an independent plugin in where I put the utility class mentioned in other comment. thanks (In reply to comment #4) > The patch you attached is in binary format, so that I cannot take a look at it. > Can you please resend it in a diff format? Ok, We'll give it a try ASAP, and since there is a workaround, we'll probably get it integrated for a 2.4.1 release (to be released by november). However, it will be available on Interim builds just after the 2.4.0 release is done. Andres, Your solution looks good. Do you think you could provide it as a patch on org.eclipse.gmf.codegen plugin? ( See http://wiki.eclipse.org/Graphical_Modeling_Framework/Get_Involved ) With a patch, we'll be able to run tests easily, and this could be integrated in 2.4.0. Created attachment 199410 [details]
Patch (With compilation errors)
Mickael, I'm having troubles to integrate my solution with the plugin org.eclipse.gmf.codegen.
1 - I downloaded the source code from /cvsroot/modeling/org.eclipse.gmp
2 - Created a Class called GenPackageUtils.java in templates.qvtlib
3 - Modified the extension point org.eclipse.m2m.qvt.oml.javaBlackboxUnits to include the class specified above
4 - Created GenPackageUtils.qvto in folder templates.nativestubs (Not sure about this step)
5 - Modified MetaModel.qvto to call the methods from GenPackageUtils.
Following these steps I'm getting compilation errors at MetaModel.qvto. (I'm attaching these changes as a patch)
When I tried this solution locally, I only made the changes specified in steps 2 and 3, and then used dynamic templates modifying MetaModel.qvto, and it worked for me.
Any Ideas ?
thanks
Created attachment 213347 [details] Proposed Patch Explained on comment #10 Created attachment 213350 [details]
Git Proposed Patch
This patch was integrated and seems to be working well (tested locally and on CI without issue). See https://hudson.eclipse.org/hudson/job/tycho-gmp.gmf.tooling.maintenance/21/ for report. Gracias Andres for this fix! Here is the patch, you are marked as author. http://git.eclipse.org/c/gmf-tooling/org.eclipse.gmf-tooling.git/commit/?h=2.4.x-maintenance&id=8aa88810eb643d8154ebdcd880291cccb9ed4c06 Andres, can you check a recent snapshot built to ensure your patch works correctly? http://download.eclipse.org/modeling/gmp/gmf-tooling/updates/dev-snapshots/2.4.x-maintenance Hi Mickael, I tested the snapshot built, and it worked fine. thanks ! Marking Bugzilla itslef (not attachments) with iplog- to remove Eclipse Webmaster from IP log |
Build Identifier: 20100218-1602 If the user specifies an Interface Name Pattern (I{0}, for example) in the model's genmodel, the GMF generated diagram code does not respect that setting. Reproducible: Always Steps to Reproduce: 1. Create a model (.ecore) and corresponding .genmodel file. 2. Change the Interface Name Pattern (INP) from blank to: I{0} 3. Generate model and edit code from .genmodel 4. Build a .gmfgen using this model and .genmodel 5. Generate diagram code 6. Many compile errors now exist because the gmfgen code is generated as if the INP was still blank.