ModeShape
  1. ModeShape
  2. MODE-1417

REST client utility is not making 'nt:file' nodes versionable

    Details

    • Similar Issues:
      Show 10 results 

      Description

      When the JsonRestClient.publish(...) method is called with a true value for "versionable", the JsonRestClient method creates a FileNode object that only sets the 'jcr:mixinTypes' property to 'mix:versionable' _on the "jcr:content" child node. It needs to instead make the 'nt:file' node versionable instead, and have the "jcr:content" child node be versioned via the (default) OPV value of COPY.

      Basically, lines 117-119 need to move after line 103.

        Activity

        Hide
        Akram Ben Aissi
        added a comment -

        Provided test case using commons http client.

        Show
        Akram Ben Aissi
        added a comment - Provided test case using commons http client.
        Hide
        Randall Hauch
        added a comment -

        The REST client library was versioning only the 'jcr:content' child node of an 'nt:file' node. While that's acceptable (since it's where the file's content is actually stored), it's better if the 'nt:file' node itself was versioned.

        This change simply changes the node where the 'mix:versionable' mixin is applied. When a new 'nt:file' node is uploaded, that node is now made versionable instead of the 'jcr:content' child. All existing content is still handled and versioned correctly (as it was), and this change only affects content added using a RESTful client that contains the fix.

        This change only affects the RESTful client, which is never used within the server-side installation of ModeShape.

        All unit and integration tests pass with these changes.

        Show
        Randall Hauch
        added a comment - The REST client library was versioning only the 'jcr:content' child node of an 'nt:file' node. While that's acceptable (since it's where the file's content is actually stored), it's better if the 'nt:file' node itself was versioned. This change simply changes the node where the 'mix:versionable' mixin is applied. When a new 'nt:file' node is uploaded, that node is now made versionable instead of the 'jcr:content' child. All existing content is still handled and versioned correctly (as it was), and this change only affects content added using a RESTful client that contains the fix. This change only affects the RESTful client, which is never used within the server-side installation of ModeShape. All unit and integration tests pass with these changes.
        Hide
        Randall Hauch
        added a comment -

        Merged onto the '2.x' branch and cherry-picked onto the 'master' and '2.8.x' branches.

        Show
        Randall Hauch
        added a comment - Merged onto the '2.x' branch and cherry-picked onto the 'master' and '2.8.x' branches.

          People

          • Assignee:
            Randall Hauch
            Reporter:
            Randall Hauch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: