jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Buchmann <da...@liip.ch>
Subject Re: Trying to understand and use version cascade
Date Tue, 07 May 2013 13:46:07 GMT
hi lars,

jukka also helped on this one:

this is basically specified in
http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.13.9%20Versionable%20State

* copy: always copy the children until hit ignore
* version: same as copy except when a child is versionable it is skipped

checkins are never cascaded. every versionable node has to be checked in
separately. if we have copy or version with not themselves versionable
children, you should get one frozen node with child nodes.

does that help?

cheers,david


Am 28.02.2013 16:55, schrieb Lars Janssen:
> Hi all,
> 
> I'm new to the list, but did have a good look through the archives. :)
> 
> My problem: I have nodes representing pages and blocks (of content) in a
> CMS. Pages can contain pages or blocks. I'm looking to add page versioning
> capability, such that if I create a checkpoint (version) on a page, the
> same is done for all child blocks (although to keep this simple, I'm
> initially just trying to let it happen for all children).
> 
> I'm using Jackrabbit 2.4.3 and PHP Content
> Repository[1]/Jackalope-Jackrabbit[2] to connect my PHP application to it.
> 
> Here's the CND for the node type I'm using:
> 
>     [phpcr:versionCascade] > nt:unstructured
>         + * multiple copy
> 
> The nt:unstructured type I'm inheriting from comes from part of the PHPCR
> project, I believe it uses this:
> 
>     [nt:unstructured]
>       ORDERABLE
>       - * (UNDEFINED) MULTIPLE
>       - * (UNDEFINED)
>       + * (nt:base) = nt:unstructured SNS VERSION
> 
> If you don't mind looking at some PHP code, you can see what I'm trying to
> do in my Github tests pull request[3][4] otherwise, here are the steps in
> mostly pseudo-code:
> 
>     create parent/child nodes:
>          /tests_version_base/versioned    (with property foo = something)
>          /tests_version_base/versioned/version_child    (with property
> foo_c = something_c)
>     checkpoint('/tests_version_base/versioned')
>     node->setProperty('foo', 'bar')
>     childNode->setProperty('foo_c', 'bar_c')
>     session->save()
>     checkin('/tests_version_base/versioned')
> 
> What I'm hoping to see at this point is that both the nodes (parent and
> child) have a corresponding frozen node, even though I only did a
> checkpoint on the parent. What I actually see is a frozen node for the
> parent (as expected) but not for the child.
> 
> I suspect my understanding of how this works is not right. Should child
> nodes automatically be versioned like this, or is there another way to get
> something like this behaviour?
> 
> Thanks,
> 
> Lars.
> 
> References:
> [1] https://github.com/phpcr/phpcr
> [2] https://github.com/jackalope/jackalope-jackrabbit
> [3]
> https://github.com/fazy/phpcr-api-tests/blob/c7cd60c7bfaf9bdb2211e8c8676344a58fa38a9b/tests/15_Versioning/VersionTest.php#L20
> [4]
> https://github.com/fazy/phpcr-api-tests/blob/c7cd60c7bfaf9bdb2211e8c8676344a58fa38a9b/tests/15_Versioning/VersionTest.php#L91
> 

-- 
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch

Mime
View raw message