Workflow Triggers

Publish Trigger

Overview

This trigger publishes or unpublishes the current asset in workflow (if publishable) to all enabled Destinations available to the user authorizing the publish.

When using the Publish trigger, the system differentiates between Transition steps and System steps. System steps that call the Publish trigger will authorize the publish as the system user (which operates as an administrator-level user), whereas Transition steps consider the Site Role and permissions of the current user who has ownership of the step.

Note - When adding the Version Trigger, Merge Trigger, and any publish trigger, they must execute in this order to properly perform all these actions in the database.

Declaration


<trigger class="com.cms.workflow.function.Publisher" name="Publish"/>

Usage


<trigger name="Publish"/>

Parameters

The following parameters can be used within the invocation of the Publish Trigger to change the behavior in which the asset is (un)published.

Destination

By default, the system will publish to all applicable Destinations. You can publish to specific Destination(s) by using the destination parameter.


<parameter>  
  <name>destination</name>  
  <value>/path/to/destination</value>  
</parameter>

To use the parameter, simply replace /path/to/destination with the full path to the Destination in the Manage Site area of your Site.

For example, if your Destination is in the root Destination Container and named WWW Production, you would replace /path/to/destination with WWW Production. If WWW Production happens to be within a Container named Primary, you would replace /path/to/destination with Primary/WWW Production.

Note - the path to the Destination is case sensitive.

You can specify multiple destinations by putting in multiple parameter nodes, each containing a name and value tag, such as:


<parameter>  
  <name>destination</name>  
  <value>/path/to/destination</value>  
</parameter>
<parameter>  
  <name>destination</name>  
  <value>/path/to/another/destination</value>  
</parameter>

Publish Working Copy

It is also possible to publish the working copy of a page in workflow for staging purposes. This can be accomplished by adding a publish-working-copy parameter to the invocation of the Publish Trigger in a Workflow Definition with a value of true. By default (without this parameter) only the non-working copy version of the asset in workflow is published.


<parameter>  
  <name>publish-working-copy</name>  
  <value>true</value>  
</parameter>

Unpublish

If the asset is meant to be unpublished, the unpublish parameter can be used, which accepts boolean values true or false (default).

This parameter works together with other parameters in this trigger so that it is possible to unpublish an asset using a given authorizing user, to unpublish a working copy, and to unpublish only from specified Destinations. This trigger can be useful when moving or renaming an asset through Workflow.


<parameter>  
  <name>unpublish</name>  
  <value>true</value>  
</parameter>

Authorizing Type

The authorizing-type parameter is used to specify which user is "authorizing" the publish in this step. This will affect permissions/roles checks performed during publish and also to whom the publish report is delivered to.

Authorizing-type can take the following values:

  • current-step-owner - the user assigned to the step that calls the trigger
  • system - the reserved "system" user, which can be used to bypass all permission and role ability checks and results in the publish report not being sent to anyone.
  • user - a specified user

<parameter>  
  <name>authorizing-type</name>  
  <value>user</value>  
</parameter>

Authorizing User

The authorizing-user parameter is used in conjunction with the user authorizing-type. This parameter's value should be any valid username in the system.


<parameter>  
  <name>authorizing-user</name>  
  <value>johndoe</value>  
</parameter>
Note - the username value is case sensitive.

The publish-related-assets parameter can be used to ensure that the asset's publishable relationships are also published.


<parameter>  
  <name>publish-related-assets</name>  
  <value>true</value>  
</parameter>

The publish-related-publishset parameter can be used to ensure that the page's Content Type Publish Set is also published.


<parameter>  
  <name>publish-related-publishset</name>  
  <value>true</value>  
</parameter>