The CQ_Analytics.ClientContextMgr object is a singleton that contains a set of self-registered session stores, and provides methods for registering, persisting, and managing the session stores.
Extends CQ_Analytics.PersistedSessionStore.
Returns a session store of a specified name. See also Accessing a Session Store.
Parameters
Returns
A CQ_Analytics.SessionStore object that represents the session store of the given name. Returns null
when no store exists of the given name.
Registers a session store with Client Context. Fires the storeregister and storeupdate events upon completion.
Parameters
Returns
No returned value.
Provides methods for listening for session store activation and registration. See also Checking That a Session Store is Defined and Initialized.
Registers a callback function that is called when a session store is initialized. For stores that are initialized several times, specify a callback delay so that the callback function is called only once:
For example, a session store is based on a JSON object and retrieved via a JSON request. The following intialization scenarios are possible:
When the delay is set to true
or a number of milliseconds, the method waits before calling the callback method. If another initialization event is triggered before the delay is passed, it will wait until the delay time is exceeded with no initialization event. This enables waiting for a second initialization event to be triggered and calls the callback function in the most optimal case.
Parameters
true
uses the default delay of 200 ms
. A boolean value of false
or a negative number causes no delay to be used.Returns
No returned value.
Registers a callback function that is called when a session store is registered. The register event occurs when a store is registered to CQ_Analytics.ClientContextMgr.
Parameters
Returns
No returned value.
A non-persisted session store that contains JSON data. The data is retrieved from an external JSONP service. Use the getInstance
or getRegisteredInstance
method to create an instance of this class.
Extends CQ_Analytics.JSONStore.
See CQ_Analytics.JSONStore and CQ_Analytics.SessonStore for inherited properties.
Also see CQ_Analytics.JSONStore and CQ_Analytics.SessonStore for inherited methods.
Creates a CQ_Analytics.JSONPStore object.
Parameters
Returns
The new CQ_Analytics.JSONPStore object, or null if storeName is null.
Retrieves the URL of the JSONP service that this object uses to retrieve JSON data.
Parameters
None.
Returns
A String that represents the service URL, or null if no service URL has been configured.
Calls the JSONP service. The JSONP URL is the service URL suffixed with a give callback function name.
Parameters
Returns
No returned value.
Creates a CQ_Analytics.JSONPStore object and registers the store with Client Context.
Parameters
Returns
The registered CQ_Analytics.JSONPStore object.
Sets the URL of the JSONP service to use for retrieving JSON data.
Parameters
Returns
No returned value.
A container for a JSON object. Create an instance of this class to create a non-persisted session store that contains JSON data:
myjsonstore = new CQ_Analytics.JSONStore
You can define a set of data that populates the store upon initialization.
Extends CQ_Analytics.SessionStore.
The key that identifies the store. Use the getInstance
method to retrieve this value.
The name of the store. Use the getInstance
method to retrieve this value.
Also see CQ_Analytics.SessionStore for inherited methods.
Removes the session store data and removes all initialization properties.
Parameters
None.
Returns
No returned value.
Creates a CQ_Analytics.JSONStore object with a given name and initialized with the given JSON data (calls the initJSON method).
Parameters
Returns
The CQ_Analytics.JSONStore object.
Retrieves the data of the session store in JSON format.
Parameters
None.
Returns
An object that represents the store data in JSON format.
Clears the session store and initializes it with the initialization property. Sets the initialization flag to true
and then fires the initialize
and update
events.
Parameters
None.
Returns
No returned data.
Creates initialization properties from the data in a JSON object. You can optionally remove all existing initialization properties.
The names of the properties are derived from the hierarchy of the data in the JSON object. The following example code represents a JSON object:
{
A: "valueA",
B: {
B1: "valueBB1"
}
}
For this example, the following properties are created in the store:
A: "valueA"
B/B1: "valueBB1"
Parameters
Returns
No returned value.
Creates a CQ_Analytics.JSONStore object with a given name and initialized with the given JSON data (calls the initJSON method). The new object is automatically registered with the Clickstream Cloud Manager.
Parameters
Returns
The CQ_Analytics.JSONStore object.
Fires events and allows other objects to listen to these events and react. Classes that extend this class can fire events that cause listeners to be called.
Registers a listener for an event. See also Creating a Listener to React to a Session Store Update.
Parameters
Returns
No returned value.
Removes the given event handler for an event.
Parameters
Returns
No returned value.
A persisted container of a JSON object retrieved from a remote JSONP service.
Extends CQ_Analytics.PersistedJSONStore.
Also see CQ_Analytics.PersistedJSONStore for inherited methods.
Creates a CQ_Analytics.PersistedJSONPStore object.
Parameters
Returns
The new CQ_Analytics.PersistedJSONPStore object, or null if storeName is null.
Retrieves the URL of the JSONP service that this object uses to retrieve JSON data.
Parameters
None.
Returns
A String that represents the service URL, or null if no service URL has been configured.
Calls the JSONP service. The JSONP URL is the service URL suffixed with a give callback function name.
Parameters
Returns
No returned value.
Creates a CQ_Analytics.PersistedJSONPStore object and registers the store with Client Context.
Parameters
Returns
The registered CQ_Analytics.PersistedJSONPStore object.
Sets the URL of the JSONP service to use for retrieving JSON data.
Parameters
Returns
No returned value.
A persisted container of a JSON object.
Extends CQ_Analytics.PersistedSessionStore
.
The key that identifies the store. Use the getInstance
method to retrieve this value.
The name of the store. Use the getInstance
method to retrieve this value.
Also see CQ_Analytics.PersistedSessionStore for inherited methods.
Creates a CQ_Analytics.PersistedJSONStore object with a given name and initialized with the given JSON data (calls the initJSON method).
Parameters
Returns
The CQ_Analytics.PersistedJSONStore object.
Retrieves the data of the session store in JSON format.
Parameters
None.
Returns
An object that represents the store data in JSON format.
Creates initialization properties from the data in a JSON object. You can optionally remove all existing initialization properties.
The names of the properties are derived from the hierarchy of the data in the JSON object. The following example code represents a JSON object:
{
A: "valueA",
B: {
B1: "valueBB1"
}
}
For this example, the following properties are created in the store:
A: "valueA"
B/B1: "valueBB1"
Parameters
Returns
No returned value.
Creates a CQ_Analytics.PersistedJSONStore object with a given name and initialized with the given JSON data (calls the initJSON method). The new object is automatically registered with the Client Context Manager.
Parameters
Returns
The CQ_Analytics.PersistedJSONStore object.
A container of properties and values. The data is persisted using CQ_Analytics.SessionPersistence. Create an instance of this class to create a persisted session store:
mypersistedstore = new CQ_Analytics.PersistedSessionStore
Extends CQ_Analytics.SessionStore.
Default value is key
.
See CQ_Analytics.SessionStore for inherited methods.
When the inherited methods clear
, setProperty
, setProperties
, removeProperty
are used to change the store data, the changes are automatically persisted, unless the changed properties are flagged as notPersisted.
Retrieves the STOREKEY
property.
Parameters
None
Returns
The value of the STOREKEY
property.
Determines whether a data property is persisted.
Parameters
Returns
A Boolean value of true
if the property is persisted, and a value of false
if the value is not a persisted property.
Persists the session store. The default persistence mode uses browser localStorage
using ClientSidePersistence
as the name ( window.localStorage.set("ClientSidePersistance", store);
)
If localStorage is not available or writeable, then the store is persisted as a property of the window.
Fires the persist
event upon completion.
Parameters
None
Returns
No returned value.
Removes all data properties from the store and persists the store. Optionally does not fire the udpate
event upon completion.
Parameters
update
event from being fired. A value of false
causes the update event to fire.Returns
No returned value.
Flags a data property as not persisted.
Parameters
Returns
No return value.
CQ_Analytics.SessionStore represents a session store. Create an instance of this class to create a session store:
mystore = new CQ_Analytics.SessionStore
Extends CQ_Analytics.Observable.
The name of the session store. Use getName to retrieve the value of this property.
Adds a property and value to the session store initialization data.
Use loadInitProperties to populate the session store data with the initialization values.
Parameters
Returns
No returned value.
Removes all data properties from the store.
Parameters
None.
Returns
No return value.
Returns the store data. Optionally, excludes name properties from the data. Calls the init
method if the data property of the store does not exist.
Parameters
excluded: (Optional) An array of property names to exclude from the returned data.
Returns
An object of properties and their values.
Retrieves the value of a data property.
Parameters
Returns
The value of the data property. Returnes null
if the session store contains no property of the given name.
Returns the name of the session store.
Parameters
None.
Returns
A String value that represents the store name.
Returns the value of a property. The value is returned as the raw property or the XSS-filtered value. Calls the init
method if the data property of the store does not exist.
Parameters
Returns
The value of the data property.
Returns the names of the properties that the session store contains. Calls the init
method if the data property of the store does not exist.
Parameters
excluded: (Optional) An array of property names to omit from the results.
Returns
An array of String values that represent the session property names.
Returns the session store attached to the current object.
Parameters
None.
Returns
this
Marks the store as initialized and fires the initialize
event.
Parameters
None.
Returns
No returned value.
Indicates whether the sessions store is initialized.
Parameters
None.
Returns
A value of true
if the store is initialized, and a value of false
if the store is not initialized.
Adds the properties of a given object to the intialization data of the session store. Optionally, the object data is also added to the store data.
Parameters
Returns
No returned value.
Removes a property from the session store. Fires the update
event upon completion. Calls the init
method if the data property of the store does not exist.
Parameters
Returns
No returned value.
Restores the initial values of the data store. The default implementation simply removes all data. Fires the update
event upon completion.
Parameters
None.
Returns
No returned value.
Sets the values of multiple properties. Fires the update
event upon completion. Calls the init
method if the data property of the store does not exist.
Parameters
Returns
No returned value.
Sets the value of a property. Fires the update
event upon completion. Calls the init
method if the data property of the store does not exist.
Parameters
Returns
No returned value.