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

    Modeshape and mix:simpleVersionable

    vasilievip

      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?

        • 1. Re: Modeshape and mix:simpleVersionable
          rhauch

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

           

          ModeShape doesn't support simple versioning, as we make evident in the "Repository.OPTION_SIMPLE_VERSIONING_SUPPORTED" standard descriptor. If simple versioning is required by the CMIS adapter, perhaps it should check the capabilities of the repository. You could also log an enhancement request for ModeShape to support simple versioning.

          • 2. Re: Modeshape and mix:simpleVersionable
            vasilievip

            I'm actually not completely sure at the moment why they use simple instead of full versioning, but I think I can push the patch which will check options supported and use simple or full depending on capabilities of underlying JCR repo, and ask chemistry team to provide some feedback.

             

            My understanding is that simple is a subset of full versioniong, how can modeshape support full and not support simple?

            • 3. Re: Modeshape and mix:simpleVersionable
              rhauch

              Simple is not a subset of full-versioning because of how the version histories are represented. Full versioning was complicated enough that we didn't want to initially implement both. I have no idea how difficult it would be to add support for simple versioning. But as I said, log it as an enhancement request if it is needed by Chemistry.

              • 4. Re: Modeshape and mix:simpleVersionable
                vasilievip

                Randall Hauch wrote:

                 

                But as I said, log it as an enhancement request if it is needed by Chemistry.

                Let me see what I can get from apache chemistry team regarding jcr bridge and versioning: https://issues.apache.org/jira/browse/CMIS-618