enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Store publishing request info in an issue #7170

Closed alansemenov closed 5 years ago

alansemenov commented 5 years ago

We need to be able to distinguish between regular issues and publishing requests. There may be several states for a publishing request in a future, so I suggest using a string field for that.

We also need to store publish from/to dates for a publishing request (both are optional). As of now, they will be used to update publish from/to dates for all of the items inside the publishing request from UI, but later on we'll have a service which will use these fields to schedule publishing.

The funny thing is that we already store items array inside an object called publishRequest:

 "publishRequest": {
    "items": [
      {
        "itemId": "25e40e0d-2fe9-457b-8077-76b64173931c",
        "recursive": false
      },
      {
        "itemId": "6747a3cc-ff94-46e4-bf23-761d69e52704",
        "recursive": false
      }
    ]
  }

We could either add the new fields inside publishRequest and consider an issue to be a publishing request whenever there's publishRequest.state field.

 "publishRequest": {
    "state": "OPEN",
    "from": "2016-12-01T16:06:17.283Z",
    "to": "2016-12-08T16:06:17.283Z",
    "items": [
      {
        "itemId": "25e40e0d-2fe9-457b-8077-76b64173931c",
        "recursive": false
      },
      {
        "itemId": "6747a3cc-ff94-46e4-bf23-761d69e52704",
        "recursive": false
      }
    ]
  }

Or maybe we should break things down and move items out of publishRequest and consider an issue to be a publishing request when there's publishRequest object on an issue:

 "items": [
    {
      "itemId": "25e40e0d-2fe9-457b-8077-76b64173931c",
      "recursive": false
    },
    {
      "itemId": "6747a3cc-ff94-46e4-bf23-761d69e52704",
      "recursive": false
    }
 ],
 "publishRequest": {
    "state": "OPEN",
    "from": "2016-12-01T16:06:17.283Z",
    "to": "2016-12-08T16:06:17.283Z"
  }
GlennRicaud commented 5 years ago

Will be done in https://github.com/enonic/xp/issues/7183