Zimlet JavaScript API Reference - ZmFilterRule

Class ZmFilterRule


ZmFilterRule represents a filter rule. A rule includes one or more conditions and one or more actions.

Defined in: ZmFilterRule.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmFilterRule(name, active, filterActions, filterTests)
Creates an empty filter rule.
Field Summary
Field Attributes Field Name and Description
<static>  
ZmFilterRule.A_DISCARD
Defines the "discard" action type.
<static>  
ZmFilterRule.A_FLAG
Defines the "flag" action type.
<static>  
ZmFilterRule.A_FOLDER
Defines the "folder" action type.
<static>  
ZmFilterRule.A_FORWARD
Defines the "forward" action type.
<static>  
ZmFilterRule.A_KEEP
Defines the "keep" action type.
<static>  
ZmFilterRule.A_KEEP_SENT
Defines the "keep" action type.
<static>  
ZmFilterRule.A_NAME_DISCARD
Defines the "discard" action name.
<static>  
ZmFilterRule.A_NAME_FLAG
Defines the "flag" action name.
<static>  
ZmFilterRule.A_NAME_FOLDER
Defines the "file into a folder" action name.
<static>  
ZmFilterRule.A_NAME_FORWARD
Defines the "forward" action name.
<static>  
ZmFilterRule.A_NAME_KEEP
Defines the "keep" action name.
<static>  
ZmFilterRule.A_NAME_KEEP_SENT
Defines the "keep" action name.
<static>  
ZmFilterRule.A_NAME_STOP
Defines the "stop" action name.
<static>  
ZmFilterRule.A_NAME_TAG
Defines the "tag" action name.
<static>  
ZmFilterRule.A_NOTIFY
Defines the "notify" action name.
<static>  
ZmFilterRule.A_REPLY
Defines the "reply" action name.
<static>  
ZmFilterRule.A_STOP
Defines the "stop" action type.
<static>  
ZmFilterRule.A_TAG
Defines the "tag" action type.
<static>  
ZmFilterRule.ACTIONS
This defines a hash of actions.
 
The filter rule actions.
 
The filter rules conditions.
<static>  
ZmFilterRule.CONDITIONS
This defines a hash of conditions.
<static>  
ZmFilterRule.GROUP_ALL
Defines the "group all" operator.
<static>  
ZmFilterRule.GROUP_ANY
Defines the "group any" operator.
 
The name of the filter rule.
<static>  
ZmFilterRule.TYPE_CALENDAR
Defines the "calendar" type.
<static>  
ZmFilterRule.TYPE_FOLDER_PICKER
Defines the "folder picker" type.
<static>  
ZmFilterRule.TYPE_INPUT
Defines the "input" type.
<static>  
ZmFilterRule.TYPE_SELECT
Defines the "select" type.
<static>  
ZmFilterRule.TYPE_TAG_PICKER
Defines the "tag picker" type.
Method Summary
Method Attributes Method Name and Description
 
addAction(actionType, value)
Adds an action to the rule actions list.
 
Clears the rule actions list.
 
Clears the rule conditions list.
 
Gets the rule condition grouping operator.
<static>  
ZmFilterRule.getNegativeComparator(comparator)
helper method to get the negative comparator
<static>  
ZmFilterRule.getSocialFilters()
Returns array of social filter options based on COS settings
 
Checks if the if the rule is enabled.
 
setGroupOp(groupOp)
Sets the rule condition grouping operator to "any" or "all".
Class Detail
ZmFilterRule(name, active, filterActions, filterTests)
Creates an empty filter rule. Conditions and actions will need to be added.
Author: Conrad Damon.
Parameters:
{String} name
the rule name
{Boolean} active
if true, if the rule is enabled
{Object} filterActions
the filter action data as raw json object
{Object} filterTests
the filter conditions data as raw json object
Field Detail
<static> ZmFilterRule.A_DISCARD
Defines the "discard" action type.

<static> ZmFilterRule.A_FLAG
Defines the "flag" action type.

<static> ZmFilterRule.A_FOLDER
Defines the "folder" action type.

<static> ZmFilterRule.A_FORWARD
Defines the "forward" action type.

<static> ZmFilterRule.A_KEEP
Defines the "keep" action type.

<static> ZmFilterRule.A_KEEP_SENT
Defines the "keep" action type.

<static> ZmFilterRule.A_NAME_DISCARD
Defines the "discard" action name.

<static> ZmFilterRule.A_NAME_FLAG
Defines the "flag" action name.

<static> ZmFilterRule.A_NAME_FOLDER
Defines the "file into a folder" action name.

<static> ZmFilterRule.A_NAME_FORWARD
Defines the "forward" action name.

<static> ZmFilterRule.A_NAME_KEEP
Defines the "keep" action name.

<static> ZmFilterRule.A_NAME_KEEP_SENT
Defines the "keep" action name.

<static> ZmFilterRule.A_NAME_STOP
Defines the "stop" action name.

<static> ZmFilterRule.A_NAME_TAG
Defines the "tag" action name.

<static> ZmFilterRule.A_NOTIFY
Defines the "notify" action name.

<static> ZmFilterRule.A_REPLY
Defines the "reply" action name.

<static> ZmFilterRule.A_STOP
Defines the "stop" action type.

<static> ZmFilterRule.A_TAG
Defines the "tag" action type.

<static> ZmFilterRule.ACTIONS
This defines a hash of actions. The hash key is known as the action "name". It may or may not take an argument.

The action parameters are:

  • param the type of input widget for the action's argument
  • pOptions the name/value pairs for args
  • precondition the setting that must be enabled for action to be available (preconditions are set by ZmFilterRulesController, after settings are available)

{Object} actions
The filter rule actions.

{Object} conditions
The filter rules conditions.

<static> ZmFilterRule.CONDITIONS
This defines a hash of conditions. Each condition is a hash of parameters. The key of the hash is also known as the condition "subject". It is the field of an email message that the condition is tested against.

The condition parameters are:

  • subjectMod Type of input widget for the subjectModifier, which is a specifier or modifier for the subject (such as which address to look at)
  • smOptions List of possible values for the subjectModifier (ZmFilterRule.TYPE_SELECT)
  • ops Type of input widget for choosing the comparator
  • opsOptions List of possible comparators for this subject (ZmFilterRule.TYPE_SELECT type)
  • value Type of input widget for specifying the value
  • vOptions List of possible values (ZmFilterRule.TYPE_SELECT type)
  • valueMod Type of input widget for the valueModifier, which is a specifier or modifier for the value (such as units for size)
  • vmOptions List of possible values for the valueModifier (ZmFilterRule.TYPE_SELECT type)

<static> ZmFilterRule.GROUP_ALL
Defines the "group all" operator.

<static> ZmFilterRule.GROUP_ANY
Defines the "group any" operator.

{String} name
The name of the filter rule.

<static> ZmFilterRule.TYPE_CALENDAR
Defines the "calendar" type.

<static> ZmFilterRule.TYPE_FOLDER_PICKER
Defines the "folder picker" type.

<static> ZmFilterRule.TYPE_INPUT
Defines the "input" type.

<static> ZmFilterRule.TYPE_SELECT
Defines the "select" type.

<static> ZmFilterRule.TYPE_TAG_PICKER
Defines the "tag picker" type.
Method Detail
addAction(actionType, value)
Adds an action to the rule actions list.
Parameters:
{constant} actionType
the action type (see ZmFilterRule.A_ constants)
{String} value
the value for the action

clearActions()
Clears the rule actions list.

clearConditions()
Clears the rule conditions list.

{constant} getGroupOp()
Gets the rule condition grouping operator.
Returns:
{constant} the operator (see ZmFilterRule.GROUP_ constants)

<static> {constant} ZmFilterRule.getNegativeComparator(comparator)
helper method to get the negative comparator
Parameters:
comparator
Returns:
{constant} the operator (see ZmFilterRule.OP_ constants)

<static> {array} ZmFilterRule.getSocialFilters()
Returns array of social filter options based on COS settings
Returns:
{array} social filter options

{Boolean} hasValidAction()
Checks if the if the rule is enabled.
Returns:
{Boolean} true if the rule is enabled

setGroupOp(groupOp)
Sets the rule condition grouping operator to "any" or "all".
Parameters:
{constant} groupOp
the grouping operator (see ZmFilterRule.GROUP_ constants)

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