Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MOTION-157

...

Magnolia uses info.magnolia.ui.admincentral.shellapp.pulse.task.action.ResolveTaskAction inside the Tasks app for this step. It allows you to define a decision inside the configuration which is mainly used for approving or rejecting a publication.

...

heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Mgnl f
messageViews

...

Mgnl n
publish

...

Mgnl n
form

...

Mgnl n
actions

...

Mgnl n
approve

...

Mgnl n
availability

...

Mgnl p
class

...

Mgnl p
decision

...

Mgnl p
icon

...

Image Added

After resolving the task using the ResolveTask action the result map contains only one entry with the configured decision.

...

Every task type needs a unique name. The name is used to read the task definition from the task registry in your module configuration.

...

heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Image Added


...

Mgnl f
my-module

...

Mgnl f
tasks

...

Mgnl n
getGroceries

...

Mgnl p
class

...

Mgnl p
taskView

...

Mgnl p
title

...

The simplest

Javadoc resource link
0info.magnolia.task.definition.TaskDefinition
classNameinfo.magnolia.task.definition.TaskDefinition
renderTypeasynchronous
 needs the following properties:

...

Use a message view configuration to define which fields of the task object are displayed to the user. You can use a dot notation such as content.groceries to reference fields from the content or result map. In the same fashion, you can configure your actions, including availability and action bar mappings.

...

heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Mgnl f
my-module

...

Mgnl f
messageViews

...

Mgnl n
groceries

...

Mgnl n
form

...

Mgnl n
tabs

...

Mgnl n
groceries

...

Mgnl n
fields

...

Mgnl n
actorIds

...

Mgnl n
content.groceries

...

Mgnl p
class

...

Image Added

...

Mgnl n
content.budget

...

Mgnl n
comment

...

Mgnl n
actions

...

Mgnl n
actionbar

Task presenter

A task presenter is started when a user opens a task to see its details. The presenter builds the form and action bar which are displayed to the user in the browser. Magnolia provides a 

Javadoc resource link
0info.magnolia.ui.admincentral.shellapp.pulse.task.DefaultTaskDetailPresenter
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.DefaultTaskDetailPresenter
renderTypeasynchronous
. See Task view for its functionality.

...

To implement a custom presenter, extend or use 

Javadoc resource link
0info.magnolia.ui.admincentral.shellapp.pulse.task.definition.TaskUiDefinition
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.definition.TaskUiDefinition
renderTypeasynchronous
 instead of 
Javadoc resource link
0info.magnolia.task.definition.TaskDefinition
classNameinfo.magnolia.task.definition.TaskDefinition
renderTypeasynchronous
 and add a presenterClass property with a custom implementation of the 
Javadoc resource link
0info.magnolia.ui.admincentral.shellapp.pulse.task.TaskDetailPresenter
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.TaskDetailPresenter
renderTypeasynchronous
interface to the configuration.

...

heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Mgnl f
tasks

...

Mgnl n
getGroceries

...

Mgnl p
class

...

Mgnl p
presenterClass

...

Mgnl p
taskView

...

Mgnl p
title

...

Image Added

In your implementation, you can access the task object as well as its definition using injection:

...

The tree below shows the default setting for the archive action (the definition class is info.magnolia.ui.admincentral.shellapp.pulse.task.action.ArchiveTasksActionDefinition) with the superuser role set to access this action:

...

heading0
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Node name

...

Mgnl n
bulkActions

...

Mgnl n
archive

...

Mgnl n
availability

...

Mgnl n
access 

...

Mgnl n
roles

...

Mgnl p
superuser

...

Mgnl n
rules 

...

Mgnl n
CanArchiveTaskRule 

...

Mgnl n
status 

...

Mgnl p
Created

...

Mgnl p
Failed

...

Mgnl p
InProgress

...

Mgnl p
Resolved

...

Mgnl p
Scheduled

...

Mgnl p
assignee

...

Mgnl p
class

...

Mgnl p
multiple

...

Mgnl p
class

...

Mgnl p
icon

...

Image Added

To allow bulk actions for other users, add their role names from the list of default roles as the properties and values of the roles subnode.

...