Embedding an Application into a Shell
The shell API provides functionality for embedding JavaScript-based applications into a shell.
The shell API provides the following functionality:
- Abstraction from the environment where the JavaScript code is executed
- Trigger navigation to a launchpad URL
- Add a search provider in NWBC for Desktop 4.0
- Propagation of user-specific settings from the back-end system to SAPUI5
Abstraction
The shell API provides functions for navigation and search in JavaScript-based applications that can run in different environments:
- A shell, like SAP NetWeaver Business Client or SAP Enterprise Portal
- Directly in a Web browser
Applications can use this API to trigger shell-related functionality, such as navigation.
The shell API provides an abstraction from the environment where the JavaScript code is executed. If you use the shell API, the system adapts its behavior depending on the the environment where the code is executed.
Example
For example, you can create a page with a launchpad link that starts an ABAP transaction (see method navigateToUrl below). If a user clicks this link in NWBC for Desktop, the transaction is displayed in SAPGUI for Windows (if SAPGUI for Windows is installed on the client PC). If a user clicks the same link on a standalone page in a Web browser, the transaction is displayed in SAPGUI for HTML.
Methods
The shell API provides the following methods:
| Method | Description | Supported Environments |
|---|---|---|
| navigateToUrl |
Allows you to navigate to the target of a URL. The following types of URLs are supported:
|
NWBC for Desktop 4.0 SAP Enterprise Portal Standalone page in Web browser |
| addSearchProvider |
Allows you to programatically add a search provider in SAP NetWeaver Business Client. This method has neutral behavior (null object pattern) if it is run in an environment that is not supported (for example, in a standalone page in a Web browser). |
NWBC for Desktop 4.0 |
Propagating Settings to SAPUI5
The shell API reads user-specific settings from the back-end system and propagates these to SAPUI5.
The following settings are read from the back-end system:
- Decimal Notation
- Date Format
- Time Format
In the back-end system, users can change these settings by choosing .
In an SAP NWBC 4.0 Desktop environment, users select a language on the logon screen. In a Portal environment, users can select a language by choosing PersonalizePortal.
| Setting | Example | Description |
|---|---|---|
| Language | en_US |
In an SAP NWBC 4.0 Desktop environment, users select a language on the logon screen. In a Portal environment, users can select a language by choosing PersonalizePortal. You can override the language by using the URL parameter sap-language. |
| RTL | false | Indicates right-to-left writing direction. |
| ABAP number format | -1.234.567,89 | This format is read from the back-end system. |
| ABAP date format | 13.01.2013 | This format is read from the back-end system. |
| ABAP time format | 14:32:29 | This format is read from the back-end system. |

