Namespace sap.ushellModule: sap/ushell/services/Container



Since: 1.15.0.
Namespaces & Classes
Field Summary
sap.ushell.ContainerThe Unified Shell container as a singleton object.
Method Summary
sap.ushell.bootstrap(sPlatform, mAdapterPackagesByPlatform?)Initializes the Unified Shell container for the given platform.
Field Detail
sap.ushell.Container: sap.ushell.services.Container
The Unified Shell container as a singleton object. This object will only be available after sap.ushell.bootstrap() has finished.
Since:
1.15.0
See:
sap.ushell.bootstrap
Method Detail
sap.ushell.bootstrap(sPlatform, mAdapterPackagesByPlatform?): jQuery.Promise
Initializes the Unified Shell container for the given platform. This method must be called exactly once in the very beginning by platform-specific code in order to bootstrap the container. As soon as the returned promise has been resolved, the container will be available as a singleton object sap.ushell.Container.

For convenience, platform-specific bootstrap code is available and can be easily included (before the SAPUI5 bootstrap) by a corporate shell as follows:

<script src="/sap/public/bc/ui5_ui5/resources/sap/ushell_abap/bootstrap/abap.js"></script>
<script id="sap-ui-bootstrap" src=".../sap-ui-core.js"></script>
This bootstrap code will automatically defer the initialization of SAPUI5 until the container is available. This is the preferred way of bootstrapping the Unified Shell.

Note: For SAPUI5 application projects the recommended way is to add a dependency to the "sap.ushell_abap" library (<groupId>com.sap.ushell</groupId> <artifactId>ushell_abap</artifactId>) and load the bootstrap code via the application's resources folder:

<script src=".../resources/sap/ushell_abap/bootstrap/abap.js"></script>
<script id="sap-ui-bootstrap" src=".../sap-ui-core.js"></script>

Since 1.15.0 you can provide the function window['sap.ushell.bootstrap.callback'] for calling back from this method asynchronously. SAPUI5's bootstrap is ongoing then. The same restrictions apply as for the function window['sap-ui-config']['xx-bootTask']) when the Unified Shell container has not yet finished its bootstrap. You cannot delay the bootstrap of SAPUI5 or the Unified Shell container; any errors are ignored. This callback is useful for sending asynchronous back-end requests at the earliest opportunity without delaying the core bootstrap of SAPUI5 and the Unified Shell container.

Parameters:
{string}sPlatform the target platform, such as "abap" or "local" (Note: there is no fixed enumeration of possible platforms)
{map.}mAdapterPackagesByPlatform?, Default: {} the map with platform specific package names for the service adapters. You only need to specify these package names, if they differ from the standard name "sap.ushell.adapters." + sPlatform.
Since:
1.15.0
Returns:
{jQuery.Promise} a promise that is resolved once the container is available
See:
sap.ushell.Container