Class TaskSearchQueryTerm

java.lang.Object
com.webmethods.portal.service.task.TaskSearchQueryTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TaskSearchQueryTerm

public class TaskSearchQueryTerm extends Object implements Serializable
TaskSearchQueryTerm represents task search Query term implementation. The search term can be task fields or field bindings.
See Also:
  • Field Details

    • FIELD_DELIMITERS

      public static final String FIELD_DELIMITERS
      See Also:
    • TASK_TYPE_INDEX_FIELD_DELIMITERS

      public static final String TASK_TYPE_INDEX_FIELD_DELIMITERS
      See Also:
    • m_fields

      protected String[] m_fields
    • m_operator

      protected String m_operator
    • m_value

      protected Object m_value
    • m_caseInsensitive

      protected boolean m_caseInsensitive
    • m_matched

      protected transient boolean m_matched
    • m_valuePattern

      protected transient Pattern m_valuePattern
    • fieldBindings

      protected transient ValueExpression[] fieldBindings
    • m_tableName

      protected transient String m_tableName
  • Constructor Details

    • TaskSearchQueryTerm

      public TaskSearchQueryTerm()
      Default constructor
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(TaskSearchQueryTerm term)
      Copy constructor
      Parameters:
      term - search term to copy from
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(String field, String operator)
      Construct a new task search term using given field and operator. Set the value as null and the search should be case insensitive.
      Parameters:
      field - name of the search field
      operator - search operator
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(String[] fields, String operator)
      Construct a new task search term using given fields and operator. Set the value as null and the search should be case insensitive.
      Parameters:
      fields - names of the search fields
      operator - search operator
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(String field, String operator, Object value)
      Construct a new task search term using given field, operator, and value.
      Parameters:
      fields - name of the search field
      operator - search operator
      value - search value
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(String[] fields, String operator, Object value)
      Construct a new task search term using given fields, operator and value.
      Parameters:
      fields - names of the search fields
      operator - search operator
      value - search value
    • TaskSearchQueryTerm

      public TaskSearchQueryTerm(String[] fields, String operator, Object value, boolean caseInsensitive)
      Construct a new task search term using given fields, operator, value and the flag indicates whether search should be case insensitive.
      Parameters:
      fields - names of the search fields
      operator - search operator
      value - search value
      caseInsensitive - whether to use case-insensitive search for string comparisons
  • Method Details

    • getFields

      public String[] getFields()
      Return search fields. Construct fields based on field bindings if the fields are not defined.
      Returns:
      the fields could be null if neither fields nor field binding expression are defined.
    • setFields

      public void setFields(String[] fields)
      Set fields to search. Setting fields will override any previously set value in {@link #setFieldBindings(ValueBinding[])(String[])}
      Parameters:
      fields - the fields to set
    • getFieldBinding

      @Deprecated public ValueBinding getFieldBinding()
      Deprecated.
      Returns first element of field bindings or null if there is no field bindings defined.
    • getFieldExpression

      public ValueExpression getFieldExpression()
      Returns first element of field bindings or null if there is no field bindings defined.
    • setFieldBinding

      @Deprecated public void setFieldBinding(ValueBinding fieldBinding)
      Deprecated.
      Set field bindings to search. Setting field bindings will override any previously set value in setFields(String[])
      Parameters:
      field - the field to set
    • setFieldExpression

      public void setFieldExpression(ValueExpression fieldBinding)
      Set field bindings to search. Setting field bindings will override any previously set value in setFields(String[])
      Parameters:
      field - the field to set
    • getFieldBindings

      @Deprecated public ValueBinding[] getFieldBindings()
      Deprecated.
      Return field value bindings as they were set or create a them from the fields array. Construct the field bindings based on fields information if field bindings is null.
      Returns:
      array of value bindings for fields
    • getFieldExpressions

      public ValueExpression[] getFieldExpressions()
      Return field value bindings as they were set or create a them from the fields array. Construct the field bindings based on fields information if field bindings is null.
      Returns:
      array of value bindings for fields
    • getFieldExpressionsString

      public List getFieldExpressionsString(Map contextMap, com.webmethods.caf.rules.IBindingExpressionEvaluator resolver)
    • setFieldBindings

      @Deprecated public void setFieldBindings(ValueBinding[] fieldBindings)
      Set field bindings to search on. Setting field bindings will override any previously set value in setFields(String[])
      Parameters:
      field - the field to set
    • setFieldExpressions

      public void setFieldExpressions(ValueExpression[] fieldBindings)
      Set field bindings to search on. Setting field bindings will override any previously set value in setFields(String[])
      Parameters:
      field - the field to set
    • getOperator

      public String getOperator()
      Returns search operator
    • setOperator

      public void setOperator(String operator)
      Sets search operator.
    • getValue

      public Object getValue()
      Returns search value for this term
    • isCaseInsensitive

      public boolean isCaseInsensitive()
      Returns flag if search term should implement case-insensitive search when comparing string. This is valid only for non-indexed search. For indexed searches strings comparison is done in the database according to database rules (typically case-sensitive)
    • setCaseInsensitive

      public void setCaseInsensitive(boolean insensitive)
      Sets flag if search term should implement case-insensitive search
      Parameters:
      insensitive -
    • setValue

      public void setValue(Object value)
      Set search value for the term. The value to be set depends on the type of field used and an operator It can be either java primitive object, or it can be an array of objects for "in" and "between" operators
      Parameters:
      value - the value to set
    • setTableName

      public void setTableName(String tableName)
      Sets a concrete DB table name for the search term.
      Parameters:
      tableName -
    • getTableName

      public String getTableName()
      Returns the DB table name for the search term.
    • setMatched

      public void setMatched(boolean matched)
      Set the flag indicates whether the search term matches the task
      Parameters:
      matched -
    • getMatchedValue

      public boolean getMatchedValue()
      Returns flag which indicates if the search term matches the task
    • matches

      public boolean matches(FacesContext facesContext) throws Exception
      Check whether the search term match the information defined in faces context. This method can be overridden to implement a fully custom searching.
      Returns:
      true if current search term matches the task set on the facesContext. The task can be retrieved from facesContext via #{currentTask} binding expression
      Throws:
      Exception
    • matches

      public boolean matches(Map contextMap, com.webmethods.caf.rules.IBindingExpressionEvaluator resolver) throws Exception
      Throws:
      Exception
    • validate

      public void validate() throws Exception
      Validates current search query term.
      Throws:
      Exception
    • reset

      protected void reset()
      Resets searach term state
    • isUnaryOperator

      public boolean isUnaryOperator()
    • isValueEmpty

      public boolean isValueEmpty()
    • toString

      public String toString()
      Overrides:
      toString in class Object