Publication Workflow Application
![]() | Simple publication workflow implementation that allows to push a document through various validation states until it is published. |
Type | XAR |
Category | Application |
Developed by | Anca Luca, Thomas Delafosse, Raluca Stavro, slauriere |
Active Installs | 70 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Compatibility |
|
Table of contents
Description
Usage
This extension uses 2 important concepts:
- the draft document
- the published document (the target document, from the point of view of a draft),
and functions in the following way: the contributors edit the draft document, demand moderation and validation on it, and once it's published it is copied to the published document. So there are always 2 documents, the draft and the published document. When a workflow is initiated on a document, the current document will be the draft and the user will need to fill in the target document. The published documents should never be edited directly, only published from a draft document.
In order to use this extension, add the PublicationWorkflow.PublicationWorkflowPanel to the spaces of your choice (should be the space where the draft documents reside and the space where the published documents reside, so that the draft can be accessed from the published document and edited) and use the commands available in this panel. The same UI can be achieved by using the {{publicationworkflow /}} macro in the context of the draft and published document.
The workflow "New Workflow" has been created using the template provider on the PublicationWorkflow space (the groups for contributors, moderators and publishers have been created using the wiki administration).
In order to define a workflow, just create a new document using the PublicationWorkflowConfigTemplate template (which has a template provider available in the space PublicationWorkflow, see the first image above) and fill in the 3 groups: contributors, moderators and publishers (webmasters). By default workflows work with 2 levels of validation: the contributors start the workflow and edit the documents then submit to moderation. Moderators can edit further and then submit of validation or refuse and send the doc back to contribution. Then, the publishers can edit further and validate and publish or refuse and send back to moderation. If, in the configuration, the moderators group is missing then there will only be one level of moderation, done by the publishers. Once published, a document can be archived (passed to hidden) or unpublished (the published document is removed and the content is copied to the draft).
The panel PublicationWorkflow.PublicationWorkflowPanel has been added on the left column for the Draft space in the example above (using the space administration section).
We have created a new document inside the Draft space and we would like to publish it in the Main space using the "New Workflow" workflow.
The button "Start workflow" will send the document to the "Draft" status (draft).
The button "Submit to moderation" will send the document to the "In moderation" status (moderation).
The button "Validate" will send the document to the "Validation" status. The document can be either validated or refused by the a member of the publishers group (webmasters).
The button "Publish" will open a modal box to confirm the publishing of the document. In this state,the document can be validated without being published or refused.
The user needs to confirm if the document is published.
The published document is copied to the "Main" space which was initially selected.
Note that on the draft document the rights are handled automatically by the workflow application (between contributors, moderators and publishers) but for the published documents the rights fall in the responsibility of the wiki administrator, which should make sure that no one can edit the published documents directly (usually it means setting the rights on a space).
Mails are being sent in the following cases:
- when a document is submitted to moderation - mail is sent to the users of the moderators group if any, or to validators otherwise
- when a document is submitted to validation - mail is sent to validators
- when a document is refused by moderators - mail is sent to the contributors
- when a document is refused by validators - mail is sent to the users of the moderators group if any, or to contributors otherwise
- when a published document is unpublished - mail is sent to validators
Check the workflow diagram for the complete list of statuses and transitions :
The list of drafts documents is available on the page PublicationWorkflow.Overview:
Publication Workflow macro
The macro publicationworkflow is a standalone macro that allows to control the workflow state of the current document.
Name | Description | Since | Default |
---|---|---|---|
allowWorkflowInitialization | If the current document does not have an initialized workflow, display options to initialize it. | 2.2 | true |
Configuration
The following options are available when configuring a publication workflow :
Name | Description | Since | Default value |
---|---|---|---|
Default target space | Define an indicative space for the target of a given workflow document | 2.1 | N/A |
Set drafts to hidden | Will force a draft to be marked as a hidden document when set to true | 1.9 | Yes |
Move strategy | Will define the actions to be taken by the application when a page under workflow is moved. The application can either :
Note that there are some conditions where the application will not be able to compute a new location for the equivalent document of the document being moved. For example : when trying to move a document MySpace.Draft to MySpace.SomeOtherName, with the target MySpace.Target ; the publication workflow will not be able to compute the new name of the corresponding target, as the rename action did not happened on a part of the page reference that was common to the draft and the target document. In that case, a warning is sent in the move / rename logs, indicating that the equivalent page could not be moved. | 1.10 | Do nothing |
Allow custom publication comment | Add the possibility for editors to define a publication comment that will be used in the history of the target document. | 2.0 | No |
XWiki 2.3+ Skip draft rights update on workflow transition | By default the workflow transitions update the rights of the draft document, to make the actions available to the various groups of the workflow based on the state (contributors, moderators, validators). Thus option allows to skip these rights settings and leave the draft rights as they are. | 2.3 | False |
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v2.4.2
v2.4.1
v2.4
v2.3.3
v2.3.2
v2.3.1
v2.3
v2.2
v2.1
v2.0
v1.10
Added the possibility to move the documents under workflow in sync. See the property Move strategy in the workflow configuration.
v1.9.1.1
v1.9.1
v1.9
v1.8.1
v1.8
v1.7
v1.6
v1.5.1
v1.5
v1.4
v1.3
Dependencies
Dependencies for this extension (org.xwiki.contrib.workflow-publication:xwiki-workflow-publication-application 2.4.2):
- org.xwiki.contrib.workflow-publication:xwiki-workflow-publication-api 2.4.2