Zimlet JavaScript API Reference - ZmFilterRules

Class ZmFilterRules


Extends ZmModel.

This class represents a set of filter rules. The rules are maintained in a AjxVector and have an order. Each rule is a ZmFilterRule. Filter rules can be added and edited via a ZmFilterRuleDialog.

Defined in: ZmFilterRules.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmFilterRules(accountName, outgoing)
Creates a filter rules object.
Method Summary
Method Attributes Method Name and Description
 
addRule(rule, referenceRule, callback)
Adds a rule to the list.
 
Gets the active rules in the list.
 
Gets the numeric index of the rule in the list.
 
Gets the number of rules in the list.
 
Gets a rule based on its ID.
 
Gets a rule based on its index.
 
Gets a rule by name.
 
insertRule(rule, index)
Public method to insert rule into internval vectors.
 
loadRules(force, callback)
Loads the rules from the server.
 
moveDown(rule)
Moves a rule down in the list.
 
moveToBottom(rule, skipSave)
Moves a rule to the bottom of the list.
 
moveUp(rule)
Moves a rule up in the list.
 
removeRule(rule)
Removes a rule from the list.
 
saveRules(index, notify, callback)
Public method to save the rules to the server.
 
setActive(rule, active)
Marks a rule as active/inactive.
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmFilterRules(accountName, outgoing)
Creates a filter rules object.
Author: Conrad Damon.
Parameters:
{String} accountName
the name of the account this set of filter rules belongs to
outgoing
Method Detail
addRule(rule, referenceRule, callback)
Adds a rule to the list.
Parameters:
{ZmFilterRule} rule
the rule to be added
{ZmFilterRule} referenceRule
the rule after which to add the new rule
{AjxCallback} callback
the callback

{AjxVector} getActiveRules()
Gets the active rules in the list.
Returns:
{AjxVector} the active rules

{int} getIndexOfRule(rule)
Gets the numeric index of the rule in the list.
Parameters:
{ZmFilterRule} rule
a rule
Returns:
{int} the index

{int} getNumberOfRules()
Gets the number of rules in the list.
Returns:
{int} the number of rules

{ZmFilterRule} getRuleById(id)
Gets a rule based on its ID.
Parameters:
{String} id
the rule ID
Returns:
{ZmFilterRule} the rule

{ZmFilterRule} getRuleByIndex(index)
Gets a rule based on its index.
Parameters:
{int} index
the index
Returns:
{ZmFilterRule} the rule

{ZmFilterRule} getRuleByName(name)
Gets a rule by name.
Parameters:
{String} name
the rule name
Returns:
{ZmFilterRule} the rule

insertRule(rule, index)
Public method to insert rule into internval vectors. Adds to the end if no index is given.
Parameters:
{ZmFilterRule} rule
the rule to insert
{int} index
the index at which to insert

loadRules(force, callback)
Loads the rules from the server.
Parameters:
{Boolean} force
if true, get rules from server
{AjxCallback} callback
the callback

moveDown(rule)
Moves a rule down in the list. If the rule is the last in the list, it isn't moved.
Parameters:
{ZmFilterRule} rule
the rule to be moved

moveToBottom(rule, skipSave)
Moves a rule to the bottom of the list. If the rule is the last in the list, it isn't moved.
Parameters:
rule
{ZmFilterRule} rule the rule to be moved
skipSave
{boolean} true to not save

moveUp(rule)
Moves a rule up in the list. If the rule is the first in the list, it isn't moved.
Parameters:
{ZmFilterRule} rule
the rule to be moved

removeRule(rule)
Removes a rule from the list.
Parameters:
{ZmFilterRule} rule
the rule to be removed

saveRules(index, notify, callback)
Public method to save the rules to the server.
Parameters:
{int} index
the index of rule to select in list after save
{Boolean} notify
if true, notify listeners of change event
{AjxCallback} callback
the callback

setActive(rule, active)
Marks a rule as active/inactive.
Parameters:
{ZmFilterRule} rule
the rule to mark active/inactive
{Boolean} active
if true, the rule is marked active

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