Overview

Different-space publishing allows you to edit draft content in one space, and then publish it to another space on the same server.

The Comala Publishing app must be installed to enable different-space publishing.

Activating different-space publishing

There are two steps to setting up different-space publishing:

  1. Configure the Comala Publishing app to connect the draft and public spaces – see also: How Comala Publishing works
  2. Update your workflow to trigger the publishing process (see below)

Workflow markup

The publishing is triggered by an action macro, {publish-page}, which must be used in a {trigger}.

{workflow:name=Different-space 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}
      {publish-page}
   {trigger}
{workflow}

The example markup above is 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 {publish-page} macro instructs the Comala Publishing app to synchronize the published content with the other space.

For different-space publishing, all the work is done by the {publish-page} macro. The {publish-page} macro can be used to publish the content from any state using an appropriate trigger event.

In the example, we have simply chosen to publish the draft space Published state content when the workflow changes to this state. 

Publishing metadata

If using the {publish-page} macro in  Comala Document Management workflow trigger to publish content with the metadata updated or modified by a trigger, the {publish-page} macro and the metadata modification action must not be based on the same trigger event.

(warning) For example, a workflow including the following trigger will not publish the page with the updated metadata value.

{trigger:statechanged|state=Approved}
        {set-metadata:metadata.custom}2{set-metadata}
        {publish-page}
{trigger}

This trigger will publish the page content BUT

  • the page in the draft space will display a publishing state of UNSYNCED
  • the metadata value in the draft page will be updated to the value of "2"
  • the metadata value on the published page will not be updated

(info) For the metadata to be updated

  • the action of the {publish-page} macro and the metadata modification action need to be separated and to be based on different events
  • the metadata modification must be undertaken before the {publish-page} macro action

A simple way to achieve this is to set a trigger custom event using newevent.

{trigger:statechanged|state=Approved|newevent=publishing}
        {set-metadata:metadata.custom}2{set-metadata}
{trigger}
{trigger:publishing|success=true|queue=true}
        {publish-page}
{trigger}


The custom event publishing must include the trigger parameter queue=true. You can also include the success=true filter condition that checks if the trigger referencing the publishing event trigger is successful.

Macros

Examples

See also