Community
Participate
Working Groups
The integration of R4E with EMF Compare, will enable the possibility to carry out reviews of EMF based models and be able to associate anomalies / comments to specific model element locations. This bug is raised to track the activities and collaboration related to this effort.
Created attachment 210666 [details] Patch Example of EMF Compare integration.
As example, I adapted the R4E source code to be able to manage model resources and to use EMF Compare through its current API, in relation to: - the opening of a comparison editor from a R4E delta, with selection of the related model difference and objects, - the reusing of the same editor on a same resource to select the right related difference and objects. I attached a patch (from 2012-01-12 revision) which contains these adaptations on R4E code. The main modifications I contributed are: - The add of a new concept: R4EModelPosition, in addition of R4ETextPosition, inheriting from R4EPosition. Consequently, I have added a new class for UI layer: R4EUIModelPosition. - The adaptation of the FindReviewItemsHandler class for the creation of the R4E delta objects. - The adaptation of the R4ECompareEditorInput class to select the right model element at the opening of the EMF Compare editor. - The enhancement of the UIUtils class to select the right element in an opened editor. (Inside of this patch, I have deleted the code modifications coming from the EMF code generation (in relation to the add of the new concept: R4EModelPosition)). Making this work of integration, I have detected some EMF Compare issues (fixed), as described here: Bug 370723 - Regression on setSelection() API Bug 370727 - It is not possible to call the ModelComparator.compare() API inside an existing thread UI Bug 370728 - Papyrus Diagram comparison on notation files
Cedric, I am having problems to apply the patch, see errors below. $ git am /c/Users/lmcalvs/r4e/Obeo/2012/integrationDeltas.patch Applying: evolutions to integrate EMF Compare c:/Users/lmcalvs/git_repos/org.eclipse.mylyn.reviews/.git/rebase-apply/patch:32: trailing whitespace. c:/Users/lmcalvs/git_repos/org.eclipse.mylyn.reviews/.git/rebase-apply/patch:409: trailing whitespace. * c:/Users/lmcalvs/git_repos/org.eclipse.mylyn.reviews/.git/rebase-apply/patch:414: trailing whitespace. * c:/Users/lmcalvs/git_repos/org.eclipse.mylyn.reviews/.git/rebase-apply/patch:416: trailing whitespace. * c:/Users/lmcalvs/git_repos/org.eclipse.mylyn.reviews/.git/rebase-apply/patch:419: trailing whitespace. * fatal: corrupt patch at line 643 Patch failed at 0001 evolutions to integrate EMF Compare When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". $ git apply --check /c/Users/lmcalvs/r4e/Obeo/2012/integrationDeltas.patch fatal: corrupt patch at line 648
I have created this patch with eGit, on Eclipse, from an old commit (259c85e8f7f176d0c652fe32e032e847f8e0fbc2 (2012-01-12)). I am not up to date in relation to R4E developments. Maybe you can not apply the patch because you use GIT console or you try to apply it on a newer version of the master branch... I succeeded to apply it on my local master branch, using eGit tools (contextual menu > Team > Apply Patch...). There is not a lot of modifications. You can easily read the content of this file (with the TortoiseUDiff for example). This file is just an aid to provide a code example to integrate EMF Compare API in the R4E context. Nevertheless, I have generated again a new patch that I attached here (from the same revision and with eGit). Here is the process to test from your side this example of integration: - Reflect/adapt these suggestions of modifications from the content of this patch into your current R4E code. - Reload your r4e.genmodel from the modified org.eclipse.mylyn.reviews.r4e.core.model.ecore (add of R4EModelPosition) - Generate again from the r4e.genmodel - At last, apply the patchs from Bug 370723, Bug 370727 and Bug 370728 into EMF Compare source code. - Launch a runtime eclipse to test.
Created attachment 210715 [details] Patch (regenerated version)
Created attachment 210716 [details] Selection Demo
The patch is now loaded and moved to the latest commit on the new R4E repository location. A quick test from an ecore model works fine, Trying with an ecorediag file caused an out of memory exception after a long waiting time, some troubleshooting is needed on this.
I, Cedric Notot, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, OBEO (Eclipse Strategic Member) to make this contribution under the EPL.
Cedric, I am working on integrating your contribution but before that I need to make EMF compare optional, see the change under the github mirror branch "emf_compare2". The last step is to configure tycho pom.xml file where I am missing a p2 repository where I can fetch the emf compare 1.3 marked as a dependency. I have been looking around in the emf compare web but I only see options to download a repository however not a url I can use as an update site from buld.eclipse.org. Could you point mw to one ? e.g. Nightly builds, weekly builds or snapshots.
That sounds good. Here is the update site of the EMF Compare integration build: http://download.eclipse.org/modeling/emf/compare/updates/interim/1.3