Class sap.ushell.services.LaunchPageModule: sap/ushell/services/LaunchPage


The Unified Shell's page builder service.


Since: 1.15.0.
Constructor Summary
new sap.ushell.services.LaunchPage(oAdapter, oContainerInterface)This method MUST be called by the Unified Shell's container only, others MUST call sap.ushell.Container.getService("LaunchPage").
Method Summary
addGroup(sTitle)Adds a new group.
addGroupAt(sTitle, iIndex)Adds a new group at a specific location.
addTile(oCatalogTile, oGroup?)Adds a tile to a group.
getCatalogData(oCatalog)Returns catalog's technical data.
getCatalogError(oCatalog)Returns the catalog's technical error message in case it could not be loaded from the backend.
getCatalogId(oCatalog)Returns the catalog's unique identifier
getCatalogs()Returns the catalogs of the user.
getCatalogTileId(oTile)Returns catalog tile's unique identifier.
getCatalogTileKeywords(oCatalogTile)Returns the keywords associated with a catalog tile which can be used to find the catalog tile in a search.
getCatalogTilePreviewIcon(oCatalogTile)Returns preview icon for a catalog tile.
getCatalogTilePreviewTitle(oCatalogTile)Returns preview title for a catalog tile.
getCatalogTiles(oCatalog)Returns the tiles of a catalog.
getCatalogTileSize(oCatalogTile)Returns the size of a catalog tile as a string.
getCatalogTileTags(oCatalogTile)Returns the tags associated with a catalog tile which can be used to find the catalog tile in a tag filter.
getCatalogTileTargetURL(oCatalogTile)Returns the navigation target URL of a catalog tile.
getCatalogTileTitle(oCatalogTile)Returns the catalog tile's title
getCatalogTileView(oCatalogTile)Returns the UI5 view or control of a catalog tile
getCatalogTitle(oCatalog)Returns the catalog's title
getDefaultGroup()Returns the default group of the user.
getGroupId(oGroup)Returns the unique identifier of the given group
getGroups()Returns the groups of the user.
getGroupTiles(oGroup)Returns an array of 'anonymous' tiles of a group.
getGroupTitle(oGroup)Returns the title of the given group.
getLinkTiles(oGroup)Returns an array of link tiles for a group.
getTileId(oTile)Returns the tile's unique identifier
getTileSize(oTile)Returns the tile size in the format of 1x1 or 1x2 string
getTileTarget(oTile)Returns the tile's navigation target.
getTileTitle(oTile)Returns the tile's title.
getTileType(oTile)Returns the tile's type.
getTileView(oTile)Returns UI5 view or control of the tile.
isCatalogsValid()Returns whether the catalogs collection previously returned by getCatalogs() is still valid.
isGroupLocked(oGroup)Checks if a group was marked as locked (meaning the group and its tiles will lack several capabilities such as Rename, Drag&Drop.
isGroupRemovable(oGroup)Checks if a group can be removed.
moveGroup(oGroup, iNewIndex)Moves a group to a new index (i.e.
moveTile(oTile, iSourceIndex, iTargetIndex, oSourceGroup, oTargetGroup?)Moves a tile within a group or between different groups.
refreshTile(oTile)Triggers a refresh action of a tile.
registerTileActionsProvider(fnProvider)Register an external tile actions provider callback function.
removeGroup(oGroup, iIndex)Removes a group.
removeTile(oTile, oGroup, iIndex)Removes a tile from a group.
resetGroup(oGroup, iIndex)Resets a group.
setGroupTitle(sTitle, oGroup)Sets the title of an existing group.
setTileVisible(oTile, bNewVisible)Sets the tile's visibility state and notifies the tile about the change.
Constructor Detail
new sap.ushell.services.LaunchPage(oAdapter, oContainerInterface)
This method MUST be called by the Unified Shell's container only, others MUST call sap.ushell.Container.getService("LaunchPage"). Constructs a new instance of the page builder service.
Parameters:
{object}oAdapter the page builder adapter for the logon system
{object}oContainerInterface the interface provided by the container
See:
sap.ushell.services.Container#getService
Method Detail
addGroup(sTitle): object
Adds a new group.

In case of success, the done function gets the new added group object. Intention: the page builder adds this group to the end of the home screen.

In case of failure, the fail function returns the consistent (i.e. persisted) backend state of all groups.

Parameters:
{string}sTitle The title of the new group
Returns:
{object} jQuery.promise object
addGroupAt(sTitle, iIndex): object
Adds a new group at a specific location.

In case of success, the done function gets the new added group object. Intention: the page builder adds this group to the specific location on the home screen.

In case of failure, the fail function returns the consistent (i.e. persisted) backend state of all groups.

Parameters:
{string}sTitle The title of the new group
{integer}iIndex the location of the new group
Returns:
{object} jQuery.promise object
addTile(oCatalogTile, oGroup?): object
Adds a tile to a group.

If no group is provided then the tile is added to the default group.

In case of success, the done function returns the new tile. Intention: the page builder by default puts this tile at the end of the default group. In case of failure, the fail function should return the consistent (i.e. persisted) backend state of the default group.

Parameters:
{object}oCatalogTile An 'anonymous' tile from the tile catalog
{object}oGroup? The target group
Returns:
{object} jQuery.promise object
getCatalogData(oCatalog): object
Returns catalog's technical data.
Parameters:
{object}oCatalog the catalog
Since:
1.21.2
Returns:
{object} An object that includes the following properties (the list may include additional properties):
  • id: the catalog ID
  • systemId: [remote catalogs] the ID of the remote system
  • remoteId: [remote catalogs] the ID of the catalog in the remote system
  • baseUrl: [remote catalogs] the base URL of the catalog in the remote system
getCatalogError(oCatalog): string
Returns the catalog's technical error message in case it could not be loaded from the backend.

Beware: The technical error message is not translated!

Parameters:
{object}oCatalog the catalog
Since:
1.17.1
Returns:
{string} The technical error message or undefined if the catalog was loaded properly
getCatalogId(oCatalog): string
Returns the catalog's unique identifier
Parameters:
{object}oCatalog The catalog
Returns:
{string} Catalog id
getCatalogs(): object
Returns the catalogs of the user.

Only severe failures make the overall operation fail. If loading of a remote catalog fails, this is handled gracefully by providing a "dummy" empty catalog (with ID instead of title). Use getCatalogError to check if a (remote) catalog could not be loaded from the backend.

Progress notifications are sent for each single catalog, i.e. attaching a progress handler gives you the same possibilities as attaching a done handler, but with the advantage of improved responsiveness.

sap.ushell.Container.getService("LaunchPage").getCatalogs()
  .fail(function (sErrorMessage) { // string
    // handle error situation
  })
  .progress(function (oCatalog) { // object
    // do s.th. with single catalog
  })
  .done(function (aCatalogs) { // object[]
    aCatalogs.forEach(function (oCatalog) {
      // do s.th. with single catalog
    });
  });
Returns:
{object}jQuery.Deferred object's promise In case of success, an array of black-box catalog objects is provided (which might be empty). In case of failure, an error message is passed. Progress notifications are sent for each single catalog, providing a single black-box catalog object each time.
getCatalogTileId(oTile): string
Returns catalog tile's unique identifier. This function may be called for a catalog tile or (since 1.21.0) for a group tile. In the latter case, the function returns the unique identifier of the catalog tile on which the group tile is based.
Parameters:
{object}oTile The tile or the catalog tile
Returns:
{string} Tile id
getCatalogTileKeywords(oCatalogTile)
Returns the keywords associated with a catalog tile which can be used to find the catalog tile in a search. Note: getCatalogTileView must be called before this method. Otherwise the keywords may be incomplete.
Parameters:
{object}oCatalogTile The catalog tile
getCatalogTilePreviewIcon(oCatalogTile): string
Returns preview icon for a catalog tile.
Parameters:
{object}oCatalogTile The catalog tile
Since:
1.16.3
Returns:
{string} Preview icon as URL/URI for the catalog tile's underlying application as provided via the "preview" contract
getCatalogTilePreviewTitle(oCatalogTile): string
Returns preview title for a catalog tile.
Parameters:
{object}oCatalogTile The catalog tile
Since:
1.16.3
Returns:
{string} Preview title for the catalog tile's underlying application as provided via the "preview" contract
getCatalogTiles(oCatalog): object
Returns the tiles of a catalog. In case of success, the done function of the returned promise object gets an array of 'anonymous' tiles of the catalog.
Parameters:
{object}oCatalog The catalog
Returns:
{object} jQuery.promise object.
getCatalogTileSize(oCatalogTile): string
Returns the size of a catalog tile as a string. For example: "1x1", "1x2"
Parameters:
{object}oCatalogTile The catalog tile
Returns:
{string} Tile size in units in 1x1 or 1x2 format
getCatalogTileTags(oCatalogTile)
Returns the tags associated with a catalog tile which can be used to find the catalog tile in a tag filter.
Parameters:
{object}oCatalogTile The catalog tile
getCatalogTileTargetURL(oCatalogTile): string
Returns the navigation target URL of a catalog tile. If the catalog tile does not exist, this function implicitly instantiates it using getCatalogTileView(oCatalogTile).
Parameters:
{object}oCatalogTile The catalog tile
Returns:
{string} The target URL for the catalog tile's underlying application as provided via the "preview" contract
getCatalogTileTitle(oCatalogTile): string
Returns the catalog tile's title
Parameters:
{object}oCatalogTile The catalog tile
Returns:
{string} Tile title
getCatalogTileView(oCatalogTile): object
Returns the UI5 view or control of a catalog tile
Parameters:
{object}oCatalogTile The catalog tile
Returns:
{object} UI5 view or control
getCatalogTitle(oCatalog): string
Returns the catalog's title
Parameters:
{object}oCatalog The catalog
Returns:
{string} Catalog title
getDefaultGroup(): object
Returns the default group of the user. In case of success, the done function gets an 'anonymous' object representing the default group.
Returns:
{object} jQuery.promise object.
getGroupId(oGroup): string
Returns the unique identifier of the given group
Parameters:
{object}oGroup The group whose id is returned
Returns:
{string} Group id
getGroups(): object
Returns the groups of the user. In case of success, the done function gets an array of 'anonymous' groups. The order of the array is the order in which the groups will be displayed to the user.
Returns:
{object} jQuery.promise object.
getGroupTiles(oGroup): Array
Returns an array of 'anonymous' tiles of a group. The order of the array is the order of tiles that will be displayed to the user.
Parameters:
{object}oGroup The group whose tiles are returned
Returns:
{Array} The group tiles array
getGroupTitle(oGroup): string
Returns the title of the given group.
Parameters:
{object}oGroup The group whose title is returned
Returns:
{string} group title
getLinkTiles(oGroup): Array
Returns an array of link tiles for a group. The order of the array is the order in which the links will be displayed to the user.
Parameters:
{object}oGroup The group whose link tiles are returned
Returns:
{Array} The array of link tiles
getTileId(oTile): string
Returns the tile's unique identifier
Parameters:
{object}oTile The tile
Returns:
{string} Tile id
getTileSize(oTile): string
Returns the tile size in the format of 1x1 or 1x2 string
Parameters:
{object}oTile The tile
Returns:
{string} tile size in units in 1x1 format
getTileTarget(oTile): string
Returns the tile's navigation target.

The navigation target string is used (when assigned to location.hash) for performing a navigation action that eventually opens the application represented by the tile.

Parameters:
{object}oTile the tile
Returns:
{string} the tile target
getTileTitle(oTile): string
Returns the tile's title.
Parameters:
{object}oTile The tile
Returns:
{string} The title
getTileType(oTile): string
Returns the tile's type.
Parameters:
{object}oTile The tile
Returns:
{string} The type
getTileView(oTile): object
Returns UI5 view or control of the tile. In case of success the done function should return UI5 view or control of the tile. In case of failure the fail function should return nothing.
Parameters:
{object}oTile The tile
Returns:
{object} jQuery.promise object
isCatalogsValid(): boolean
Returns whether the catalogs collection previously returned by getCatalogs() is still valid.

Initially the result is false until getCatalogs() has been called. Later, the result might be false again in case one of the catalogs has been invalidated, e.g. due to adding a tile to a catalog ("Add to catalog" scenario).

Since:
1.16.4
Returns:
{boolean}true in case the catalogs are still valid; false if not
See:
#getCatalogs
isGroupLocked(oGroup): boolean
Checks if a group was marked as locked (meaning the group and its tiles will lack several capabilities such as Rename, Drag&Drop...).

Returns true if the group is locked and false if not.

Parameters:
{object}oGroup The group to be checked
Returns:
{boolean}true if locked; false if not (or as default in case the function was not implemented in the proper adapter).
isGroupRemovable(oGroup): boolean
Checks if a group can be removed.

Returns true if the group can be removed (i.e. if the given group was created by the user) and false if the group can only be reset.

Parameters:
{object}oGroup The group to be checked
Returns:
{boolean}true if removable; false if resettable
moveGroup(oGroup, iNewIndex): object
Moves a group to a new index (i.e. location).

In case of success, the done function is called without any value. Intention: the page builder already moved the page (visible to the user) and if successful - nothing needs to be done. In case of failure, the fail function returns the consistent (i.e. persisted) backend state of all groups.

Parameters:
{object}oGroup The group to be moved
{integer}iNewIndex The new index for the group
Returns:
{object} jQuery.promise object
moveTile(oTile, iSourceIndex, iTargetIndex, oSourceGroup, oTargetGroup?): object
Moves a tile within a group or between different groups.

In case of success, the done function returns nothing. Intention: the page builder already moved the tile.

In case of failure, the fail function returns the consistent (i.e. persisted) backend state of the source group and the target group. The result is in the following format {source:[{},{}], target:[{},{}]}.

The source and the target groups tiles are in the form of the @see sap.ushell.services.LaunchPage.getGroupTiles

Parameters:
{object}oTile a tile instance to be moved The same object type as the one returned by sap.ushell.services.LaunchPage.getGroupTiles
{integer}iSourceIndex the index in the source group
{integer}iTargetIndex the target group index, in case this parameter is not supplied we assume the move tile is within the source group using iSourceIndex
{object}oSourceGroup the source group the tile came from
{object}oTargetGroup? The same object type as the one returned by sap.ushell.services.LaunchPage.getGroups the target group the tile will be placed in, in case this parameter is not supplied we assume the move tile is within the source group
Returns:
{object} jQuery.promise object
refreshTile(oTile)
Triggers a refresh action of a tile. Typically this action is related to the value presented in dynamic tiles
Parameters:
{object}oTile The tile
registerTileActionsProvider(fnProvider)
Register an external tile actions provider callback function.

The callback has to return an array of actions of the given tile. The callback is triggered when

Parameters:
{Object}fnProvider A callback which returns an array of action objects.
of a tile actions provider callback:

    function (oTile){
         return [
                 {
                     text: "Some Action",
                     icon: "sap-icon://action",
                     targetURL: "#SemanticObject-Action"
                 },
                 {
                     text: "Settings",
                     icon: "sap-icon://action-settings",
                     press: function (){
                         //Open settings UI
                     }
                 }
             ];
      }
.

Use Function.prototype.bind() to determine the callback's this or some of its arguments.

See:
sap.ushell.services.LaunchPage.getTileActions is called.

Tile actions are additional operations that can be executed on a tile, and can be provided by external providers.

A tile action is an object with the following properties: text, icon and targetURL or a press handler.

Tile actions should be returned immediately without any additional server access in order to avoid delays in rendering the action list in the browser.

removeGroup(oGroup, iIndex): object
Removes a group.

In case of success, the done function is called without any value (i.e. input data). Intention: the page builder already removed the page (or hid it from the user) and if successful - nothing needs to be done.

In case of failure, the fail function returns the consistent (i.e. persisted) backend state of all groups.

Parameters:
{object}oGroup The group to be removed
{integer}iIndex The index of the group to be removed
Returns:
{object} jQuery.promise object
removeTile(oTile, oGroup, iIndex): object
Removes a tile from a group.

In case of success, the done function returns the new tile. Intention: the page builder has already 'hidden' (or removed) the tile.

In case of failure, the fail function should return the consistent (i.e. persisted) backend state of the group.

Parameters:
{object}oTile The tile instance to remove
{object}oGroup The group from which to remove the tile instance
{integer}iIndex The tile index
Returns:
{object} jQuery.promise object
resetGroup(oGroup, iIndex): object
Resets a group.

The reset action is relevant for a group that was assigned to the user by an administrator. The reset action means that the group is set back to the state defined by the administrator, and changes made by the end user (e.g. adding tiles) are removed. A group can be reset multiple times.

In case of success, the done function gets the reset group object.

In case of failure, or when the given group was created by the user (i.e. can't be reset)- fail handler is called, returning the consistent (i.e. persisted) backend state of all groups. The returned group object is the same as the one returned by @see sap.ushell.services.LaunchPage.getGroups

Parameters:
{object}oGroup The group to be reset
{integer}iIndex The index of the group to be reset
Returns:
{object} jQuery.promise object
setGroupTitle(sTitle, oGroup): object
Sets the title of an existing group.

In case of success, the done function returns nothing. Intention: the page builder knows the new title, and if successful nothing needs to be done, as the title is already visible to the user. In case of failure, the fail function returns the consistent (i.e. persisted) backend state of the group title, in most cases the old title.

Parameters:
{string}sTitle The new title of the group
{object}oGroup The group whose title is set
Returns:
{object} jQuery.promise object
setTileVisible(oTile, bNewVisible)
Sets the tile's visibility state and notifies the tile about the change.
Parameters:
{object}oTile The tile
{boolean}bNewVisible The tile's required visibility state.