Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-14558

Backport 14.6: Support REST endpoints for CM working with XPage Campaigns

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.6.0
    • None
    • None
    • 0.5
    • Quasar
    • Puma Sprint 258, Puma Sprint 259, Puma Sprint 260

    Description

      See https://docs.google.com/document/d/1BGThfhu-X2Ls_GaPr9CcRPOY2jxMybfN8YZyU373uv8

      Get versions

      At this moment, for fetching the versions of an XPage Document for a specific branch, the FE invokes

      http://localhost:8080/cms/ws/content/documents/{handleUUID}/{branchId}/versions
      

      returning something like:

      {
         "versions":[
            {
               "timestamp":"2020-10-09T08:00:00Z",
               "userName":"admin",
               "jcrUUID":"c50d38f0-bf78-4d2c-9716-109b27661d3b",
               "branchId":"master"
            },
            {
               "timestamp":"2021-04-01T09:27:15Z",
               "userName":"admin",
               "jcrUUID":"c5cafa86-a53d-4bd2-bd57-bbca6c84fb51",
               "branchId":"master"
            },
            {
               "timestamp":"2021-04-01T09:27:13Z",
               "userName":"admin",
               "jcrUUID":"ed4d3683-fb04-445d-a63a-0abb900585a6",
               "branchId":"master"
            }
         ],
         "restoreEnabled":true,
         "createEnabled":true
      }
      

      The backend will be adjusted to also return

      1. 'campaign' information for versions which have been marked as a campaign version
      2. an extra flag having 'campaignEnabled = true|false' indicating whether the FE should support the date fields. Initially, only when looking at 'core, campaignEnabled will be true

      In the above example, assume the second version is also a campaign, the response will become something like this for 'core':

      {
         "versions":[
            {
               "timestamp":"2020-10-09T08:00:00Z",
               "userName":"admin",
               "jcrUUID":"c50d38f0-bf78-4d2c-9716-109b27661d3b",
               "branchId":"master",
               "label":"Some Label"
            },
            {
               "timestamp":"2021-04-01T09:27:15Z",
               "userName":"admin",
               "jcrUUID":"c5cafa86-a53d-4bd2-bd57-bbca6c84fb51",
               "branchId":"master"
               "campaign": {
               	"from": "2021-04-01T10:20:00Z",
               	"to": "2021-08-01T10:20:15Z",
               },
               "label":"Some Other Label"
            },
            {
               "timestamp":"2021-04-01T09:27:13Z",
               "userName":"admin",
               "jcrUUID":"ed4d3683-fb04-445d-a63a-0abb900585a6",
               "branchId":"master"
            }
         ],
         "restoreEnabled":true,
         "createEnabled":true,
         "campaignEnabled":true
      }
      

      The times are stored in UTC time, and the UI will translate these to user specific times, just like it does already for the 'timestamp' field.

      Filtering versions

      The BE will support a new REST endpoint for getting only the versions for campaigns. This REST endpoint will be

      http://localhost:8080/cms/ws/content/documents/{handleUUID}/{branchId}/campaigns
      

      or if deemed more clear will be

      http://localhost:8080/cms/ws/content/documents/{handleUUID}/{branchId}/versions/campaigns
      

      The above endpoint will return the same output as the above versions endpoint only this time versions without campaign will be skipped
      Set and Remove Campaign Version

      For the FE, two new /cms/ws/content/documents endpoints will be added to support setting a version for a campaign date range and to remove a previously set campaign. Setting a campaign will be a PUT method as it is an idempotent update and does not create a new resource.

      For setting a campaign version with date range, the following newly added rest endpoint can be invoked with PUT:

      http://localhost:8080/cms/ws/content/workflows/documents/{handleId}/versions/{frozenNodeId}/campaign
      

      Containing the from and to date in the body in UTC time, eg

      {
      "from": "2021-04-01T10:20:00Z",
      "to": "2021-08-01T10:20:15Z",
      }
      

      Invoking the same PUT method multiple times returns the exact same result, regardless whether the frozenNodeId has already a campaign set with the same dates. Invoking it with different dates updates the campaign from-to fields

      For removing a campaign the REST endpoint

      http://localhost:8080/cms/ws/content/workflows/documents/{handleId}/versions/{frozenNodeId}/campaign
      

      can be used with method DELETE. Invoking it on a frozenNodeId which does not have a campaign returns the same result as doing it on a frozenNodeId for which a campaign is present.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: