Page tree
Skip to end of metadata
Go to start of metadata

The module handles publishing of content from an author instance to a public instance. In DX Core, the functionality of this module is extended by the Publishing Transactional module, which ensures synchronization of content between multiple public instances.

By bringing a neater and more logical structure for the publishing (activation) functions, the Publishing module is a convenient replacement for the former Activation module.

The bundles and webapps in this Magnolia branch are by default provided with the Publishing module. However, using Activation is still possible, but only after replacing the Publishing module and the Publishing Transactional module with the Activation module and the Transactional Activation module.

Module structure

The module (parent) consists of four submodules. All of the submodules are required for the correct functioning of the publishing feature.

artifactID

magnolia-publishing-parent

Parent reactor.

magnolia-publishing-core

Provides the main functionality.

magnolia-publishing-sender

Handles send operations to the public instance.

magnolia-publishing-receiver

Handles receive requests on the public instance.

magnolia-publishing-app

Generates new publishing keys and provides a publishing monitor.

Installing

Maven is the easiest way to install the module. Add the following to your bundle:

<dependency>
  <groupId>info.magnolia.publishing</groupId>
  <artifactId>magnolia-publishing-core</artifactId>
  <version>1.1.1</version>
</dependency>

<dependency>
  <groupId>info.magnolia.publishing</groupId>
  <artifactId>magnolia-publishing-sender</artifactId>
  <version>1.1.1</version>
</dependency>

<dependency>
  <groupId>info.magnolia.publishing</groupId>
  <artifactId>magnolia-publishing-receiver</artifactId>
  <version>1.1.1</version>
</dependency>

<dependency>
  <groupId>info.magnolia.publishing</groupId>
  <artifactId>magnolia-publishing-app</artifactId>
  <version>1.1.1</version>
</dependency>

Pre-built JARs are also available for download. See Installing a module for help.

Configuration

Publishing is configured in Configuration > /modules/publishing-core .

Please be very careful when modifying the configuration of publishing and always test the changes thoroughly before applying them to a live environment. Sometimes there may exist a better way of solving a publishing-related problem than by tweaking a publishing configuration.

Main part

The main part of the configuration is under  /modules/publishing-core/config .

Node name

  modules

  publishing-core

 config

      publicationByPathVoters

      publishingLogStorage

      receivers

      operations

publicationByPathVoters 

Sets publication by path (default is by uuid) to configured workspaces.

Node nameValue

 publicationByPathVoters


      op

OR

      config


          op

AND

          mgnlExchangeWorkspaceName


              pattern

config

              keyName

mgnlExchangeWorkspaceName

              class

info.magnolia.publishing.voter.MapKeyPatternVoter

          1stAnd2ndLevelNodes


              op

OR

              class

info.magnolia.voting.voters.VoterSet

              mgnlExchangeParentPath


                  pattern

^\/[^\/]*$

                  keyName

mgnlExchangeParentPath

                  class

info.magnolia.publishing.voter.MapKeyPatternVoter

              mgnlExchangePath


                  pattern

^\/[^\/]*(\/[^\/]*)?$

                  keyName

mgnlExchangePath

                  class

info.magnolia.publishing.voter.MapKeyPatternVoter

      resources


          workspace


              pattern

resources

              keyName

mgnlExchangeWorkspaceName

              class

info.magnolia.publishing.voter.MapKeyPatternVoter

publishingLogStorage

Defines where the information about publishing is logged. The default implementation MemoryActivationStorage keeps the information in memory.

Node nameValue

 publishingLogStorage


 class

info.magnolia.publishing.monitor.MemoryPublishingStorage

receivers

Contains the list of receivers ( subscribers in the Activation module) where content will be published.

Node nameValue

 receivers


      magnoliaPublic8080


          url

http://localhost:8080/magnoliaPublic

          enabled

true

operations

Contains the list of operations provided by Magnolia and the respective operation classes:

  • publish ( activate )
  • unpublish ( deactivate )
  • commit (DX Core only)
  • rollback (DX Core only)

    You can define your own operations and add them to the list, but in this case, you will also have to implement your own send and receive operations. The SendOperation is a base interface that all send operations must implement.

    With a custom-defined operation, you can publish content to something that is not a Magnolia public instance, for example to a custom API or a Content Delivery Network.

Node nameValue

 operations


      publish


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionPublicationOperation

          sendOperationClass

info.magnolia.publishing.sender.operation.HttpPublicationOperation

      unpublish


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionUnpublicationOperation

          sendOperationClass

info.magnolia.publishing.sender.operation.HttpUnpublicationOperation

      activate


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionPublicationOperation

      deactivate


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionUnpublicationOperation

      commit


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrCommitOperation

          sendOperationClass

info.magnolia.publishing.transactional.sender.operation.HttpCommitOperation

      rollback


          receiveOperationClass

info.magnolia.publishing.transactional.receiver.operation.jcr.JcrRollbackOperation

          sendOperationClass

info.magnolia.publishing.transactional.sender.operation.HttpRollbackOperation

Publish and unpublish commands

Users typically publish content by clicking Publish in the Action bar. The click executes a publish  command which pushes the content from the author instance to the public instance(s). Conversely, when users click Unpublish the system executes an unpublish command which deletes the content from the public instance(s).

The publish and unpublish commands are configured in /modules/publishing-core/commands . The default catalog contains the commands which just publish the content without versioning. Magnolia also provides a versioned command catalog. It contains identically named publish and unpublish commands which first version the content and then delegate to the default commands.

Both in the default catalog and in the versioned catalog, the command tree contains also the activate and deactivate commands (not shown below), which extend the publish and unpublish commands, respectively. The two commands are included in the configuration for compatibility reasons.  

Node nameValue

 modules


 publishing-core


 commands


 default


 publish


 class

info.magnolia.publishing.command.PublicationCommand

 unpublish


 class

info.magnolia.publishing.command.UnpublicationCommand

 versioned


 publish


 version


 class

info.magnolia.commands.impl.VersionCommand

 enabled

true

 publish


 class

info.magnolia.commands.DelegateCommand

 commandName

default-publish

 unpublish


 version


 class

info.magnolia.commands.impl.VersionCommand

 enabled

true

 unpublish


 class

info.magnolia.commands.DelegateCommand

 commandName

default-unpublish

To use one of these commands, define the catalog and the command name in the action definition. See an example in Executing commands with actions.

Disabling publishing

If necessary, you can disable publishing on the public instance(s) by adding the enabled node in Configuration > /server/filters/publishing and set its value to false .

How publishing works

For an overview of how publishing works see the Publishing overview page.

Troubleshooting