Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-323

Provide a standard ImportEndpoint for bootstrapping content

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.2.10, 3.0.0
    • None
    • services
    • Yes
    • Cloud Service 16, Cloud Service 17, SaaS 18, SaaS 19, SaaS 21
    • 8

      As of M6.2.11, bootstrapping test fixtures (and light-module fixtures) for integration-tests goes through the testcommands endpoint.

      This forces us to build separate runtime images of the product in order to use the test-framework and these facilities. Instead, we're looking towards running tests on vanilla product images. Therefore we aim to support bootstrapping content via REST, in the product itself.

      Proposed flow

      A dedicated ImportEndpoint at /.rest/import/v1, accepting multipart/form-data— suitable for uploading files as attachments (parts)—and a target path query-parameter.
      Target workspace is conventionally inferred from the uploaded bootstrap-file name, e.g. contacts.some-folder.mmonroe.xml.

      • The invoked command is still the standard JcrImportCommand (src); it accepts a "stream" parameter.
      • MgnlCommand#execute takes care of overlaying command parameters onto the command itself via BeanUtils, hence setting the "stream" param here.

      The endpoint is expected to answer with No Content (204) if successful.

      Current flow this replaces

      The testcommands endpoint is a forked implementation of the standard rest-services CommandEndpoint.

      Bootstrap files (actual test files) are base64 encoded by the test-framework. Then the test CommandEndpoint parses query parameters, searches for one named "input", decodes it back as a plain String, and pushes the base64-decoded result as a "stream" entry into the command parameter map.

        Acceptance criteria

              mgeljic Mikaël Geljić
              mgeljic Mikaël Geljić
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: