Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (no subject)
(no subject) [message #720289] Tue, 30 August 2011 10:07 Go to next message
Nathalie Lepine is currently offline Nathalie LepineFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,

I would like to get all the revisions of a CDOObject, is there a way to
do that ?
I try with the RevisionManager but i can only have the last or a
specific version revision. Others posts on the newsgroup talk about
CDOAudit but it seems that this class does not exist anymore.

Thanks,

Nathalie Lepine, Obeo
(no subject) [message #720304 is a reply to message #720289] Tue, 30 August 2011 10:44 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
Am 30.08.2011 12:07, schrieb Nathalie Lepine:
> Hi,
>
> I would like to get all the revisions of a CDOObject, is there a way to do that ?
> I try with the RevisionManager but i can only have the last or a specific version revision.
The CDORevisionManager returned by CDOSession.getRevisionManager() provides access to all revsions of all objects that
have ever been stored (and kept) in a repository. In CDOUtil there are several getRevisionByVersion() methods that
simplify access revisions of a particular CDOObject.


> Others posts on the newsgroup talk about CDOAudit but it seems that this class does not exist anymore.
All of its functionality has been moved into CDOView some time ago. Please try CDOView.setTimeStamp().

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


(no subject) [message #720441 is a reply to message #720304] Tue, 30 August 2011 14:19 Go to previous messageGo to next message
Nathalie Lepine is currently offline Nathalie LepineFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,

I am going to explain more precisely what i would like : for one
CDOObject, i want its commits history, for example if i have an object
"object1", the result can be:
Revision version | commit message | commit user ID
1 | object1 creation | user1
2 | object1 renaming | user2

With the CDORevisionManager, i have access to all the "last" revisions
of the objects (in my example the version 2 commit) but i do not find
the older versions (in my example the version 1 commit).

The method CDOUtil.getRevisionByVersion gets a revision for only one
version. Do i have to get all the versions and iterate on them to have
all the revision of my object or have you another solution ?

I also try CDOCommitInfoManager.getCommitInfos but i do not know how to
link the commit infos to a CDOObject.

Thanks
Nathalie.


Le 30/08/2011 12:44, Eike Stepper a écrit :
> Am 30.08.2011 12:07, schrieb Nathalie Lepine:
>> Hi,
>>
>> I would like to get all the revisions of a CDOObject, is there a way
>> to do that ?
>> I try with the RevisionManager but i can only have the last or a
>> specific version revision.
> The CDORevisionManager returned by CDOSession.getRevisionManager()
> provides access to all revsions of all objects that have ever been
> stored (and kept) in a repository. In CDOUtil there are several
> getRevisionByVersion() methods that simplify access revisions of a
> particular CDOObject.
>
>
>> Others posts on the newsgroup talk about CDOAudit but it seems that
>> this class does not exist anymore.
> All of its functionality has been moved into CDOView some time ago.
> Please try CDOView.setTimeStamp().
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
(no subject) [message #720496 is a reply to message #720441] Tue, 30 August 2011 17:43 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
Am 30.08.2011 16:19, schrieb Nathalie Lepine:
> Hi,
>
> I am going to explain more precisely what i would like : for one CDOObject, i want its commits history, for example if
> i have an object "object1", the result can be:
> Revision version | commit message | commit user ID
> 1 | object1 creation | user1
> 2 | object1 renaming | user2
>
> With the CDORevisionManager, i have access to all the "last" revisions of the objects (in my example the version 2
> commit) but i do not find the older versions (in my example the version 1 commit).
I must be misunderstanding something. Why do you think that, with the methods I suggested, you can not retrieve "older"
revisions of an object? Perhaps you've not configured your repository for auditing so that these old revisions are not
kept at all? Please see http://wiki.eclipse.org/CDO/Server_Configuration_Reference#Property_supportingAudits in this case.

Please also note that you can not use CDORevisions like EObjects. While some data types (String, primitives, some more)
are treated in the same way, others are not and would need special conversion by you. All references are a good example,
as the CDORevision does only deliver the CDOID of the target objects and you'd have to use the revision manager to
retrieve the target revisions manually. Whenever you expect EMF standard behviour for objects it's best to use a CDOView
to automatically construct the object graph of a particular time in a particular branch.

>
> The method CDOUtil.getRevisionByVersion gets a revision for only one version. Do i have to get all the versions and
> iterate on them to have all the revision of my object or have you another solution ?
>
> I also try CDOCommitInfoManager.getCommitInfos but i do not know how to link the commit infos to a CDOObject.
CommitInfos represent the changes to objects that were contained in particular commits, expressed in CDORevisions for
added objects, CDORevisionDeltas for changed objects and CDOIDs for deleted objects. A repository supporting audits is a
precondition, of course. If you want to reconstruct the EObjects from that (commit) time and branch you'd open an audit
CDOView, e.g., CDOSession.openView(commitInfo).

Does that help?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
> Thanks
> Nathalie.
>
>
> Le 30/08/2011 12:44, Eike Stepper a écrit :
>> Am 30.08.2011 12:07, schrieb Nathalie Lepine:
>>> Hi,
>>>
>>> I would like to get all the revisions of a CDOObject, is there a way
>>> to do that ?
>>> I try with the RevisionManager but i can only have the last or a
>>> specific version revision.
>> The CDORevisionManager returned by CDOSession.getRevisionManager()
>> provides access to all revsions of all objects that have ever been
>> stored (and kept) in a repository. In CDOUtil there are several
>> getRevisionByVersion() methods that simplify access revisions of a
>> particular CDOObject.
>>
>>
>>> Others posts on the newsgroup talk about CDOAudit but it seems that
>>> this class does not exist anymore.
>> All of its functionality has been moved into CDOView some time ago.
>> Please try CDOView.setTimeStamp().
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>


Previous Topic:[emf] cannot control type of id attribute in ecore model
Next Topic:[CDO] Multiple version edition & Parents version
Goto Forum:
  


Current Time: Thu Sep 19 13:33:29 GMT 2024

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

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

Back to the top