Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.
Action definitions configure actions in the UI. The action has a name which is the name of the definition content node, for example addContact
below. The action is identified by this name within a certain scope such as within a subapp. Actions have an action definition class that implements the
Here is the addContact
action from the Contacts app. A user can execute the action in the action bar or in the action popup. When the action is executed, the detail subapp is launched.
Node name | Value |
---|---|
modules |
|
contacts |
|
apps |
|
contacts |
|
subApps |
|
browser |
|
actions |
|
addContact |
|
availability |
|
appName | contacts |
class | info.magnolia.ui.contentapp.detail.action.CreateItemActionDefinition |
icon | icon-add-item |
label | New contact |
nodeType | mgnl:contact |
subAppId | detail |
Action properties:
availability
: Defines whether the action is permitted on the selected item. Optional.
appName
: Optional. Name of the app to launch when executing this action. This property works together with the subAppId
property. They tell where the action takes place. For example, the addContact
action takes place in the detail
subapp of the contacts
app. The detail subapp displays a form that allows the user to fill in the contact's details. Set the property value to the app name given in app configuration. class
: Mandatory. Action definition class that reads the configuration properties and can supply additional parameters to the action. The class must implement the dialogName
: Optional. Dialog to open when the action is executed. A dialog is an alternative to editing items in an editor. Identify the dialog using syntax <app name>:<dialog name>
, for example contacts:folder
.icon
: Optional. CSS class that identifies an icon font used on the app tile. For available names see Icons.implementationClass
: Optional. In an action, the implementation class executes the action. Typically, a default implementation class is already hard-coded in the definition class. You only need to add this property if you want to override the default implementation with your own. For example, you might want to perform some extra validation on a saved value.label
: Optional. Label displayed to users in the action bar or context menu.nodeType
: Optional. Type of node this action creates or operates on. This property is needed if the action calls a dialog, such as in the Security app where users are edited by a dialog, not by a detail supapp. The property tells the dialog what node type it should operate on. When the action is executed in a detail app, however, the property is not needed because the /detail/editor/nodeType/name
property already defines the node type.modifiedOnly
: Publishes only nodes that are modified or never published . Excludes nodes that are already published . Use this property to make recursive publishing faster as it eliminates already-published nodes. Default value is false
. Magnolia 5.3.4+subAppId
: Optional. Name of the subapp to open when executing this action.