CustomizationService

App.customization.CustomizationService~ CustomizationService

This is a singleton instance, use methods on App.customization.customizationService

Constructor

new CustomizationService()

Methods

clear()

Clears local customization map

deleteAll() → {*|Promise}

Deletes all customizations on server as well as locally stored ones.

Returns:
Type
* | Promise

deleteById(namespace, id)

Delete customization identified by id

Parameters:
Name Type Description
namespace string

defines ajax endpoint to be used for storing customization, refer

App.customization.namespaces.*

id string

id for customization to be deleted

getById(id) → (nullable) {object}

Returns customization identified by id (idHash)

Parameters:
Name Type Description
id string

id for which customization is needed

Returns:

customization payload if available

Type
object

parse(data) → {*}

Common method of extract & store customization from input json. Note this mutates input argument and removes "customization" property

Parameters:
Name Type Description
data object
Returns:

Mutated input

Type
*

parseDashboard(dashboard) → {*}

Extract & store customization from input json. Note this mutates input argument and removes "customization" property

Parameters:
Name Type Description
dashboard object
Returns:
Type
*

parsePage(page) → {*}

Extract & store customization from input json. Note this mutates input argument and removes "customization" property

Parameters:
Name Type Description
page object
Returns:

Mutated input

Type
*

parseTabSet(tabset) → {*}

Extract & store customization from input json. Note this mutates input argument and removes "customization" property

Parameters:
Name Type Description
tabset object
Returns:

Mutated input

Type
*

parseWidget(widget) → {*}

Extract & store customization from input json. Note this mutates input argument and removes "customization" property

Parameters:
Name Type Description
widget object
Returns:

Mutated input

Type
*

save(namespace, id, payload) → {*}

Persists customization on server as well as updates local customization map

Parameters:
Name Type Description
namespace string

defines ajax endpoint to be used for storing customization, refer

App.customization.namespaces.*

id string

unique identifier for the customization

payload string

actual customization object, should be valid JSON object

Returns:

customization

Type
*