Zimlet JavaScript API Reference - ZmSetting

Class ZmSetting


Extends ZmModel.

This class represents a single setting. A setting's default value never changes; it is available in case the user wishes to restore the current value to the default. Most but not all settings have a corollary on the server side. Settings that don't will depend on the environment or user activity to get their value.

Defined in: ZmSetting.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmSetting(id, params)
Creates a setting.
Field Summary
Field Attributes Field Name and Description
<static>  
ZmSetting.ACL_AUTH
Defines the "all" ACL grantee type.
<static>  
ZmSetting.ACL_DOMAIN
Defines the "domain" ACL grantee type.
<static>  
ZmSetting.ACL_GROUP
Defines the "group" ACL grantee type.
<static>  
ZmSetting.ACL_NONE
Defines the "none" ACL grantee type.
<static>  
ZmSetting.ACL_PUBLIC
Defines the "public" ACL grantee type.
<static>  
ZmSetting.ACL_USER
Defines the "user" ACL grantee type.
<static>  
ZmSetting.T_CONFIG
Defines the "config" type.
<static>  
ZmSetting.T_COS
Defines the "COS" type.
<static>  
ZmSetting.T_DOMAIN
Defines the "domain" type.
<static>  
ZmSetting.T_METADATA
Defines the "meta-data" type.
<static>  
ZmSetting.T_PREF
Defines the "pref" type.
<static>  
ZmSetting.T_PSEUDO
Defines the "pseudo" type.
Method Summary
Method Attributes Method Name and Description
 
getDefaultValue(key, serialize)
Gets the default value of this setting.
 
getOrigValue(key, serialize)
Gets the original value of this setting.
 
getValue(key, serialize)
Gets the current value of this setting.
 
Handles modify notification.
 
setValue(value, key, setDefault, skipNotify, skipImplicit)
Sets the current value of this setting, performing any necessary data type conversion.
 
Returns a string representation of the object.
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmSetting(id, params)
Creates a setting.
Author: Conrad Damon.
Parameters:
{String} id
a unique ID
{Hash} params
a hash of parameters
{String} params.name
the name of the pref or attr on the server
{constant} params.type
config, pref, or COS (see ZmSetting.T_ constants)
{constant} params.dataType
string, int, or boolean
{Object} params.defaultValue
the default value
{Boolean} params.isGlobal
if true, this setting is global across accounts
{Boolean} params.isImplicit
if true, this setting is not represented in Preferences
Field Detail
<static> {String} ZmSetting.ACL_AUTH
Defines the "all" ACL grantee type.

<static> {String} ZmSetting.ACL_DOMAIN
Defines the "domain" ACL grantee type.

<static> {String} ZmSetting.ACL_GROUP
Defines the "group" ACL grantee type.

<static> {String} ZmSetting.ACL_NONE
Defines the "none" ACL grantee type.

<static> {String} ZmSetting.ACL_PUBLIC
Defines the "public" ACL grantee type.

<static> {String} ZmSetting.ACL_USER
Defines the "user" ACL grantee type.

<static> ZmSetting.T_CONFIG
Defines the "config" type.

<static> ZmSetting.T_COS
Defines the "COS" type.

<static> ZmSetting.T_DOMAIN
Defines the "domain" type.

<static> ZmSetting.T_METADATA
Defines the "meta-data" type.

<static> ZmSetting.T_PREF
Defines the "pref" type.

<static> ZmSetting.T_PSEUDO
Defines the "pseudo" type.
Method Detail
{Object} getDefaultValue(key, serialize)
Gets the default value of this setting.
Parameters:
{String} key
the optional key for use by hash table data type
serialize
Returns:
{Object} the value

{Object} getOrigValue(key, serialize)
Gets the original value of this setting.
Parameters:
{String} key
the optional key for use by hash table data type
{Boolean} serialize
if true, serialize non-string value into string
Returns:
{Object} the value

{Object} getValue(key, serialize)
Gets the current value of this setting.
Parameters:
{String} key
the optional key for use by hash table data type
{Boolean} serialize
if true, serialize non-string value into string
Returns:
{Object} the value

notifyModify(obj)
Handles modify notification.
Parameters:
{Object} obj
the object

setValue(value, key, setDefault, skipNotify, skipImplicit)
Sets the current value of this setting, performing any necessary data type conversion.
Parameters:
{Object} value
the new value for the setting
{String} key
optional key for use by hash table data type
{Boolean} setDefault
if true, also set the default value
{Boolean} skipNotify
if true, do not notify listeners
{Boolean} skipImplicit
if true, do not check for change to implicit pref

{String} toString()
Returns a string representation of the object.
Returns:
{String} a string representation of the object

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:39 GMT-0400 (EDT)