Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » create models to show in compare view
create models to show in compare view [message #136524] Tue, 19 May 2009 21:31 Go to next message
Thomas L is currently offline Thomas LFriend
Messages: 9
Registered: July 2009
Junior Member
hi,
I develop a multi tier appication. The server contain the compare service
and the client should view the reponse. In the server creation of the
MatchModel and the DiffModel work success. But the DiffModel can't display
in the compare view. When I use the default compare plug in and save the
result, it show different as the DiffModel. E.g. it contains both model
the DiffModel and the MatchModel. I try to use the MergeService and it
doesn't work.
some code:

Map options = new HashMap();
MatchModel match = new EcoreMatchEngine().resourceMatch(resourceLeft,
resourceRight, options);
Resource resourceOutputMatch = resourceSet.createResource(URI
.createFileURI("c:/temp/match1.xmi"));
resourceOutputMatch.getContents().add(match);
resourceOutputMatch.save(null);

DiffModel diffModel = new EcoreDiffEngine().doDiff(match);
Resource resourceOutputDiff = resourceSet.createResource(URI
.createFileURI(locateProject+"/temp/diff1.xmi"));
resourceOutputDiff.getContents().add(diffModel);
resourceOutputDiff.save(null);

ModelUtils.save(diffModel, locateProject+"test.emfdiff");

How can I create a reponse.emfdiff which show like the file form the
compare plug in?

thanks
Re: create models to show in compare view [message #136536 is a reply to message #136524] Tue, 19 May 2009 22:30 Go to previous messageGo to next message
Thomas L is currently offline Thomas LFriend
Messages: 9
Registered: July 2009
Junior Member
I forget to say that the client is a eclipse plug in and can show emfdiff
files from the compare plug in
Re: create models to show in compare view [message #136934 is a reply to message #136536] Thu, 04 June 2009 14:59 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020000050407010704080208
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Thomas,

Sorry, I've been out of the office and couldn't check the newsgroup for
a while.

You should take a look at the
org.eclipse.emf.compare.examples.standalone example to see the necessary
code to compare two models and save the result in a readable emfdiff.
That said, the code would look something like :

----------8<----------
Map options = new HashMap();
// Matching
MatchModel match = MatchService.doMatch(resourceLeft, resourceRight,
options);
// Differencing
DiffModel diff = DiffService.doDiff(match);

// Create result instance
ComparisonResourceSnapshot snapshot =
DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
snapshot.setDate(Calendar.getInstance().getTime());
snapshot.setMatch(match);
snapshot.setDiff(diff);

// Save result
ModelUtils.save(snapshot, "result.emfdiff");
---------->8----------

Cheers,

Laurent Goubet
Obeo

Thomas L a
Re: create models to show in compare view [message #620960 is a reply to message #136524] Tue, 19 May 2009 22:30 Go to previous message
Thomas L is currently offline Thomas LFriend
Messages: 9
Registered: July 2009
Junior Member
I forget to say that the client is a eclipse plug in and can show emfdiff
files from the compare plug in
Re: create models to show in compare view [message #620993 is a reply to message #136536] Thu, 04 June 2009 14:59 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020000050407010704080208
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Thomas,

Sorry, I've been out of the office and couldn't check the newsgroup for
a while.

You should take a look at the
org.eclipse.emf.compare.examples.standalone example to see the necessary
code to compare two models and save the result in a readable emfdiff.
That said, the code would look something like :

----------8<----------
Map options = new HashMap();
// Matching
MatchModel match = MatchService.doMatch(resourceLeft, resourceRight,
options);
// Differencing
DiffModel diff = DiffService.doDiff(match);

// Create result instance
ComparisonResourceSnapshot snapshot =
DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
snapshot.setDate(Calendar.getInstance().getTime());
snapshot.setMatch(match);
snapshot.setDiff(diff);

// Save result
ModelUtils.save(snapshot, "result.emfdiff");
---------->8----------

Cheers,

Laurent Goubet
Obeo

Thomas L a
Previous Topic:[Announce] EMFT MWE 0.7.0RC3 is available
Next Topic:compare 2 models in elipse rcp
Goto Forum:
  


Current Time: Sat Mar 02 03:49:00 GMT 2024

Powered by FUDForum. Page generated in 0.03266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top