Magnolia 5.4 reached end of life on November 15, 2018. This branch is no longer supported, see End-of-life policy.
An action bar organizes actions into sections and groups. The bar is typically displayed on the right hand side of an app. In content apps, the browser subapp has an action bar that allows the user to manage content items (add, edit, delete).
The action bar also defines availability rules that determine which section of the action bar is displayed to the user. For example, when the user selects a content item, you want to only display actions that are relevant for that item.
The action bar references actions which are defined elsewhere. This separation allows you define an action once and use it in many places, not only in the action bar.
Example: Action bar in the Contacts app.
browser: actionbar: defaultAction: editContact sections: - name: root # group definition - name: deletedContact # group definition - name: deletedFolder # groups definition - name: contact groups: - name: addActions items: - name: addContact - name: confirmDeleteContact - name: editActions items: - name: editContact - name: renameContact - name: activationActions items: - name: activate - name: deactivate - name: importExportActions items: - name: export - name: versionsActions items: - name: showVersions - name: restoreVersion availability: nodeTypes: mgnl-contact: mgnl:contact
Node name | Value |
---|---|
browser | |
actionbar | |
sections | |
root | |
deletedContact | |
deletedFolder | |
contact | |
groups | |
addActions | |
items | |
addContact | |
confirmDeleteContact | |
editActions | |
items | |
editContact | |
renameContact | |
activationActions | |
items | |
activate | |
deactivate | |
importExportActions | |
items | |
export | |
versionsActions | |
items | |
showVersions | |
restoreVersion | |
availability | |
nodeTypes | |
mgnl:contact | mgnl:contact |
defaultAction | editContact |
Properties:
actionbar | required Action bar configuration. |
| required Sections defined in the bar. |
| required Arbitrary name. Name your sections after what the user has selected, such as |
| required Groups are actions that belong together. They are separated by horizontal lines in the action bar. |
| required Arbitrary name. |
| required Node containing the action names. |
| required Name of the action. Must be the same as defined in the action definition. |
| optional Defines whether the section is displayed to the user. This typically depends on what type of node the user has selected. |
| optional The section label is the green text displayed to users on the action bar. |
| optional Name of the action executed when the user double-clicks an item. |
Action bar availability defines whether a particular section of the action bar is available.
For example, in the action bar configuration in the Contacts app:
root
section display on the root node only. The user sees the Add contact, Add folder and Import actions defined in the groups in the root
section.contact
section display on selection of a mgnl:contact
node type.deletedContact
section display on selection of a mgnl:contact
node type, but the IsDeletedRule
rule class limits action availability when a contact has been marked for deletion to the Publish deletion and Restore previous version actions. This rule returns true
if the item is a node and has the mgnl:deleted
mixin type.actionbar: defaultAction: editContact sections: - name: root groups: # group definitions availability: nodes: false root: true - name: deletedContact groups: # group definitions availability: nodeTypes: mgnl-contact: mgnl:contact rules: - name: isDeletedRule implementationClass: info.magnolia.ui.framework.availability.IsDeletedRule - name: deletedFolder # groups definition - name: contact groups: # group definitions availability: nodeTypes: mgnl-contact: mgnl:contact
Node name | Value |
---|---|
actionbar |
|
sections |
|
root |
|
groups | |
availability | |
nodes | false |
root | true |
deletedContact |
|
groups | |
availability | |
nodeTypes | |
mgnl-contact | mgnl:contact |
rules | |
isDeletedRule | |
implementationClass | info.magnolia.ui.framework.availability.IsDeletedRule |
deletedFolder | |
contact |
|
groups | |
availability | |
nodeTypes | |
mgnl-contact | mgnl:contact |
Properties
| required Name of the action bar section |
| required Action availability configuration. |
| optional Section is available if the current user has one of the listed roles. |
| required Section is available to users assigned the listed roles. |
| required Name of the role that is permitted to execute the action. |
| optional Section is available if the selected item is a node. |
| optional Section is available if the selected item is one of the node types listed. |
| required A valid node type such as |
| optional Rules configuration node |
| required Rule configuration node. One node for each rule. Node name is arbitrary. |
| required Class that contains custom logic to check if the action is permitted on the selected item. A common example is |
| optional Action is available at the workspace root level if true. |
| optional Action is available if the selected item is a property. |
Here's the action bar:
Action bar availability is different from action availability where availability rules are defined on an individual action level and apply to each use of the action.