Class sap.ushell.services.PersonalizationContainerModule: sap/ushell/services/Personalization
The personalization container is the anchor object of the unified shell personalization in container mode.
Since: 1.18.0.
Constructor Summary
new sap.ushell.services.PersonalizationContainer()To be called by the personalization service getPersonalizationContainer method.
Method Summary
Constructor Detail
Method Detail
addVariantSet(sVariantSetKey): object
Creates a new variant set in the container. In case a variant set with this key is already existing an exception is thrown.
Parameters:
{string} | sVariantSetKey | variant set key |
- Since:
- 1.18.0
Returns:
{object} | sap.ushell.services.PersonalizationContainerVariantSet |
containsItem(sItemKey): boolean
Checks if a specific direct item is contained in the container.
Parameters:
{string} | sItemKey | item key |
- Since:
- 1.18.0
Returns:
{boolean} | true if the container contains a direct item with the key |
containsVariantSet(sVariantSetKey): boolean
Checks if a specific variant set is contained in the container.
Parameters:
{string} | sVariantSetKey | variant set key |
- Since:
- 1.18.0
Returns:
{boolean} | true if the container contains a variant set with the key |
delItem(sItemKey)
Deletes a direct item from the container. In case the item does not exist, nothing happens.
Parameters:
{string} | sItemKey | item key |
- Since:
- 1.18.0
delVariantSet(sVariantSetKey)
Deletes a variant set from the container. In case the variant set does not exist nothing happens.
Parameters:
{string} | sVariantSetKey | variant set key |
- Since:
- 1.18.0
getItemKeys(): array
Returns an array with the keys of direct items in the container.
- Since:
- 1.18.0
Returns:
{array} | item keys |
getItemValue(sItemKey): object
Returns the value for a direct item from the container.
Parameters:
{string} | sItemKey | item key |
- Since:
- 1.18.0
Returns:
{object} | item value (JSON object). In case the container does not contain a direct item with this key undefined is returned. |
getVariantSet(sVariantSetKey): object
Returns the variant set object from the container.
Parameters:
{string} | sVariantSetKey | variant set key |
- Since:
- 1.18.0
Returns:
{object} | sap.ushell.services.PersonalizationContainerVariantSet. In case the container does not contain a variant set with this key undefined is returned. |
getVariantSetKeys(): array
Returns an array with the keys of the variant sets in the container.
- Since:
- 1.18.0
Returns:
{array} | variant set keys |
load(): object
(Re)loads the current container data from the underlying storage asynchronously. The current local data is discarded.
Returns a promise for the load operation. If another save/load/delete operation is not completed, the operation may fail! (wait for the other promise).
Synchronous read and write operations before the load is done have undefined effects.
- Since:
- 1.18.0
Returns:
{object} | Promise object |
save(): object
Attempts to save the current container data at the underlying storage asynchronously. The current state is serialized.
- Since:
- 1.18.0
Returns:
{object} | Promise object If another save/load/delete operation is not completed, the operation may fail! (wait for the other promise). |
setItemValue(sItemKey, sItemValue)
Sets the value of a direct item in the container. In case the item is already existing its value is overwritten. In case it is not existing a new item with this key and value is created.
Parameters:
{string} | sItemKey | item key |
{object} | sItemValue | item value (JSON object) |
- Since:
- 1.18.0