This documentation is still in progress. We are working hard to update all our screenshots to the new Magnolia 6 style. Please bear with us.
To launch the publication of content in content apps, trigger the
publish action in your app's actionbar. Configure the action in the module configuration under
/modules/<module-name>/apps/<app-name>/subApps/browser/actions. The configuration should look similar to the Assets app, for example.
This is what a non-workflow configuration looks like. The configuration launches the
activate command inside the
versioned catalog which is part of the Activation module. The action creates a new version of the published item and and activates it to the public instance but does not trigger a workflow.
Properties related to publishing:
class: Specifies an action definition class.
catalog: References a command catalog.
command: A command to be launched inside the catalog.
Extendable action skeleton
Before you change the action to trigger a workflow, look at the available configuration in the workflow module.
You can choose from two action configurations:
publish: Launches the workflow directly. Use this action when you do not want to give an editor the possibility to schedule publishing to a future date or add a comment.
schedulePublication: Opens a dialog where the editor can add a publication date and a comment.
The command name is the same,
activate, but the commands reside in different catalogs. The default non-workflow action launches an
activate command from the
versioned catalog in the Activation module. The other
activate command is in the
workflow catalog in the Workflow module.
schedulePublication actions to configure workflow for any content app or extend them in your own action configuration.
Adding fields to publication dialog
When using workflow, the editor can add a comment and set the publication to a future date. The publication dialog provides fields for enter this information.
formTypes configuration tells the form builder what type of input is expected in the form fields. The types are then mapped to the form configuration using the node name such as
presenterClass inside the dialogs definition extends the
FormDialogPresenter by the necessary functionality for this manual mapping.
Adding custom parameters
You can pass custom parameters from your action definition into the process using the
params node in the action configuration. You can reference the parameters in the process as described in Input and output parameters.
In this example we enable workflow in the Assets app. Almost all properties are already defined in the configuration.
- Remove all properties from our activate action inside the assets app.
- Add an
extendsproperty. Set its value to the
- Change the three remaining publication related actions. Extend the
activateaction you already did. Override properties to change the default behavior.