Magnolia 5.5 reached end of life on November 15, 2019. This branch is no longer supported, see End-of-life policy.
The CTS Workflow module allows you to process content translation in a defined workflow.
The module extends Magnolia's basic workflow functionality. Translators and translation reviewers interact in the Pulse in a four eye workflow process similar to that of the Workflow module.
You can enable content translation workflow in any content app. The CTS Demo module enables workflow translation in the Tour Categories app.
<dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-content-translation-support-extend-workflow</artifactId> <version>2.0.0</version> </dependency>
The module is configured at /modules/magnolia-module-extend-content-translation-support-workflow
.
Node name |
---|
modules |
content-translation-support-extend-workflow |
tasks |
config |
dialogs |
commands |
workflows |
fieldTypes |
messageViews |
workItemHandlers |
The CTS Demo module:
reviewers
and translators
. superuser is assigned to the reviewers group and eric to the translators group. Here's how content translation workflow works:
category.tour-type.mountains.csv
. The file has the following columns (comma separated headings in CSV or elements in XLIFF):tourCategories:displayName
. You can bypass the content review process (step 4) by enabling auto import.
The autoImport
property allows you to bypass the content review process (step 4) and import translated content directly into the JCR.
The property is configured in /modules/content-translation-support-extend-workflow/config/autoImport
.
Node name | Value |
---|---|
content-translation-support-extend-workflow | |
config | |
autoImport | false |
Properties:
config | optional Configuration properties node. |
| optional, default is Imports translated content directly into JCR |
Magnolia's workflow engine is built upon the jBPM Business Process Management Suite. See Workflow for more.
The module includes a BPMN2 workflow process: TranslationRequestProcess
.
Here's the visual representation of the process.
The process is registered in /modules/content-translation-support-extend-workflow/workflows/content-translation-support-workflow-publication
.
Node name | Value |
---|---|
workflows | |
content-translation-support-workflow-publication | |
id | info.magnolia.module.contenttranslationsupport.workflow.TranslationRequestProcess |
name | TranslationRequestProcess |
resourcePath | TranslationRequestProcess.bpmn2 |
type | bpmn |
Properties:
content-translation-support-workflow-publication
| required CTS worklow publication node. |
| required Id. used to identify process in jBPM. |
| required Name used in Magnolia to identify the process. |
| required Path to the .bpmn file in the module resource directory. |
| required Process type. |
User tasks display in the Pulse. Translators and reviewers can claim tasks to start working on them. Tasks have a clear status and an assignee.
Two user tasks that ensure that users assigned to the translators
and reviewers
groups receive appropriate messages in the Pulse are configured in the module.
Tasks are configured in /modules/content-translation-support-extend-workflow/tasks
.
Node name | Value |
---|---|
tasks | |
translation | |
groups | |
translators | translators |
viewMapping | |
default | content-translation-support-extend-workflow:translate |
title | |
label | Translation request |
class | info.magnolia.module.workflow.jbpm.humantask.definition.PublicationTaskDefinition |
parameterResolver | info.magnolia.module.contenttranslationsupport.extend.workflow.GroupsTaskParameterResolver |
presenterClass | info.magnolia.module.workflow.jbpm.humantask.view.PublicationTaskPresenter |
taskJobFactoryClass | info.magnolia.module.workflow.jbpm.humantask.schedule.PublicationTaskJobFactory |
reviewTranslation | |
groups | |
extends | override |
reviewers | reviewers |
viewMapping | |
default | content-translation-support-extend-workflow:reviewTranslation |
title | |
label | Review translation |
extends | ../translation |
Properties:
tasks | required User tasks node. |
| required Name of task:
|
| optional Maps the task to a group. Value must match a group in Security app. Property name is arbitrary.
|
| optional Task title displayed in the Pulse. |
| required Maps the task to a message view in
|
| required/optional See User tasks for more. |
Workflow message views define how messages display in the Pulse during translation workflow. See Message view definition for more.
Message views for workflow user tasks are configured in /modules/content-translation-support-extend-workflow/messageViews
.
Node name |
---|
messageViews |
translate |
form |
actions |
actionbar |
reviewTranslation |
form |
actions |
actionbar |
Properties:
messageViews | required Message views node. |
| required
|
| required Message view form definition.
|
| required Message view action definitions.
|
| required Message view action bar definition. |
Work item handlers map work items to a handler. The mapping is based on the work item name which is added to the jBPM environment. Magnolia observes the work item registry in the workItemHandlers
folder of a module.
Work item handlers (which execute commands in this case) are configured in /modules/content-translation-support-extend-workflow/workItemHandlers
.
Node name | Value |
---|---|
workItemHandlers | |
approve | |
catalogName | workflowTranslation |
class | info.magnolia.module.contenttranslationsupport.extend.workflow.workitem.TranslationWorkItemHandlerDefinition |
commandName | importTranslationAndSendMailCommand |
reject | |
catalogName | workflowTranslation |
class | info.magnolia.module.contenttranslationsupport.extend.workflow.workitem.TranslationWorkItemHandlerDefinition |
commandName | rejectTranslationResultCommand |
abort | |
catalogName | workflowTranslation |
class | info.magnolia.module.contenttranslationsupport.extend.workflow.workitem.TranslationWorkItemHandlerDefinition |
commandName | abortTranslationCommand |
error |
Properties:
workItemHandlers | required Work item handler folder. |
| optional Handles importing translated content after approval. |
| optional Handles rejecting translated content. |
| optional Handles cancelling translation tasks. |
| optional Handles errors for failed tasks. |
The module includes a full set of commands that are used in the workflow process.
Commands are configured in /modules/content-translation-support-extend-workflow/commands
.
Node name | Value |
---|---|
commands | |
workflowTranslation | |
startTranslationWorkflowCommand | |
startWorkflowCommand | |
class | info.magnolia.module.workflow.commands.LaunchWorkflowCommand |
parameterMapName | mgnlData |
workflow | content-translation-support-workflow-publication |
exportCommand | |
uploadTranslatedFileCommand | |
uploadCommand | |
updateWorkflowTaskStatusCommand | |
importTranslationAndSendMailCommand | |
importCommand | |
updateWorkflowTaskStatusCommand | |
sendMailCommand | |
updateWorkflowTaskStatusCommand | |
updateTranslationStatusCommand | |
rejectTranslationResultCommand | |
abortTranslationCommand |
Properties:
commands | optional Commands folder. |
| required Workflow translation catalog. |
| required Command class. See table below. |
| required/optional Properties supported by the command class. |
Command classes:
Command name | Class | Other properties |
| ||
|
|
|
|
| - |
uploadTranslatedFileCommand | ||
|
| - |
|
| decision =approve |
importTranslationAndSendMailCommand | ||
|
| commandName =common-scheduleImportCommand |
|
| |
|
|
|
updateWorkflowTaskStatusCommand |
| - |
updateTranslationStatusCommand |
| - |
rejectTranslationResultCommand |
| status =rejected |
abortTranslationCommand |
| - |
The module includes two custom fields that are used in workflow dialogs.
The field types are registered in /modules/content-translation-support-extend-workflow/fieldTypes
.
Node name | Value |
---|---|
fieldTypes | |
previewTranslationTableField | |
definitionClass | info.magnolia.module.contenttranslationsupport.extend.workflow.field.TranslatedPreviewTableDefinition |
factoryClass | info.magnolia.module.contenttranslationsupport.extend.workflow.field.TranslatedPreviewTableFactory |
simpleUploadField | |
definitionClass | info.magnolia.module.contenttranslationsupport.extend.workflow.field.SimpleUploadFieldDefinition |
factoryClass | info.magnolia.module.contenttranslationsupport.extend.workflow.field.SimpleUploadFieldFactory |
Properties
fieldTypes | optional Field types folder. |
| required Field name: |
| required Field definition class.
|
| required Field factory class.
|
The module includes three workflow dialogs configured in /modules/content-translation-support-extend-workflow/dialogs
.
Node name |
---|
dialogs |
workflowTranslationRequest |
uploadTranslationFile |
reviewTranslatedContent |
Properties:
dialogs | optional Dialogs folder. |
| optional Translation request dialog starts the workflow process.
|
| optional Upload translated file dialog allows a translator to upload a translated file.
|
| optional Translation dialog allows a reviewer to review translated content in a table.
|
You can enable translation workflow in any content app.
Example: Enabling translation workflow in the Tours app.
Ensure that the fields you want to translate have an i18n
property (set to true
) in the detail
subapp. See Enabling mulitlanguage content for more.
Example: description text field in the tours
tab in /modules/tours/apps/tours/subApps/detail/editor/form/tabs/tour/fields/description
.
Node name | Value |
---|---|
editor | |
form | |
tabs | |
tours | |
fields | |
name | |
description | |
class | info.magnolia.ui.form.field.definition.TextFieldDefinition |
i18n | true |
rows | 3 |
Add the Translate by workflow (startTranslationWorkflow
) action to the browser
supapp. The CTS Demo module adds the Tranlsate by workflow action to the Tour Categories app. You can copy the action configuration from there.
Example: startTranslationWorkflow
action in /modules/tours/apps/tours/subApps/browser/actions/startTranslationsWorkflow
.
Node name | Value |
---|---|
browser | |
actions | |
startTranslationsWorkflow | |
class | info.magnolia.module.contenttranslationsupport.extend.common.action.OpenTranslateDialogActionDefinition |
dialogName | content-translation-support-extend-workflow:workflowTranslationRequest |
icon | icon-content-translation-app |
label | Translate by workflow |
Add the action to the action bar.
Example: startTranslationWorkflow
action in /modules/tours/apps/tours/subApps/browser/actionbar/sections/item/groups/translationActions/items/startTranslationsWorkflow
.
Node name |
---|
browser |
actionbar |
sections |
item |
groups |
translationActions |
items |
startTranslationsWorkflow |