2 Replies Latest reply on Jan 28, 2014 3:40 AM by mkuzela

    Is there some particular reason why two shareable nodes cannot exist under same parent?

    mkuzela

      Hello

      I would like to have 2 shared nodes under same parent like:

      /parent/node1

      /parent/node2

       

      where node2 is shareable copy of node1.

       

      But when I try to do it with:

       

      workspace.clone(workspace.getName(), "/parent/node1", "/parent/node2", false);

       

      I receive:

      javax.jcr.UnsupportedRepositoryOperationException: Unable to share '/parent/node2' at '/parent/node1' since it has already been shared at '/{}parent'

        at org.modeshape.jcr.JcrWorkspace.internalClone(JcrWorkspace.java:408)

        at org.modeshape.jcr.JcrWorkspace.clone(JcrWorkspace.java:306)

       

      and I see code checking for it in org.modeshape.jcr.JcrWorkspace class like:

       

                      if (destParent.isSameAs(srcPath.getParent())) {

                          String msg = JcrI18n.unableToShareNodeWithinSameParent.text(srcAbsPath, destAbsPath, destParent);

                          throw new UnsupportedRepositoryOperationException(msg);

                      }

       

      My question is, is this only Modeshape (3.6.0) restriction or there is some JCR specificatin restriction?

       

      thanks

      Martin