Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] resolving conflicts with commands
[CDO] resolving conflicts with commands [message #500041] Tue, 24 November 2009 18:48 Go to next message
Lothar Werzinger is currently offline Lothar WerzingerFriend
Messages: 153
Registered: July 2009
Location: Bay Area
Senior Member
Hi,

I created an UI to edit a model stored in a CDO repository.

When I start two instances of the program and I modify and commit a change
on one side the UI of the second one updates automatically to display the
new information as expected.

If I edit on both sides I get a conflict (as expected) after the first one
commits. I can resolve the conflict with the provided conflict resolvers.
However the resolvers don't add to the command stack and therefore after
resolving the conflict the command stack in the editor with the remaining
changes is in an invalid state. Can one create a resolver that properly
adds the changes done during resolving to the command stack, so that
undo/redo continues to work properly?

Lothar
Re: [CDO] resolving conflicts with commands [message #500576 is a reply to message #500041] Thu, 26 November 2009 19:34 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Lothar,

> If I edit on both sides I get a conflict (as expected) after the first one
> commits. I can resolve the conflict with the provided conflict resolvers.
> However the resolvers don't add to the command stack and therefore after
> resolving the conflict the command stack in the editor with the remaining
> changes is in an invalid state. Can one create a resolver that properly
> adds the changes done during resolving to the command stack, so that
> undo/redo continues to work properly?

I've never explicitly used EMF Commands nor CDO Conflict Resolvers, but
I can imagine that one could get the EditingDomain for an specific
Resource, then get the command stack (EditingDomain.getCommandStack())
and then modify the undo command (getUndoCommand())and I guess that also
the redo command (getRedoCommand()). Not sure how Commands are modified,
but Command.chain() looks promissing. Here some javadoc:

"Command org.eclipse.emf.common.command.Command.chain(Command command)
Returns a command that represents the composition of this command with
the given command. The resulting command may just be this, if this
command is capable of composition. Otherwise, it will be a new command
created to compose the two."

All this shall be done within a specific conflict resolver
implementation, I guess. Anyways, Ed knows better about this :P

I googled a bit and found this:

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.workspace.doc/tutorials/workspaceTutorial.html

HTH,
VĂ­ctor.
Previous Topic:[CDO] Adding Tree-lock option to CDO editor.
Next Topic:[CDO] Query on an audit view
Goto Forum:
  


Current Time: Fri Nov 15 02:40:27 GMT 2019

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

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

Back to the top