Class sap.ushell.services.Personalization.ContextContainerModule: sap/ushell/services/Personalization


The container is the anchor object of the unified shell personalization in container mode.


Since: 1.22.0.
Constructor Summary
new sap.ushell.services.Personalization.ContextContainer()To be called by the personalization service getContainer method.
Method Summary
_getInternalKeys()Returns an array with all internal keys of direct items in the container.
clear()clears the local copy data of this container
containsItem(sItemKey)Checks if a specific direct item is contained in the container.
delItem(sItemKey)Deletes a direct item from the container.
flush()flush all pending request; The result of the promise may reflect the last pending operation in the queue
getItemKeys()Returns an array with the keys of direct items in the container.
getItemValue(sItemKey)Returns the value for a direct item from the container.
getKey()return the container key as a string variable
getUnmodifiableContainer()Return an instance unmodifiable container instance.
load()(Re)loads the current container data from the underlying storage asynchronously.
save()Attempts to save the current container data at the underlying storage asynchronously.
saveDeferred()Save the current container data at the underlying storage asynchronously at the earlies nDelayInMilliseconds seconds before.
setItemValue(sItemKey, sItemValue)Sets the value of a direct item in the container.
getValidity()return the validity of this container
Constructor Detail
new sap.ushell.services.Personalization.ContextContainer()
To be called by the personalization service getContainer method.
Method Detail
_getInternalKeys(): array
Returns an array with all internal keys of direct items in the container.
Since:
1.22.0
Returns:
{array} item keys
clear()
clears the local copy data of this container
Since:
1.22.0
containsItem(sItemKey): boolean
Checks if a specific direct item is contained in the container.
Parameters:
{string}sItemKey item key
Since:
1.22.0
Returns:
{boolean}true if the container contains a direct item 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.22.0
flush(): object
flush all pending request; The result of the promise may reflect the last pending operation in the queue
Since:
1.22.0
Returns:
{object} promise
getItemKeys(): array
Returns an array with the keys of direct items in the container.
Since:
1.22.0
Returns:
{array} item keys
getItemValue(sItemKey): object
Returns the value for a direct item from the container. (Value semantics, new copy is returned)
Parameters:
{string}sItemKey item key
Since:
1.22.0
Returns:
{object} item value (JSON object). In case the container does not contain a direct item with this key undefined is returned.
getKey(): string
return the container key as a string variable
Since:
1.28.0
Returns:
{string} the container key
getUnmodifiableContainer(): object
Return an instance unmodifiable container instance. There is one instance of this wrapper per container. It will permit all read accesses to the container, but block all modifying accesses.
Since:
1.28.0
Returns:
{object} unmodifiable wrapper instance
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.22.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.22.0
Returns:
{object} Promise object

If another save/load/delete operation is not completed, the operation may fail! (wait for the other promise).

saveDeferred(): object
Save the current container data at the underlying storage asynchronously at the earlies nDelayInMilliseconds seconds before. The current state is serialized.
Since:
1.22.0
Returns:
{object} Promise object

The operation may wait for completion of another pending operation.

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. The value is serialized during set
Parameters:
{string}sItemKey item key The string length is restricted to 40 characters
{object}sItemValue item value (JSON object)
Since:
1.22.0
getValidity()
return the validity of this container
Deprecated:
only for testing!
Since:
1.22.0