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

Compare with Current View Page History

Version 1 Next »

Action availability defines whether the action is permitted on the selected item. For example, the addCategory action below is permitted when:

  • The selected item is a category, meaning you can create subcategories.
  • The selected item is a folder.
  • At the root level of the workspace, meaning you can create a category without selecting an item.
  • The selected item is not marked for deletion.

(warning) Magnolia 5.3+: Starting with Magnolia 5.3 you can add multiple availability rule classes. See the example below. The rules parent node contains subnodes, one for each rule. The rules are combined with a logical AND operator. Each rule must have the implementationClass property which points directly to the rule class (no more definition class).

Node nameValue

actions

 

addCategory

 

availability

 

nodeTypes

 

category

mgnl:category

folder

mgnl:folder

root

true

rules

 

notDeletedRule

 

implementationClass

info.magnolia.ui.api.availability.IsNotDeletedRule

anotherRule

 

implementationClass

com.your.customapp.app.action.availability.AnotherAvailabilityRule

Properties

  • availability
    • access: Action is available if the current user has one of the listed roles.
      • roles
        • <role>: Name of the role that is permitted to execute the action.
    • nodes: Action is available if the selected item is a node.
    • nodeTypes:Action is available if the selected item is one of the node types listed.
      • <node type>: A valid node type such as mgnl:folder.
    • rules: Action is available if the selected item(s) match for every availability rule class
      • <ruleNodeName>: give the node a name which reflects the rule-class
        • implementationClass : the class name of the rule availability class; class must implement info.magnolia.ui.api.availability.AvailabilityRule (usually just extending info.magnolia.ui.api.availability.AbstractAvailabilityRule)
    • root: Action is available at the workspace root level if true.
    • properties: Action is available if the selected item is a property.
    • multiple: Boolean property that enables and disables multiselection. Default is false. Available when the action class extends 
      $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") AbstractMultiItemAction
      . 
    • writePermissionRequired: Optional. Set to true if the action requires write permission on the currently selected node. The action will be disabled if the user doesn't have write permission. Default is false

(warning) Magnolia 5.2.x and earlier:

Node nameValue

actions

 

addCategory

 

availability

 

nodeTypes

 

category

mgnl:category

folder

mgnl:folder

root

true

ruleClass

info.magnolia.ui.api.availability.IsNotDeletedRule

Properties

  • availability
    • access: Action is available if the current user has one of the listed roles.
      • roles
        • <role>: Name of the  role  that is permitted to execute the action.
    • nodes: Action is available if the selected item is a node.
    • nodeTypes:Action is available if the selected item is one of the node types listed.
      • <node type>: A valid node type such as mgnl:folder.
    • ruleClass: Class that contains custom logic to check if the action is permitted on the selected item. A common example is info.magnolia.ui.api.availability.IsNotDeletedRule which checks that the item is not marked for deletion. Your custom class must extend 
      $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") AbstractAvailabilityRule
      .
    • root: Action is available at the workspace root level if true.
    • properties: Action is available if the selected item is a property.
    • multiple: Boolean property that enables and disables multiselection. Default is false. Available when the action class extends 
      $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") AbstractMultiItemAction
      . 

Action availability is different from action bar section availability. Section availability defines whether the actions configured within a section are displayed in the action bar. If the section is displayed, then action availability is checked for each action in the section.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels