Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
The message service alerts an editor of the current working page status, such as when an editor edits a page property or submits a page for editing.
The message service store uses a central message pool with two main parts:
The message service is the central hub which is registered in the Episerver Framework ShellModule.
To refer to the message service, use a dependency to resolve it.
this._messagePool = epi.dependency.resolve("epi.shell.MessageService");
put: function ( /*String*/typeName,
/*String*/message,
/*String*/contextTypeName,
/*Object*/contextId,
/*Object*/externalItemId,
/*Object*/externalItemData)
remove: function (/*Object?*/query)
query: function (/*Object?*/query)
observe: function (/*Object?*/query, callback)
The following example code shows how to to add a page property item error to the global message queue.
this._messagePool.put("error", result.error, "Page", this.pageLink, item.propertyName, item.item);
The following example code shows how to remove a page property item error from the global message queue.
this._messagePool.remove({
contextTypeName: "Page",
contextId: this.pageLink,
externalItemId: item.propertyName,
externalItemData: item.item });
The following example code shows how to query error items with a specific contextTypeName and contextId in the global message queue.
this._query = { typeName: "error", contextTypeName: this.contextTypeName, contextId: this.contextId};
var messages = this._messagePool.query(this._query);
The following example code shows how to observe a message with a specific contextTypeName and contextId in the global message queue, with query conditions.
this._messagePool.observe({ contextTypeName: messageContext.contextTypeName, contextId: messageContext.contextId });
Currently the [NotificationStatusBar] widget is injected to the status bar and observes changes in the message queue related to the current working page. The widget then displays message elements for the current working page, such as errors, warnings and notifications.
Last updated: Sep 21, 2015