Publishing a snapshot using a Comala workflow trigger
Snapshot Publishing can be used as a standalone feature of the Comala Publishing app to create a snapshot of a document but a snapshot of a Confluence document can also be created using a workflow trigger in a workflow applied to the document.
The workflow trigger can be configured to listen for an applied workflow event, such as a change of workflow state, an approval or content expiry and create a snapshot and add the snapshot document to a named collection using the snapshot-page macro
When Comala Publishing is installed together with Comala Document Management, you can also use a workflow trigger to create a snapshot and add the snapshot document as a PDF attachment to the current page using the pdf-export macro.
There are three steps to setting up snapshot publishing to take place on a Comala workflow event: Install Comala Publishing to your instance and enable snapshot publishing for a space Set up snapshot publishing in your space tools snapshot publishing dashboard Update your workflow to trigger the snapshot publishing process and apply to your documents (see below) A snapshot can be published using the snapshot-page macro to create a snapshot that is added to a specified snapshot collection the pdf-export macro to create a snapshot that is added to the page as an attachment Both action macros can be used in the same trigger. The publishing is triggered by an action macro, snapshot-page, which must be used in a trigger. The example markup above based on the example from same-space publishing, but we've added the trigger at the bottom. When the state changes to Published, the trigger is activated and the the collection parameter value is required to add the snapshot to a named collection the editor parameter value is the user who is set as the creator of the snapshot document In the example above the value for the collection parameter must be the name of a snapshot collection that has been linked to or created in the space by the space administrator the value for the editor parameter is a metadata value set in the workflow trigger prior to the snapshot-page macro action The user who is added as the value for editor parameter must have be added as a collection contributor to the collection permissions by the collection owner/creator. For snapshot publishing all the work is done by the snapshot-page macro. The snapshot-page macro can be used to publish the content from any state using an appropriate trigger event. With Comala Publishing installed, the pdf-export macro can be used as an action to export a snapshot of page or blog post in PDF format and adds the pdf to the page as an attachment. The pdf is added with a filename in the following format: <confluence_filename>_<document_version>_<date_pdf_file_created>_<time_pdf_created>.pdf There are no macro parameters to configure. The pdf-export macro can also be used with Scroll PDF Exporter 4.10.11 or higher.Activating snapshot publishing
Publishing a snapshot using a workflow trigger
Snapshot-page action trigger workflow markup
{workflow:name=Snapshot Publishing}
{state:Editing|submit=Review}
{state}
{state:Review|approved=Published|rejected=Editing}
{approval:Review|assignable=true}
{state}
{state:Published|final=true|updated=Editing}
{state}
{trigger:statechanged|state=Published}
{set-metadata:lastapprover}
@user@
{set-metadata}
{snapshot-page:collection=mycollection|editor=@lastapprover@}
{trigger}
{workflow}
snapshot-page
macro instructs the Comala Publishing app to create a snapshot document from the Confluence document.pdf-export action trigger workflow markup
{trigger:statechanged|state=Published}
{pdf-export}
{trigger}
Macros
The following macros are available in the Comala Document Management app.