atg.svc.ui.formhandlers
Class KnowledgeQueryPredicateBuilder

java.lang.Object
  extended by atg.svc.ui.formhandlers.KnowledgeQueryPredicateBuilder
Direct Known Subclasses:
KnowledgeQueryPredicateCollector

public class KnowledgeQueryPredicateBuilder
extends java.lang.Object

Analyzes solution constraints and converts them into KnowledgeQueryPredicate[] for future searches.


Field Summary
protected static KnowledgeQueryAttrDescription[] ATTRIBUTES
           
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DATE_FORMAT
           
static java.lang.String GREATEREQ
           
static java.lang.String LESSEQ
           
protected static java.util.Map OPERATORS
           
static java.lang.String WITHIN
           
 
Constructor Summary
KnowledgeQueryPredicateBuilder()
           
 
Method Summary
protected static atg.svc.repository.beans.KnowledgeQueryPredicate buildListPredicate(KnowledgeQuerySubtypeEnum pListType, java.lang.String pFieldName, atg.svc.repository.beans.KnowledgeQueryPredicateOperator pOper, java.util.List pValues, QueryService pQService)
           
static java.util.Set buildPredicates(SolutionSearchFormHandler pForm)
          Returns a list of newly constructed query predicate beans.
protected static java.lang.Object createPredicate(QueryService queryService, KnowledgeQueryAttrDescription attr)
          Factory method.
static java.lang.String escapeString(java.lang.String source)
          Escapes source string.
protected static java.lang.String firstCharToUpperCase(java.lang.String pValue)
           
static java.lang.String getDateFormat()
           
static atg.svc.repository.beans.KnowledgeQueryPredicateOperator getOperator(java.lang.String pOperator)
           
static java.util.List parseAttributes(SearchBaseFormHandler pForm)
          Parses request and returns List of KnowledgeQueryAttrDescription objects.
protected static java.util.List parseFieldValues(SearchBaseFormHandler pForm)
          Auxiliary method for parsing values of Solution Class-Specific Constraints.
static java.util.List splitEscapedString(java.lang.String source)
          Auxiliary method for spliting escaped, ';'-delimitered strings
static java.lang.String unescapeString(java.lang.String source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


DATE_FORMAT

public static final java.lang.String DATE_FORMAT
See Also:
Constant Field Values

WITHIN

public static final java.lang.String WITHIN
See Also:
Constant Field Values

GREATEREQ

public static final java.lang.String GREATEREQ
See Also:
Constant Field Values

LESSEQ

public static final java.lang.String LESSEQ
See Also:
Constant Field Values

ATTRIBUTES

protected static final KnowledgeQueryAttrDescription[] ATTRIBUTES

OPERATORS

protected static final java.util.Map OPERATORS
Constructor Detail

KnowledgeQueryPredicateBuilder

public KnowledgeQueryPredicateBuilder()
Method Detail

buildPredicates

public static java.util.Set buildPredicates(SolutionSearchFormHandler pForm)
                                     throws ObjectNotFoundException,
                                            javax.ejb.CreateException
Returns a list of newly constructed query predicate beans.

Parameters:
pForm - Query builder form
Returns:
List of KnowledgeQueryPredicate
Throws:
ObjectNotFoundException
javax.ejb.CreateException

createPredicate

protected static java.lang.Object createPredicate(QueryService queryService,
                                                  KnowledgeQueryAttrDescription attr)
                                           throws ObjectNotFoundException,
                                                  javax.ejb.CreateException
Factory method. Creates Query predicate(s) using QueryService object and attribute description.

Parameters:
queryService - QueryService object.
attr - Attribute description.
Returns:
Single KnowledgeQueryPredicate object or List of KnowledgeQueryPredicate objects
Throws:
ObjectNotFoundException
javax.ejb.CreateException

getOperator

public static atg.svc.repository.beans.KnowledgeQueryPredicateOperator getOperator(java.lang.String pOperator)

buildListPredicate

protected static atg.svc.repository.beans.KnowledgeQueryPredicate buildListPredicate(KnowledgeQuerySubtypeEnum pListType,
                                                                                     java.lang.String pFieldName,
                                                                                     atg.svc.repository.beans.KnowledgeQueryPredicateOperator pOper,
                                                                                     java.util.List pValues,
                                                                                     QueryService pQService)
                                                                              throws ObjectNotFoundException,
                                                                                     javax.ejb.CreateException
Throws:
ObjectNotFoundException
javax.ejb.CreateException

firstCharToUpperCase

protected static java.lang.String firstCharToUpperCase(java.lang.String pValue)

parseFieldValues

protected static java.util.List parseFieldValues(SearchBaseFormHandler pForm)
                                          throws ObjectNotFoundException
Auxiliary method for parsing values of Solution Class-Specific Constraints. Makes an array of strings with names, operations, values and values2 from SolutionFormHandler object.

Parameters:
pForm - SolutionFormHandler object
Returns:
Array of strings with names, operations, values and values2.
Throws:
ObjectNotFoundException

splitEscapedString

public static java.util.List splitEscapedString(java.lang.String source)
Auxiliary method for spliting escaped, ';'-delimitered strings

Parameters:
source - Source string for spliting
Returns:
Result array of strings after spliting

parseAttributes

public static java.util.List parseAttributes(SearchBaseFormHandler pForm)
Parses request and returns List of KnowledgeQueryAttrDescription objects.

Parameters:
pForm - SolutionSearchFormHandler form. Used for access to request parameters.
Returns:
List of parsed KnowledgeQueryAttrDescription objects

escapeString

public static java.lang.String escapeString(java.lang.String source)
Escapes source string. Replaces ';' and '\' characters with "\;" and "\\" sequences.

Parameters:
source - Source string
Returns:
Escaped string.

unescapeString

public static java.lang.String unescapeString(java.lang.String source)

getDateFormat

public static java.lang.String getDateFormat()