Class sap.ushell.ui5service.ShellUIServiceModule: sap/ushell/ui5service/ShellUIService
The Unified Shell's ShellUIService service.
This service allows apps to interact with the Fiori Launchpad UI. The service is injected in the app components by the FLP renderer before the corresponding apps start. To consume the service, app components should declare it in their manifest.json as follows:
{ ... "sap.ui5": { "services" : { "ShellUIService": { "factoryName": "sap.ushell.ui5service.ShellUIService" } } } ... }
The service can be then consumed within the component as shown in the following example:
// Component.js ... this.getService("ShellUIService").then( // promise is returned function (oService) { oService.setTitle("Application Title"); }, function (oError) { jQuery.sap.log.error("Cannot get ShellUIService", oError, "my.app.Component"); } ); ...
Since: 1.38.0.
Constructor Summary
Method Summary
sap.ushell.ui5service.ShellUIService.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ushell.ui5service.ShellUIService with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ushell.ui5service.ShellUIService.getMetadata()Returns a metadata object for class sap.ushell.ui5service.ShellUIService.
Constructor Detail
new sap.ushell.ui5service.ShellUIService(oCallerContext)
Returns an instance of the ShellUIService. This constructor must only be called internally by the Fiori Launchpad renderer and never by applications.
Instead, this service should be consumed by app components as described in the overview section of this class.
Parameters:
{object} | oCallerContext | The context in which the service was instantiated. Must have the format: { scopeType: "component", scopeObject: [a UI5 Component in the sap.ushell package] } |
Method Detail
sap.ushell.ui5service.ShellUIService.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ushell.ui5service.ShellUIService with name
sClassName
and enriches it with the information contained in oClassInfo
. oClassInfo
might contain the same kind of information as described in Object.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
sap.ushell.ui5service.ShellUIService.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ushell.ui5service.ShellUIService.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
getTitle(): string
Returns the title that was last set via setTitle.
- Since:
- 1.38.0
Returns:
{string} | The title that was last set via setTitle. |
setHierarchy(aHierarchyLevels?)
Displays the given hierarchy in the shell header.
Parameters:
{object[]} | aHierarchyLevels? | An array representing hierarchies of the currently displayed app. The array should specify title, icon, and navigation intent as shown in the following example: [ { title: "App 1", icon: "sap-icon://folder", subtitle: "go to app 1", intent: "#Action-toapp1" }, { title: "App 2", icon: "sap-icon://folder", subtitle: "go to app 2", intent: "#Action-toapp2" }, { title: "App 3", icon: "sap-icon://folder", subtitle: "go to app 3", intent: "#Action-toapp3" } ] The default app hierarchy is applied if no parameter is given. |
- Since:
- 1.38.0