Custom Document Lifecycle

The default document lifecycle consists of the in progress and published state, the corresponding offline states, and the deleted state.

Table of Contents

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 ([RELEASED]) 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 ([ICON_ON]), 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 mixin sophora-mix:prePublishRequired in the document type configuration. For documents having this mixin, the "Publish" button ([ICON_ON]) will now set the document to the pre-published state. Only users having the "finish pre-published documents" system permission can now move the document to the published state. This is done by publishing the document again.