Class sap.ushell.services.BookmarkModule: sap/ushell/services/Bookmark


The unified shell's bookmark service, which allows you to create shortcuts on the user's home page.


Since: 1.15.0.
Constructor Summary
new sap.ushell.services.Bookmark()This method MUST be called by the Unified Shell's container only, others MUST call sap.ushell.Container.getService("Bookmark").
Method Summary
addBookmark(oParameters)Adds a bookmark to the user's home page.
addCatalogTileToGroup(sCatalogTileId, sGroupId?, oCatalogData?)Adds the catalog tile with the given ID to given group.
countBookmarks(sUrl)Counts all bookmarks pointing to the given URL from all of the user's pages.
deleteBookmarks(sUrl)Deletes all bookmarks pointing to the given URL from all of the user's pages.
updateBookmarks(sUrl, oParameters)Updates all bookmarks pointing to the given URL on all of the user's pages with the given new parameters.
Constructor Detail
new sap.ushell.services.Bookmark()
This method MUST be called by the Unified Shell's container only, others MUST call sap.ushell.Container.getService("Bookmark"). Constructs a new instance of the bookmark service.
See:
sap.ushell.services.Container#getService
Method Detail
addBookmark(oParameters): object
Adds a bookmark to the user's home page.
Parameters:
{object}oParameters Bookmark parameters. In addition to title and URL, a bookmark might allow additional settings, such as an icon or a subtitle. Which settings are supported depends on the environment in which the application is running. Unsupported parameters will be ignored.
{string}oParameters.title The title of the bookmark.
{string}oParameters.url The URL of the bookmark. If the target application shall run in the Shell the URL has to be in the format "#SO-Action~Context?P1=a&P2=x&/route?RPV=1"
{string}oParameters.icon? The icon URL of the bookmark (e.g. "sap-icon://home").
{string}oParameters.info? The information text of the bookmark.
{string}oParameters.subtitle? The subtitle of the bookmark.
{string}oParameters.serviceUrl? The URL (a string or a JS function) to a REST or OData service that provides some dynamic information for the bookmark.
{string}oParameters.serviceRefreshInterval? The refresh interval for the serviceUrl in seconds.
{string}oParameters.numberUnit? The unit for the number retrieved from serviceUrl.
Since:
1.15.0
Returns:
{object} A jQuery.Deferred object's promise which informs about success or failure of this asynchronous operation. In case of success, no further details are passed. In case of failure, an error message is passed.
See:
sap.ushell.services.URLParsing#getShellHash
addCatalogTileToGroup(sCatalogTileId, sGroupId?, oCatalogData?): object
Adds the catalog tile with the given ID to given group. The catalog tile is looked up in the legacy SAP HANA catalog unless data to look up a remote catalog is provided.
Parameters:
{string}sCatalogTileId The ID of the tile within the catalog
{string}sGroupId? The id of the group. If not given, the tile is added to the default group
{object}oCatalogData? The data to identify the catalog containing the tile with the given ID
{string}oCatalogData.baseUrl The remote catalog's base URL such as "/sap/hba/apps/kpi/s/odata/hana_chip_catalog.xsodata/"
{string}oCatalogData.remoteId The remote catalog's id on the remote system such as "HANA_CATALOG"
Since:
1.21.2
Returns:
{object} A jQuery.Deferred object's promise which informs about success or failure of this asynchronous operation. In case of success, no further details are passed. In case of failure, an error message is passed.
countBookmarks(sUrl): object
Counts all bookmarks pointing to the given URL from all of the user's pages. You can use this method to check if a bookmark already exists.

This is a potentially asynchronous operation in case the user's pages have not yet been loaded completely!

Parameters:
{string}sUrl The URL of the bookmarks to be counted, exactly as specified to addBookmark.
Since:
1.17.1
Returns:
{object} A jQuery.Deferred object's promise which informs about success or failure of this asynchronous operation. In case of success, the count of existing bookmarks is provided (which might be zero). In case of failure, an error message is passed.
See:
#addBookmark
deleteBookmarks(sUrl): object
Deletes all bookmarks pointing to the given URL from all of the user's pages.
Parameters:
{string}sUrl The URL of the bookmarks to be deleted, exactly as specified to addBookmark.
Since:
1.17.1
Returns:
{object} A jQuery.Deferred object's promise which informs about success or failure of this asynchronous operation. In case of success, the number of deleted bookmarks is provided (which might be zero). In case of failure, an error message is passed.
See:
#addBookmark
#countBookmarks
updateBookmarks(sUrl, oParameters): object
Updates all bookmarks pointing to the given URL on all of the user's pages with the given new parameters. Parameters which are omitted are not changed in the existing bookmarks.
Parameters:
{string}sUrl The URL of the bookmarks to be updated, exactly as specified to addBookmark. In case you need to update the URL itself, pass the old one here and the new one as oParameters.url!
{object}oParameters The bookmark parameters as documented in addBookmark.
Since:
1.17.1
Returns:
{object} A jQuery.Deferred object's promise which informs about success or failure of this asynchronous operation. In case of success, the number of updated bookmarks is provided (which might be zero). In case of failure, an error message is passed.
See:
#addBookmark
#countBookmarks
#deleteBookmarks