Bug 370783 - Integration with EMF Compare (Model Reviews support)
Summary: Integration with EMF Compare (Model Reviews support)
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P2 enhancement (vote)
Target Milestone: 0.14   Edit
Assignee: Jacques Bouthillier CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on: 373457
Blocks:
  Show dependency tree
 
Reported: 2012-02-06 20:02 EST by Alvaro Sanchez-Leon CLA
Modified: 2013-03-19 13:42 EDT (History)
4 users (show)

See Also:
alvaro.sanchez-leon: iplog+


Attachments
Patch (29.50 KB, patch)
2012-02-07 12:26 EST, Cedric Notot CLA
no flags Details | Diff
Patch (regenerated version) (31.42 KB, patch)
2012-02-08 05:24 EST, Cedric Notot CLA
alvaro.sanchez-leon: iplog+
Details | Diff
Selection Demo (646.45 KB, application/x-zip)
2012-02-08 05:36 EST, Cedric Notot CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Sanchez-Leon CLA 2012-02-06 20:02:18 EST
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.
Comment 1 Cedric Notot CLA 2012-02-07 12:26:02 EST
Created attachment 210666 [details]
Patch

Example of EMF Compare integration.
Comment 2 Cedric Notot CLA 2012-02-07 12:26:53 EST
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
Comment 3 Alvaro Sanchez-Leon CLA 2012-02-07 20:05:48 EST
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
Comment 4 Cedric Notot CLA 2012-02-08 05:22:17 EST
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.
Comment 5 Cedric Notot CLA 2012-02-08 05:24:16 EST
Created attachment 210715 [details]
Patch (regenerated version)
Comment 6 Cedric Notot CLA 2012-02-08 05:36:37 EST
Created attachment 210716 [details]
Selection Demo
Comment 7 Alvaro Sanchez-Leon CLA 2012-02-14 14:38:28 EST
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.
Comment 8 Cedric Notot CLA 2012-02-15 05:13:09 EST
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.
Comment 9 Alvaro Sanchez-Leon CLA 2012-02-29 15:22:55 EST
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.
Comment 10 Cedric Notot CLA 2012-03-01 04:49:23 EST
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