Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
minLevel2
absoluteUrltrue
excludeSee Also
typeflat
printablefalse
separatorpipe

...

If a Cloud instance is used for the remote instance then you will need to configure an API token in the user account Atlassian administration. Make sure the API token needed for the user password field is requested by the user who will appear to publish the articles.

Local setup

For remote publishing to work, the server hosting the local Confluence instance must be able to access the remote instance. These steps should be performed on the local instance where the content is initially created.

...

The example markup above is based on the example from same-space publishing, but we've added the trigger at the bottom to include a process to remove page content from the remote instance using the remoteremove-page macro.

Code Block
{trigger:statechanged|state=Remove}
        {remoteremove-page:remote}
{trigger}
Info

The example workflow below does not include a transition to the Remove state.

With no configured transition to the Remove state from another state in the workflow, the ability to transition to the Remove state is limited to users with administrator permission who can use the administrator state override option to transition the page to the Remove state from any other state in the workflow.

The workflow is also configured to hide this Remove state from the workflow popup progress tracker when the page or blog post is in any other state in the workflow.

Here’s the complete workflow markup for this example :including a remote publishing process for blog posts using the newsstatechanged event

Code Block
languagetext
{workflow:name=Remote Publishing Workflow|key=dm.remotepublishing}
    {description}
        This workflow allows one-way synchronization of a remote confluence instance. Please visit the [workflow's page|https://wiki.comalatech.com/display/CDML/Remote-space+publishing] for instructions on how to set up the _private_ and _remote_ instances.
    {description}
    {state:Draft|submit=For Review}
    {state}
    {state:For Review|approved=Published|rejected=Draft}
        {approval:Publish}
    {state}
    {state:Published|updated=For Review}
    {state}
    {state:Remove|hidefrompath=true|hideselection=true}
    {state}
    {state:Newsarchived|submit=Draft|hidefrompath=true|hideselection=true}
    {state}
    {trigger:statechanged|state=Published}
        {set-message:type=note}Page publishing pending...{set-message}
    {trigger}
    {trigger:statechanged|state=For Review}
        {set-message}{set-message}
    {trigger}
    {trigger:statechanged|state=Published|queue=true|newevent=pagepublished}
        {remotepublish-page:remote}
    {trigger}
    {trigger:newsstatechanged|state=Published}
        {set-message:type=note}Page publishing pending...{set-message}
    {trigger}
    {trigger:newsstatechanged|state=For Review}
        {set-message}{set-message}
    {trigger}
    {trigger:newsstatechanged|state=Published|queue=true|newevent=pagepublished}
        {remotepublish-page:remote}
    {trigger}
    {trigger:newsstatechanged|state=ArchivedNewsarchived|queue=true|newevent=pagepublished}
        {remotepublish-page:remote2}
    {trigger}
    {trigger:pagepublished|success=true}
        {set-message:style=info}PageDocument Published to remote instance!{set-message}
    {trigger}
    {trigger:pagepublished|success=false}
        {set-state:For Review}
        {set-message:user=@user@|style=warning}Publishing to the remote instance failed @errormessage@{set-message}
    {trigger}
    {trigger:statechanged|state=Remove}
        {remoteremove-page:remote}
    {trigger}
    {trigger:newsstatechanged|state=Newsarchived}
{workflow}

        {remoteremove-page:remote}
    {trigger}
{workflow}

The workflow triggers publishing content to a remote instance are separate triggers for

  • pages using the statechanged event

  • blog posts using the newsstatechanged event

These triggers also generate a custom event pagepublished that is used to generate message notifications.

The final=true parameter for a workflow state is not necessary for remote space publishing action, all the work is done by the remotepublish-page macro added as a workflow trigger action macro

...