|
|
|
Re: [CDO] Undo/Redo of CDOTransactions [message #925090 is a reply to message #925016] |
Thu, 27 September 2012 11:09 |
|
Am 27.09.2012 12:05, schrieb Kenny Lee:
> Eike Stepper wrote on Thu, 27 September 2012 05:27
>> Am 27.09.2012 11:14, schrieb Kenny Lee:
>> > Hi,
>> >
>> > Say i want to implement some undo/redo feature for modifying CDOObjects.
>> >
>> > Do you recommend using CDORevision strategy, What would that be?
>>
>> I guess after each commit, a new CDORevision would be created. And i can somehow
>> fetch an earlier revision of the CDOObject? Any sample code.
That would theoretically be possible but it would require to persist/commit each stage you want to return to. Normally
undo/redo are needed at the client side only, e.g., in editors before commit is called. An EMF command stack is used
normally to support undo/redo of edit commands.
>>
>> > or CDOSavePoints concept?
>> Savepoints are good for Undo, but they don't support Redo.
>>
>> Ok. So that rues out using Savepoints. Because my use case is both undo and redo.
>>
>> > Bearing in mind that each modification requires a new CDOTransaction.
>> Not sure how to interpret that. You can modify the model many times before you commit and you don't need a new
>> transaction after a commit. Just continue to modify the model and commit again eventually.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Undo/Redo of CDOTransactions [message #925766 is a reply to message #925090] |
Fri, 28 September 2012 02:20 |
Kenny Lee Messages: 39 Registered: September 2012 |
Member |
|
|
Eike Stepper wrote on Thu, 27 September 2012 07:09Am 27.09.2012 12:05, schrieb Kenny Lee:
> Eike Stepper wrote on Thu, 27 September 2012 05:27
>> Am 27.09.2012 11:14, schrieb Kenny Lee:
>> > Hi,
>> >
>> > Say i want to implement some undo/redo feature for modifying CDOObjects.
>> >
>> > Do you recommend using CDORevision strategy, What would that be?
>>
>> I guess after each commit, a new CDORevision would be created. And i can somehow
>> fetch an earlier revision of the CDOObject? Any sample code.
That would theoretically be possible but it would require to persist/commit each stage you want to return to. Normally
undo/redo are needed at the client side only, e.g., in editors before commit is called. An EMF command stack is used
normally to support undo/redo of edit commands.
Thanks Eike.
Do you have a sample of fetching a certain revision of a CDOObject by the CDORevisionKey?
>>
>> > or CDOSavePoints concept?
>> Savepoints are good for Undo, but they don't support Redo.
>>
>> Ok. So that rues out using Savepoints. Because my use case is both undo and redo.
>>
>> > Bearing in mind that each modification requires a new CDOTransaction.
>> Not sure how to interpret that. You can modify the model many times before you commit and you don't need a new
>> transaction after a commit. Just continue to modify the model and commit again eventually.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>
>
|
|
|
Re: [CDO] Undo/Redo of CDOTransactions [message #925914 is a reply to message #925766] |
Fri, 28 September 2012 06:07 |
|
Am 28.09.2012 04:20, schrieb Kenny Lee:
>> >> I guess after each commit, a new CDORevision would be created. And i can somehow
>> >> fetch an earlier revision of the CDOObject? Any sample code.
>> That would theoretically be possible but it would require to persist/commit each stage you want to return to.
>> Normally undo/redo are needed at the client side only, e.g., in editors before commit is called. An EMF command stack
>> is used normally to support undo/redo of edit commands.
>>
>> Thanks Eike.
>> Do you have a sample of fetching a certain revision of a CDOObject by the CDORevisionKey?
CDORevision r1 = CDOUtil.getRevisionByVersion(CDOObject, int version)
CDORevision r2 = CDOUtil.getRevisionByVersion(CDOObject, CDOBranch, int version)
For access to historical CDOObjects you must open an audit view:
CDOView audit = session.openView(long timeStamp);
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03969 seconds