Class Index | Minimal

Classes


Class jabberwerx.PrivacyListController


Extends jabberwerx.Controller.

Controller class for privacy lists functionality.

This class provides the following events:

Class Summary
Constructor Attributes Constructor Name and Description
 

Creates a new PrivacyListController with the given client.

Fields borrowed from class jabberwerx.Controller:
client, name
Method Summary
Method Attributes Method Name and Description
 
apply(list, callback)

Sets the active privacy list (or null/undefined to clear active).

 

Destroys privacy list controller and removes any event callbacks it registered.

 
fetch(list, callback)

Fetch a privacy list by name, creates jabberwerx.PrivacyList object and adds it to the map.

Methods borrowed from class jabberwerx.Controller:
cleanupEntity, removeEntity, updateEntity
Methods borrowed from class jabberwerx.JWModel:
applyEvent, event, shouldBeSavedWithGraph
Methods borrowed from class jabberwerx.JWBase:
getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Class Detail
jabberwerx.PrivacyListController(client)

Creates a new PrivacyListController with the given client.

Parameters:
{jabberwerx.Client} client
The client object to use for communicating to the server
Throws:
{TypeError}
If {client} is not an instance of jabberwerx.Client
Method Detail
apply(list, callback)

Sets the active privacy list (or null/undefined to clear active).

Parameters:
{String} list
Name of the privacy list.
{function} callback Optional
The function called after the server response is processed. If a server error occurs, the function will be passed the error stanza response.

The signature of the function is callback(errorStanza).

The callback will be invoked in the context of the PrivacyListController e.g. callback.call(this, errorStanza). Therefore in the callback method this will refer to the instance of PrivacyListController and so this.client will retrieve the jabberwerx.Client object.

Throws:
{jabberwerx.Client.NotConnectedError}
If the jabberwerx.Client is not connected
{TypeError}
If {list} is not a <string/><PrivacyList/>

destroy()

Destroys privacy list controller and removes any event callbacks it registered.


fetch(list, callback)

Fetch a privacy list by name, creates jabberwerx.PrivacyList object and adds it to the map.

Parameters:
{String} list
Name of the privacy list.
{function} callback Optional
The function called after the server response is processed. If a server error occurs, the function will be passed the error stanza response.

The signature of the function is callback(errorStanza).

e.g. callback.call(this, errorStanza). Therefore in the callback method this will refer to the instance of PrivacyListController and so this.client will retrieve the jabberwerx.Client object

Throws:
{TypeError}
If {list} is not a <string/><PrivacyList/>
{jabberwerx.Client.NotConnectedError}
If the jabberwerx.Client is not connected

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 02 2014 13:23:42 GMT-0600 (MDT)