You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Nicolas Brasseur <ni...@yahoo.com> on 2009/10/05 18:11:44 UTC

node versionning and children

Hi there,

I am pretty new to JCR / JackRabbit but here is my question : when making changes to a versionable node is it possible that a new version is only created when changing a property and not when adding new children. I mean does calling addNode() on a versionable node always require a checkout / checkin ?

thanks for the explanation

Nicolas



      

Re: Fw: node versionning and children

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Oct 6, 2009 at 14:19, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Does adding mix:versionable mixin force you to always checkin/checkout a node
> to modify it (and thus create a new version) or is it possible to modify such node
> without creating a new version ?

A new version is only created upon checkin(). checkout() is necessary
to edit a versionable node, ie. it will give you the "head" or current
version that is modifiable like any other node.

Between checkin() (version created) and checkout() it is read-only.
Between checkout() and the next checkin() you can change anything you
want on the node, multiple changes, multiple save() calls, etc. Note
that you have to call save() before checkin() to persist the changes.

Since it is common to have the (current head version of the) node
always editable, upon "create version" you'd typically do a checkin()
followed by an immediate checkout().

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Fw: node versionning and children

Posted by Guo Du <mr...@gmail.com>.
On Tue, Oct 6, 2009 at 1:19 PM, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Ok, thanks for the answer. On last question:
>
> Does adding mix:versionable mixin force you to always checkin/checkout a node to modify it (and thus create a new version) or is it possible to modify such node without creating a new version ?
>
NO. But you may try out yourself.

-Guo

Fw: node versionning and children

Posted by Nicolas Brasseur <ni...@yahoo.com>.
Ok, thanks for the answer. On last question:

Does adding mix:versionable mixin force you to always checkin/checkout a node to modify it (and thus create a new version) or is it possible to modify such node without creating a new version ?

thanks again for your help

N.



----- Original Message ----
From: 
To: users@jackrabbit.apache.org; Nicolas Brasseur <ni...@yahoo.com>
Sent: Monday, October 5, 2009 11:46:20 PM
Subject: Re: node versionning and children

On Mon, Oct 5, 2009 at 23:05, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Thanks for the answer but it is still unclear to me,
>
> "A node is never automatically versioned ..." is it also true for nodes that have the mixin 'versionable' ? Is it possible to modify such a node without doing a checkout/checkin ?

You need to add the mix:versionable mixin to be able to call the
checkout/checkin methods, if you call it on a non-versionable node
you'll get an exception. There is no automatic versioning apart
calling checkin().

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com


      

Re: node versionning and children

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Oct 5, 2009 at 23:05, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Thanks for the answer but it is still unclear to me,
>
> "A node is never automatically versioned ..." is it also true for nodes that have the mixin 'versionable' ? Is it possible to modify such a node without doing a checkout/checkin ?

You need to add the mix:versionable mixin to be able to call the
checkout/checkin methods, if you call it on a non-versionable node
you'll get an exception. There is no automatic versioning apart
calling checkin().

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: node versionning and children

Posted by Nicolas Brasseur <ni...@yahoo.com>.
Thanks for the answer but it is still unclear to me,

"A node is never automatically versioned ..." is it also true for nodes that have the mixin 'versionable' ? Is it possible to modify such a node without doing a checkout/checkin ?

N.



----- Original Message ----
From: Alexander Klimetschek <ak...@day.com>
To: Nicolas Brasseur <ni...@yahoo.com>; users@jackrabbit.apache.org
Sent: Monday, October 5, 2009 10:06:57 PM
Subject: Re: node versionning and children

On Mon, Oct 5, 2009 at 21:18, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Ok, It seems that what you point refers more to : "is created a new version of the children when the parent is updated". My question was more : is it possible to have a versionable node only "versioned" when changing a property and not when adding a node ?

A node is never automatically versioned: to create a new version, the
application must call checkin. And a node must be checked-out to be
modified (= adding/removing child nodes or writing properties).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: node versionning and children

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Oct 5, 2009 at 21:18, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> Ok, It seems that what you point refers more to : "is created a new version of the children when the parent is updated". My question was more : is it possible to have a versionable node only "versioned" when changing a property and not when adding a node ?

A node is never automatically versioned: to create a new version, the
application must call checkin. And a node must be checked-out to be
modified (= adding/removing child nodes or writing properties).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: node versionning and children

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Oct 5, 2009 at 18:11, Nicolas Brasseur
<ni...@yahoo.com> wrote:
> I am pretty new to JCR / JackRabbit but here is my question : when making changes to a versionable node is it possible that a new version is only created when changing a property and not when adding new children. I mean does calling addNode() on a versionable node always require a checkout / checkin ?

This depends on the OnParentVersion attribute(s) of the node type
(section 8.2.11 of the jcr 1.0 spec [1]). Here is a nice article about
that [2].

[1] http://www.day.com/specs/jcr/1.0/
[2] http://jtoee.com/jsr-170/the_jcr_primer/5/

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com