Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
hiddentrue
nameRefined page card image
Image Added
Info

Importing workflows

Find out how to Import Workflows

Remote Publishing workflow

requires v3.0.2+

com.comalatech.workflow.repository.categories.label: Document Management|Sample

-Image Added

This workflow allows one-way synchronization of a remote confluence instance.

You must set up the private and remote instances - see Workflow and Remote Space.

Content that is published to a remote instance can be removed using the Remote Publishing app installed in the source instance used together with a workflow trigger

  • when content is transitioned to the Remove state in the workflow , the Remote Publishing app removes this content from the remote instance

Info

Publishing to another space in the same instance requires the Comala Publishing app. The Comala Publishing app can be used as a standalone publishing app or together with any Comala Document Management workflow (with a final state or a workflow trigger) to publish content to a different space in the same instance.

Remote Publishing Workflow Markup

Code Block
{workflow:name=Remote Publishing}
	{description}
	This workflow allows one-way synchronization of a remote confluence instance. Please visit the [workflow's page|https://wiki.comalatech.com/display/WORKFLOW/Remote+Publishing+Workflow] 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|final=true|updated=For Review}
    {state}
    {state:Remove|hidefrompath=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:pagepublished|success=true}
        {set-message:style=info}Page Published!{set-message}
    {trigger}
    {trigger:pagepublished|success=false}
        {set-state:For Review}
        {set-message:user=<at:var at:name="user" />|style=warning}publishing failed: <at:var at:name="errormessage" />{set-message}
    {trigger}
    {trigger:statechanged|state=Remove}
        {remoteremove-page:remote} 
    {trigger}
{workflow}

...

Note

 In later versions of Comala Document Management variable references using the syntax <at:var at:name="errormessage" /> can be replaced by simply using the variable name enclosed in the @ symbols, for example @errormessage@

Info

This workflow has no configured option for transition from another state in the workflow to the Remove state. The workflow can be transitioned to the Remove state by a user with administrator permission using the /wiki/spaces/AWPD/pages/6428167968 option.

The Remove state is only displayed in the workflow popup progress tracker bar when the content is in the Remove state.


Workflow and remote space

...

Anchor
remotespacesetup
remotespacesetup

Image Added

You must have set up

  • a remote public Confluence instance for publishing the approved content

...

  • a private Confluence instance for the content that will be published

...

Both Comala Document Management and Comala Remote Publishing must be installed in the private source instance.

...

Once remote publishing is set up and content published, content can be removed from the published instance

...

by transitioning the workflow on the in the private source instance space content to the Remove state

Setting up the remote instance

To setup the remote instance you are publishing to, you need to enable "Remote API" setting

...

in Administration > General Configuration > Feature Settings.

You also need to have a user that has access to the general space.

We recommend you set up a user on the remote instance that only has access to the spaces you are publishing to for security purposes. This will also help to prevent accidental overwrites of other spaces.

Setting up the source instance

To set up the remote instance credentials, you have to set the parameters in the source instance:

...

-Image Added

Info

The name of the Remote Configuration must match that of the workflow. In this case make sure you name it remote as this is the name used in the workflow. You can always change it and even have different configurations

Test the settings to make sure that the source instance can connect properly to the remote/public instance

...

.

-Image Added

Tip

One or more remote instance configurations can be added to each space. Publishing to each remote target instance can be configured using a workflow trigger and a remotepage-publish action for each remote publishing configuration name.

Publishing content

Content will now be published to the public instance when the page

...

transitions to the Published state.

Publishing requires connection and transmitting data to the other instance, and this could take some time.

...

As we want to minimize any chance of error or session expiration we queue the request by adding the queue=true parameter to each publishing trigger.

A pending message is shown when the page is submitted for publishing

...

.

...

Image Added

If a published page is

...

updated in the source space, the

...

workflow status is changed

...

to draft state. This does not affect the remote instance space page. In order to publish any updates to the remote instance space the page would have to be re-approved

...

.

Comala Remote Publishing does not add a publishing status breadcrumb to either the source instance space page or the remote instance space page. Management of the published page is based on the applied workflow state and the action of the workflow remote publishing trigger.

Publishing all pages in the Space

If you want all the existing pages in the space to be published remotely, then you need to set the state of all pages to the Published state.

...

You can do this through

...

the Initialize states feature available for each workflow in the space tools Document Management dashboard.

-Image Added

Depending on the size of the space, publishing the entire space

...

may take a few minutes.

Tip

...

Hierarchy of the source instance space pages is maintained in the published remote instance space but initial publishing action publishes pages to the root of the remote space. Once initial whole space is published, reorder the remote space pages and if necessary edit the home page of the remote space to the published home page from the source space.

Further publishing of source space instance pages retain the page hierarchy if the parent exists in the target remote instance space.

Removing content remotely

To remove published page content remotely, all you have to do is to change the state to Remove and the page will be removed in the remote instance.

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

In this workflow the transition to the Remove state can only be actioned by an administrator using the /wiki/spaces/AWPD/pages/6428167968 option (adding either &admin=true or ?admin=true to the page URL).

If blog posts need to be removed, a trigger must added for a newsstatechanged event to the Remove state.

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

Removing a published page from the remote space does not affect the source space instance page. The publishing process is one way - from the source instance. There is no sync based on a change on a published page in the remote instance page.