The default document lifecycle consists of the in progress and published state, the corresponding offline states, and the deleted state. This lifecycle can be extended using additional document states:
- publish at
- released
- pre-published
Document state "publish at"
This state is used when a document is set to be automatically published at a future date. See Scheduling Document State Transitions for more info.
Document state "released"
This document state can be used to support a review process. When an editor finishes work on a document, he can mark it as released. At this point, the changes made by the editor have not been published to the website yet. He can then assign the document to another editor, for example using a document proposal, who can then review and publish the document. There are separate document permissions for releasing and publishing documents.
There are two ways to use the released document state:
- After editing a document, select the "Release" button () in the toolbar.
- In the document type configuration, add the
sophora-mix:releasable
mixin to a document type. When a document having this mixin is published using the "Publish" button (), it will be released instead. Selecting the "Publish" button a second time will then publish the document, provided the user has the "Publish" document permission for this document type.
It is possible to hide the "Release" button from the DeskClient using the setting deskclient.document.release.buttonVisible
in the DeskClient configuration.
Document state "pre-published"
In some use-cases, resources outside of Sophora are linked to the lifecycle of a Sophora document. An example are video files which can be viewed in the website. In this scenario, a Sophora video document contains textual content, such as a headline or a description of the video, as well as a video id. The video file itself is stored in a separate system. When a Sophora video document is published, the associated video file must be published as well. This is usually handled by a stand-alone process that listens to Sophora events.
To avoid having the video document available in the website before the video file has been fully transferred to the website servers, the pre-publised state is used:
- A Sophora user publishes the Sophora video document. Instead of being set to the published state, the document is set to the pre-published state. In this state, it is not available in the website yet.
- The video transfer process receives the pre-publication event from the Sophora server. It then transfers the video file associated with the Sophora video document to the website.
- Once the transfer of the video file is finished, the transfer process publishes the Sophora video document. It is now moved to the published state and is available in the website.
To activate the pre-publication workflow for a document type, add the sophora-mix:prePublishRequired
mixin in the document type configuration. The pre-publication workflow is then required for all documents of this document type. However, if the pre-publication workflow is only required for a subset of documents of a specific type, it can be skipped by setting the sophora:isPrePublishRequired
property to false on specific documents (Sophora Server 5.6.0 or newer is required for this fine-grained control). For documents where the pre-publication step is required, the "Publish" button () will set the document to a pre-published state. Only users with the "finish pre-published documents" system permission can move the document to the published state by publishing the document again.