4 Replies Latest reply on Apr 2, 2013 9:30 AM by Ivan Vasyliev

    Modeshape and mix:simpleVersionable

    Ivan Vasyliev Newbie

      The issue is found during apache chemistry integration test execution with CMIS server backed by modeshape.

       

      See [code on github|https://github.com/apache/chemistry-opencmis/tree/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit]

       

      Here is stacktrace from test execution:

       

      {code}

      org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: This operation requires that the node be versionable (that is, isNodeType("mix:versionable") == true)

      at org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractWebServicesService.convertException(AbstractWebServicesService.java:117)

      at org.apache.chemistry.opencmis.client.bindings.spi.webservices.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:86)

      at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:726)

      at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:88)

      at org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest.createDocument(AbstractSessionTest.java:368)

      at org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest.createDocument(AbstractSessionTest.java:335)

      {code}

       

      Below is the code from org.modeshape.jcr.AbstractJcrNode class:

       

      {code}

      public final JcrVersionNode getBaseVersion() throws RepositoryException {

      checkSession();

      // This can happen if the versionable type was added to the node, but it hasn't been saved yet

      if (!hasProperty(JcrLexicon.BASE_VERSION))

      { throw new UnsupportedRepositoryOperationException(JcrI18n.requiresVersionable.text()); }

      return (JcrVersionNode)session().getNodeByUUID(getProperty(JcrLexicon.BASE_VERSION).getString());

      }

      {code}

       

       

      It looks like condition is checking only full versioning type..

      I assume, in case of simple versioning there is no need for the 'baseVersion' property, because base version is the latest version of a node.

      JCR API 2.0, 3.13.2.3:

      The mixin mix:versionable is a subtype of mix:simpleVersionable and mix:referenceable, and adds properties exposing a number of additional versioning-related attributes.

       

      Is this a bug in modeshape or I'm missing something?