You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by VitalyL <Vi...@gmail.com> on 2011/11/30 13:49:00 UTC

Copy versionable node to a standard one (non-versionable)

Hi Jackrabbit Community.

Recently I've upgraded environment to 2.2.9 version (from 1.6.1) and faced
with a following problem.
In some use cases the versionable node is copied to a standard one (without
"versionable" mixin).

It was realized by copying the versionable node and removing mixin then.

/workspace.copy(path, destPath);
...
copy.removeMixin(JcrConstants.MIX_VERSIONABLE);/

With 2.2.9 it throws javax.jcr.nodetype.ConstraintViolationException: no
matching property definition found for
{http://www.jcp.org/jcr/1.0}isCheckedOut

So, the main question: how to create a copy without any version information?



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Copy-versionable-node-to-a-standard-one-non-versionable-tp4122850p4122850.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Copy versionable node to a standard one (non-versionable)

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 30.11.11 13:49, "VitalyL" <Vi...@gmail.com> wrote:
>/workspace.copy(path, destPath);
>...
>copy.removeMixin(JcrConstants.MIX_VERSIONABLE);/
>
>With 2.2.9 it throws javax.jcr.nodetype.ConstraintViolationException: no
>matching property definition found for
>{http://www.jcp.org/jcr/1.0}isCheckedOut
>
>So, the main question: how to create a copy without any version
>information?

I don't know if that is bug (i.e. I think removeMixin should probably
remove it's properties such as jcr:isCheckedOut automatically, but I am
not sure).

As a workaround you can copy the node and properties "manually" (ie.
getProperty + setProperty) and excluding the versioning properties
altogether (and not setting the mix:versionable on the target node).

Cheers,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel