You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Tobias Bocanegra <to...@day.com> on 2006/02/01 08:28:27 UTC

Re: Version references

hi martin,
this is one speciality about the version storage - the references
'into the normal space' do not work. otherwise you would never be able
to delete any node, that has a versioned reference pointing on it,
since you can't modify a version.

the other way around, it should work (eg: the jcr:baseVersion property).

regards, toby

On 1/31/06, Martin Perez <mp...@gmail.com> wrote:
> Hello.
>
> I have a node A that have many property references R1 on N1,R2 on N2,R3 on
> N3,....
>
> When A is deleted, I get the references using A.getReferences() and I change
> those reference values to a default value so R1 = D, R2 = D, R3 = D, ...
>
> The problem is that the method getReferences() does not returns references
> that come from version nodes. So now, I'm getting several
> ItemNotFoundExceptions.
>
> How could I remove those references? Do I have to search the references
> manually? And in that case, how can I search only on the version storage?
>
> Thanks!
>
> Martin
>
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Version references

Posted by Martin Perez <mp...@gmail.com>.
Well, I really want to track versions of that property, because I want to
show that history it to the user. So I suppose that using Itnore on OPV
should not help me much, unless I'm missing something :-)

Martin

On 2/1/06, Tobias Bocanegra <to...@day.com> wrote:
>
> yes, using VersionHistory.removeVersion().
>
> but why do you search in the versions? or can't you just set your
> reference property OPV=ignore ?
>
> regards, toby
>
> On 2/1/06, Martin Perez <mp...@gmail.com> wrote:
> > Marcel, thanks for the explanation. I was a little lost :(    So, I can
> > easily the version references, but...
> >
> > Tobias, but I'm getting ItemNotFoundExceptions because the version
> > properties are referencing to a delete node. If you said me that I can't
> > modify versions, I don't know how to solve this problem.... Can at least
> the
> > versions be deleted? What are the suggested approach?
> >
> >
> > Martin
> >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>

Re: Version references

Posted by Tobias Bocanegra <to...@day.com>.
yes, using VersionHistory.removeVersion().

but why do you search in the versions? or can't you just set your
reference property OPV=ignore ?

regards, toby

On 2/1/06, Martin Perez <mp...@gmail.com> wrote:
> Marcel, thanks for the explanation. I was a little lost :(    So, I can
> easily the version references, but...
>
> Tobias, but I'm getting ItemNotFoundExceptions because the version
> properties are referencing to a delete node. If you said me that I can't
> modify versions, I don't know how to solve this problem.... Can at least the
> versions be deleted? What are the suggested approach?
>
>
> Martin
>
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Version references

Posted by Martin Perez <mp...@gmail.com>.
Marcel, thanks for the explanation. I was a little lost :(    So, I can
easily the version references, but...

Tobias, but I'm getting ItemNotFoundExceptions because the version
properties are referencing to a delete node. If you said me that I can't
modify versions, I don't know how to solve this problem.... Can at least the
versions be deleted? What are the suggested approach?


Martin

Re: Version references

Posted by Tobias Bocanegra <to...@day.com>.
i don't understand...

if you have a reference property R1 that points to a node N1 and you
check-in the node of that property, it is copied to the version
storage, let's name it R1.1

calling N1.getReferences() only returns the R1 but not R1.1. you can't
modify the R1.1 anyways, so you don't need to alter it before deleting
N1.

regards, toby

On 2/1/06, Martin Perez <mp...@gmail.com> wrote:
> Sorry,
>
> Do you mean that I have to search on the version storage?
>
> Do you have a sample query. I'm a little lost since the last changes index
> changes. I know to look on "normal" storage we should use /jcr:root but what
> about looking on the version storage?
>
> Martin
>
> On 2/1/06, Tobias Bocanegra <to...@day.com> wrote:
> >
> > hi martin,
> > this is one speciality about the version storage - the references
> > 'into the normal space' do not work. otherwise you would never be able
> > to delete any node, that has a versioned reference pointing on it,
> > since you can't modify a version.
> >
> > the other way around, it should work (eg: the jcr:baseVersion property).
> >
> > regards, toby
> >
> > On 1/31/06, Martin Perez <mp...@gmail.com> wrote:
> > > Hello.
> > >
> > > I have a node A that have many property references R1 on N1,R2 on N2,R3
> > on
> > > N3,....
> > >
> > > When A is deleted, I get the references using A.getReferences() and I
> > change
> > > those reference values to a default value so R1 = D, R2 = D, R3 = D, ...
> > >
> > > The problem is that the method getReferences() does not returns
> > references
> > > that come from version nodes. So now, I'm getting several
> > > ItemNotFoundExceptions.
> > >
> > > How could I remove those references? Do I have to search the references
> > > manually? And in that case, how can I search only on the version
> > storage?
> > >
> > > Thanks!
> > >
> > > Martin
> > >
> > >
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Version references

Posted by Marcel Reutegger <ma...@gmx.net>.
Martin Perez wrote:
> Do you mean that I have to search on the version storage?
> 
> Do you have a sample query. I'm a little lost since the last changes index
> changes. I know to look on "normal" storage we should use /jcr:root but what
> about looking on the version storage?

introducing a separate index for the version storage ([1]) shouldn't 
have any impact on how you query for nodes. at least that was my 
intention. please report a jira issue if you think query behaviour 
changed since that change.

/jcr:root represents the root node of your workspace and is also an 
ancestor of the version storage. so, if you have a query like this:

/jcr:root//*[jcr:contains(.,'foo')]

it will also return version nodes if there are matches.

if you want to limit your query to the version storage your query would 
begin with /jcr:root/jcr:system/jcr:versionStorage

regards
  marcel


[1] http://issues.apache.org/jira/browse/JCR-257

Re: Version references

Posted by Martin Perez <mp...@gmail.com>.
Sorry,

Do you mean that I have to search on the version storage?

Do you have a sample query. I'm a little lost since the last changes index
changes. I know to look on "normal" storage we should use /jcr:root but what
about looking on the version storage?

Martin

On 2/1/06, Tobias Bocanegra <to...@day.com> wrote:
>
> hi martin,
> this is one speciality about the version storage - the references
> 'into the normal space' do not work. otherwise you would never be able
> to delete any node, that has a versioned reference pointing on it,
> since you can't modify a version.
>
> the other way around, it should work (eg: the jcr:baseVersion property).
>
> regards, toby
>
> On 1/31/06, Martin Perez <mp...@gmail.com> wrote:
> > Hello.
> >
> > I have a node A that have many property references R1 on N1,R2 on N2,R3
> on
> > N3,....
> >
> > When A is deleted, I get the references using A.getReferences() and I
> change
> > those reference values to a default value so R1 = D, R2 = D, R3 = D, ...
> >
> > The problem is that the method getReferences() does not returns
> references
> > that come from version nodes. So now, I'm getting several
> > ItemNotFoundExceptions.
> >
> > How could I remove those references? Do I have to search the references
> > manually? And in that case, how can I search only on the version
> storage?
> >
> > Thanks!
> >
> > Martin
> >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>