Namespace: OpenEdge.BusinessLogic.Filter
Type: Class AblFilterParser
Parent Classes:
Inherits: OpenEdge.BusinessLogic.Filter.FilterParser


Copyright (c) 2018, 2020-2021 by Progress Software Corporation. All rights reserved.
File:AblFilterParser
Author(s):pjudge
Created:Wed Dec 07 14:11:10 EST 2016
Notes:* String with "WHERE"...
/* Default constructor



Method Summary
  Options Name Purpose
  LOGICAL AddToGroup (QueryGroup, IQueryEntry, JoinEnum) /* Adds a query entry to an existing group. @param QueryGroup A group to which to add an entry to. @param IQueryEntry A new query entry. May be a QueryPredicate or a QueryGroup @param JoinEnum How the new entry joins (AND/OR/etc) to any previous entries in the group @return logical TRUE if the query entry was added; FALSE otherwise */
  OpenEdge.Core.String GetFieldValue (character, logical, QueryOperatorEnum) /* Returns a field value from the current parsed string @param character The parsed character @param logical TRUE if the value is a quoted null @param QueryOperatorEnum An optional operator @return String The String containing the value */
  OpenEdge.BusinessLogic.QueryGroup GetGroupParent (QueryGroup, QueryGroup) /* Reads the whole tree of groups in a group to find a particular group's parent group. @param QueryGroup The parent group @param QueryGroup The group whose parent to find @return QueryGroup The parent group, or NULL if none found. */
  Ccs.BusinessLogic.JoinEnum GetJoin (character, JoinEnum) /* Determines the join value. If there is an existing join value passed in, and it's value is either "And" or "Or", and the current string value is "not", then return a new "AndNot" or "OrNot". If there is an existing join value passed in, and it is not "And" or "Or", then that value is returned. If no join value is passed in, then use the string value to determine the enum. @param character A word representing a join @param JoinEnum The current join, if any @return JoinEnum The new join. */
  LOGICAL IsMatchesExpression (character) /* Indicates whether a string can be used with a MATCHES operator: it needs to have an unescaped * or . in the string. @param character The expression to evaluate @return logical TRUE if the expression contains at least one * or .; FALSE otherwise */
  Ccs.BusinessLogic.IGetDataRequest Parse (Object) /* Reads and processes (parses) the filter. @param P.L.Object The filter data @param IGetDataRequest A new filter object */
  Ccs.BusinessLogic.IQuerySortEntry ParseSortBy (Object) /* Parses an SORT-BY phrase and returns an array of IQuerySortEntry objects. @param character The SORT-BY phrase @return IQuerySortEntry[] An array of sort phrases. An indeterminate array is returned if the input phrase is empty */
  Ccs.BusinessLogic.IQuerySortEntry ParseSortString (longchar) /* Parses an ABL BY expression into an array of IQuerySortEntry. If the string is malformed (ie can't be used as an ABL sort), then an indeterminate array is returned. mallformed might be something like "by eq 21" or "by". @param longchar The standard ABL BY expression. This can be a complete WHERE ... BY string or just the BY portion @return IQuerySortEntry[] An array of sort entries. Will be indeterminate if the input value is empty or null, or if the string isn't of the format "BY <field> [BY <field-2>]" */
  Ccs.BusinessLogic.IGetDataTableRequest ParseTableRequest (character, JsonObject) /* Reads a single table's request This method knows which properties in the input JSON are for the where clause, for the sort-by etc @param character The table name to which this filter applies @param JsonObject The input filter @return IGetDataTableRequest A single table Get Request */
  Ccs.BusinessLogic.IQueryEntry ParseWhere (Object) /* Parses where/filter phrase and returns an IQueryEntry object for a single table @param P.L.Object The filter/where clause phrase @return IQueryEntry The query entry.We return one of an IQueryPredicate (single clause) or an IQueryGroup (many clauses) */
  Ccs.BusinessLogic.IQueryEntry ParseWhereString (longchar) /* Parses a where string into a query entry - either a group or a predicate. If the parsing runs into problems (eg a malformed string) a null IQueryEntry is returned. Splitting of a string into groups using "(<grp-1>)" is not supported. @param longchar The WHERE string to parse into parts @return IQueryEntry A query group, query predicate or unknown (if the string cannot be parsed) */

Constructor Summary
  Options Name Purpose
  AblFilterParser () /* Default constructor */
  AblFilterParser (character) /* Constructor. @param longchar (mandatory) A table name for which to construct the filter */
  AblFilterParser (character[]) /* Constructor. @param longchar[] (mandatory) An array of table name for which to construct the filter */

Method Detail
Top

LOGICAL AddToGroup (QueryGroup, IQueryEntry, JoinEnum)

/* Adds a query entry to an existing group.
Parameters:
pParentGroup OpenEdge.BusinessLogic.QueryGroup
 
pEntry Ccs.BusinessLogic.IQueryEntry
 
pJoin Ccs.BusinessLogic.JoinEnum
 
Returns LOGICAL
  logical TRUE if the query entry was added; FALSE otherwise
Top

OpenEdge.Core.String GetFieldValue (character, logical, QueryOperatorEnum)

/* Returns a field value from the current parsed string
Parameters:
pVal CHARACTER
 
pQuotedNull LOGICAL
 
pOperator Ccs.BusinessLogic.QueryOperatorEnum
 
Returns OpenEdge.Core.String
  String The String containing the value
Top

OpenEdge.BusinessLogic.QueryGroup GetGroupParent (QueryGroup, QueryGroup)

/* Reads the whole tree of groups in a group to find a particular group's parent group.
Parameters:
pParent OpenEdge.BusinessLogic.QueryGroup
 
pGroup OpenEdge.BusinessLogic.QueryGroup
 
Returns OpenEdge.BusinessLogic.QueryGroup
  QueryGroup The parent group, or NULL if none found.
Top

Ccs.BusinessLogic.JoinEnum GetJoin (character, JoinEnum)

/* Determines the join value.
If there is an existing join value passed in,
and it's value is either "And" or "Or", and the current string
value is "not", then return a new "AndNot" or "OrNot".
If there is an existing join value passed in, and it is not "And" or
"Or", then that value is returned.
If no join value is passed in, then use the string value to determine the
enum.
Parameters:
pVal CHARACTER
 
pJoin Ccs.BusinessLogic.JoinEnum
 
Returns Ccs.BusinessLogic.JoinEnum
  JoinEnum The new join.
Top

LOGICAL IsMatchesExpression (character)

/* Indicates whether a string can be used with a MATCHES operator:
it needs to have an unescaped * or . in the string.
Parameters:
pExpr CHARACTER
 
Returns LOGICAL
  logical TRUE if the expression contains at least one * or .; FALSE otherwise
Top

Ccs.BusinessLogic.IGetDataRequest Parse (Object)

/* Reads and processes (parses) the filter.
Parameters:
pData Progress.Lang.Object
 
Returns Ccs.BusinessLogic.IGetDataRequest
 
Top

Ccs.BusinessLogic.IQuerySortEntry ParseSortBy (Object)

/* Parses an SORT-BY phrase and returns an array of IQuerySortEntry objects.
Parameters:
pSortBy Progress.Lang.Object
 
Returns Ccs.BusinessLogic.IQuerySortEntry
  IQuerySortEntry[] An array of sort phrases. An indeterminate array is returned if the input phrase is empty
Top

Ccs.BusinessLogic.IQuerySortEntry ParseSortString (longchar)

/* Parses an ABL BY expression into an array of IQuerySortEntry.
If the string is malformed (ie can't be used as an ABL sort), then an indeterminate array
is returned. mallformed might be something like "by eq 21" or "by".
or if the string isn't of the format "BY <field> [BY <field-2>]"
Parameters:
pSortBy LONGCHAR
 
Returns Ccs.BusinessLogic.IQuerySortEntry
  IQuerySortEntry[] An array of sort entries. Will be indeterminate if the input value is empty or null,
Top

Ccs.BusinessLogic.IGetDataTableRequest ParseTableRequest (character, JsonObject)

/* Reads a single table's request
This method knows which properties in the input JSON are for the where clause, for the sort-by etc
Parameters:
pTable CHARACTER
 
pData Progress.Json.ObjectModel.JsonObject
 
Returns Ccs.BusinessLogic.IGetDataTableRequest
  IGetDataTableRequest A single table Get Request
Top

Ccs.BusinessLogic.IQueryEntry ParseWhere (Object)

/* Parses where/filter phrase and returns an IQueryEntry object for a single table
or an IQueryGroup (many clauses)
Parameters:
pWhere Progress.Lang.Object
 
Returns Ccs.BusinessLogic.IQueryEntry
  IQueryEntry The query entry.We return one of an IQueryPredicate (single clause)
Top

Ccs.BusinessLogic.IQueryEntry ParseWhereString (longchar)

/* Parses a where string into a query entry - either a group or a predicate.
If the parsing runs into problems (eg a malformed string) a null IQueryEntry is returned.
Splitting of a string into groups using "(<grp-1>)" is not supported.
Parameters:
pWhere LONGCHAR
 
Returns Ccs.BusinessLogic.IQueryEntry
  IQueryEntry A query group, query predicate or unknown (if the string cannot be parsed)


Constructor Detail
Top

AblFilterParser ()

/* Default constructor
Top

AblFilterParser (character)

/* Constructor.
Parameters:
pTable CHARACTER
 
Top

AblFilterParser (character[])

/* Constructor.
Parameters:
pTable CHARACTER