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.

Notifications are non-intrusive messages that inform the user whether an action was completed or aborted successfully. Typically they confirm something. Notifications look like Post-IT notes. They go away automatically and don't require user action. Use notifications to confirm what the user did and provide them with confidence and assurance.

To show notifications, inject the 

$webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") UiContext
 interface to your class. The UiContext is implemented by AppContext, SubAppContext and Shell, so if you have one of those at hand, just reuse them.

Usage examples: 

@Inject
public MyCustomClass(UiContext uiContext) {
	this.uiContext = uiContext;
}
 
// Send an INFO notification to the current user.
private openInfoNotification(String message) {
	uiContext.openNotification(MessageStyleTypeEnum.INFO, true, message);
}
 
// Send an ERROR notification to the current user.
private openErrorNotification(String message) {
	uiContext.openNotification(MessageStyleTypeEnum.ERROR, true, message);
}
  • No labels