jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tobias.bocane...@day.com>
Subject Re: For restoring a node, a IGNOREed child node throws ConstrainViolationException
Date Mon, 23 Jan 2006 09:35:44 GMT
hi roland,
thanks for finding this. i created a jira issue for this bug:
http://issues.apache.org/jira/browse/JCR-308

regards, toby

On 1/22/06, Roland Kofler <roland.kofler@systemone.at> wrote:
> A version IGNORED child node should remain in the node tree if you
> revert to a previous version. This is stated in the subchapter 8.2.11.5
> of JCR170.
> I've found that jackrabbit removes the IGNORED child node after a
> revert, wich is wrong.
>
>
> Neverthenless I have to say: You are great!
> Roland
>
>
> doing this:
>
>  public void revertToVersion(Node jcrNode, NodeHolder nodeHolder) {
>        try {
>            jcrNode.restore((Version)
> (nodeHolder.getJcrNode().getParent()), false);
>        } catch (RepositoryException e) {
>            throw new IllegalStateException(e);
>        }
>    }
>
> on that:
>
>  <!-- PAGE -->
>    <!-- page definition -->
>    <nodeType hasOrderableChildNodes="true" isMixin="false"
> name="s1NT:page" primaryItemName="">
>        <supertypes>
>            <supertype>nt:base</supertype>
>            <supertype>mix:referenceable</supertype>
>            <supertype>mix:versionable</supertype>
>            <supertype>mix:lockable</supertype>
>        </supertypes>
>        ...
>    <!-- similarity results root child node -->
>        <childNodeDefinition autoCreated="true"
> defaultPrimaryType="s1NT:similarityRoot" mandatory="true"
>                             name="s1:similarityRoot"
> onParentVersion="IGNORE" protected="false" sameNameSiblings="false">
>        </childNodeDefinition>
>    </nodeType>
> ...
>
> leads to:
>
> java.lang.IllegalStateException:
> javax.jcr.nodetype.ConstraintViolationException: /s1:pages/s1:page:
> mandatory child node {http://www.systemone.at/jcr}similarityRoot does
> not exist
>  ...
>    at
> org.apache.jackrabbit.core.ItemImpl.validateTransientItems(ItemImpl.java:557)
>    at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1131)
>    at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:758)
>    at
> org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3502)
>    at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:2848)
>    at
> at.systemone.wiki.node.PageNodeWorker.revertToVersion(PageNodeWorker.java:21)
>    ... 18 more
>
>
>
>
>
>
>
>
>
>


--
-----------------------------------------< 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 >---

Mime
View raw message