Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
A message view defines how a message is displayed in the Pulse and what users can do with the message. Magnolia's default
message view can display any system messages and allows the user to delete them. For a more advanced example, see the workflow
message view in /modules/workflow/messageViews/workflow
.
Definition
Here's how the default
message view is defined in /modules/ui-admincentral/messageViews/default
. Copy or extend it as a starting point for your own view.
actions: delete: icon: icon-delete class: info.magnolia.ui.admincentral.shellapp.pulse.message.action.DeleteMessageActionDefinition form: tabs: - name: message fields: - name: sender fieldType: text - name: message rows: 7 fieldType: text actionbar: defaultAction: delete sections: - name: messageActions groups: - name: deleteActions items: - name: delete
Node name | Value |
---|---|
modules | |
ui-admincentral | |
messageViews | |
default | |
actions | |
delete | |
class | info.magnolia.ui.admincentral.shellapp.pulse.message.action.DeleteMessageActionDefinition |
icon | icon-delete |
form | |
tabs | |
message | |
fields | |
sender | |
fieldType | text |
message | |
class | text |
rows | 7 |
actionbar | |
sections | |
messageActions | |
groups | |
deleteActions | |
items | |
delete | |
defaultAction | delete |
Nodes:
<view name> | required Name of view. |
| required An action definition that defines what actions the user can perform on the message. For example, a user can approve or reject a published page. |
| required A form definition that defines what message details are displayed in the view, such as the sender and the subject. The form fields are rendered as static text in the message view, not as fillable fields. |
| required An action bar definition that references actions defined in the message view or somewhere else. The action bar is displayed on side of the message view. |
Here is what a message looks like the default
view.
Using a view in code
To use your custom message view in code, set the view on the
private sendMessageWithCustomView(String messageText) { final Message message = new Message(); message.setMessage(messageText); message.setType(MessageType.INFO); // format when referencing a view // module-name:view-name (as defined in the configuration) message.setView("ui-admincentral:myCustomView"); messagesManager.sendLocalMessage(message); }