Wrapper object to expose a variant interface on a ContextContainer object obtained from the Peronalization service: getContainer(...).done( function(oContainer) { that.oVariantSetContainer = new sap.ushell.services.Personalization.VariantSetAdapater(oContainer); });
Since: 1.18.0.
Method Summary
addVariantSet(sVariantSetKey)Creates a new variant set in the container. containsVariantSet(sVariantSetKey)Checks if a specific variant set is contained in the container. delVariantSet(sVariantSetKey)Deletes a variant set from the container. getVariantSet(sVariantSetKey)Returns the variant set object from the container. getVariantSetKeys()Returns an array with the keys of the variant sets in the container. Constructor Detail
new sap.ushell.services.Personalization.VariantSetAdapter()
VariantSetAdapter amends ContextContainer with functionality to
Example: An application has two types of variants. Variant type 1 contains filter values for a query, which are stored in item 1 of the variant, and personalization data for a table, which are stored in item 2 of the variant. Variant type 2 contains a setting (item 3) that is independent of the filtering and the table settings. It might be used for a different screen than the variants of type 1. In this example you would have 2 variant sets, one for each variant type.
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.22.0
Returns:
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 |
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.22.0
getVariantSet(sVariantSetKey): object
Returns the variant set object from the container.
Parameters:
{string} | sVariantSetKey | variant set key The string length is restricted to 40 characters |
- Since:
- 1.22.0
Returns:
getVariantSetKeys(): array
Returns an array with the keys of the variant sets in the container.
- Since:
- 1.18.0
Returns: