You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

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

$webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") ActionDefinition
 interface. The definition class allows you to supply additional parameters to the action and call further classes to execute logic.

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 nameValue

 
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 
    $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") ActionDefinition
     interface. Set the value to a fully-qualified class name.
  • 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(warning) Magnolia 5.3.4+
  • subAppId : Optional. Name of the subapp to open when executing this action.
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels