Documentation Center

set_state

Set User State (personalization/filter).

Description

This function sets a user's personalization filter for a given publication. This new personalization will be used to drive all content filtering within the application.

Parameters

action
set_state
overwrite
If 'true', overwrite state. Otherwise, this function adds the state provided to the existing state in a union operation.
filter_id
If specified, a unique id which identifies a filter state.
lang
A language version of a publication.
pub
A publication, which is a logical grouping of information (topics and multimedia) related to a specific subject, containing one or more language versions.

Example URL

http://<host>:<port>/<context>/web/user.xql?action=set_state&overwrite=<value>&filter_id=<value>&lang=<value>&pub=<value>

Successful Result

This function returns a standard API result element (<result status='SUCCESS' statusCode='0' message='Localized Message' messageKey='message.key'/>). A statusCode of 0 indicates a successful execution. Any other statusCode indicates a failure.

Failed Result

Accessing this API feature requires the "Use application" permission, and the function will throw a permission exception if the permission is not available. In the case of an error, this function returns a standard API result element with a non-zero statusCode (such as, <result status='FAIL' statusCode='200' message='Localized Failure Message' messageKey='message.key'/>). Refer to API Error Code Reference.