You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Robert Munteanu <ro...@apache.org> on 2016/04/14 14:44:45 UTC

API to get all revisions affecting a NodeDocument

Hi,

For a NodeDocument I'd like to know which revisions it is linked to  (
in order to infer the commits ).

I've looked at NodeDocument#getLastRev ( but not all documents have the
_lastRev field defined ). I've also tried to to use
DocumentNodeStore#getHeadRevision , but the revision I get doesn't work
with NodeDocument#getCommitRootPath .

Is there an API for retrieving the revisions that affect a
NodeDocument?

Thanks,

Robert

Re: API to get all revisions affecting a NodeDocument

Posted by Robert Munteanu <ro...@apache.org>.
On Mon, 2016-04-18 at 07:16 +0000, Marcel Reutegger wrote:
> Hi,
> 
> NodeDocument.getAllChanges() gives you an Iterable over
> all changes (including non-committed) on a document. If you
> are only interested in committed changes you have to filter
> them with a check on the same document isCommitted(rev)

I'll have a look, thanks. I initially missed it since I was looking at
public methods only and this one is package-private.

Robert



> 
> Regards
>  Marcel
> 
> On 14/04/16 14:44, "Robert Munteanu" wrote:
> 
> > 
> > Hi,
> > 
> > For a NodeDocument I'd like to know which revisions it is linked
> > to  (
> > in order to infer the commits ).
> > 
> > I've looked at NodeDocument#getLastRev ( but not all documents have
> > the
> > _lastRev field defined ). I've also tried to to use
> > DocumentNodeStore#getHeadRevision , but the revision I get doesn't
> > work
> > with NodeDocument#getCommitRootPath .
> > 
> > Is there an API for retrieving the revisions that affect a
> > NodeDocument?
> > 
> > Thanks,
> > 
> > Robert


Re: API to get all revisions affecting a NodeDocument

Posted by Marcel Reutegger <mr...@adobe.com>.
Hi,

NodeDocument.getAllChanges() gives you an Iterable over
all changes (including non-committed) on a document. If you
are only interested in committed changes you have to filter
them with a check on the same document isCommitted(rev)

Regards
 Marcel

On 14/04/16 14:44, "Robert Munteanu" wrote:

>Hi,
>
>For a NodeDocument I'd like to know which revisions it is linked to  (
>in order to infer the commits ).
>
>I've looked at NodeDocument#getLastRev ( but not all documents have the
>_lastRev field defined ). I've also tried to to use
>DocumentNodeStore#getHeadRevision , but the revision I get doesn't work
>with NodeDocument#getCommitRootPath .
>
>Is there an API for retrieving the revisions that affect a
>NodeDocument?
>
>Thanks,
>
>Robert