public class PreparedSelectorGenerator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PreparedSelectorGenerator.FunctionMethodMap
A FunctionMethodMap encapsulates a table of function methods,
keyed by function name.
|
class |
PreparedSelectorGenerator.SelectorFunction
A SelectorFunction holds information about an embedded function in
the search or sort conditions.
|
Modifier and Type | Field and Description |
---|---|
protected static String |
CONTEXT_DOCUMENT_VIEW_NAME
The name of the view used in full-text searches on DOCUMENT.
|
Constructor and Description |
---|
PreparedSelectorGenerator()
Constructs a PreparedSelectorGenerator.
|
Modifier and Type | Method and Description |
---|---|
void |
addAuxiliarySearchTarget(AttributeValue target)
Adds an Auxiliary search target.
|
void |
addAuxiliarySearchTarget(String className,
String alias)
Adds an Auxiliary search target, from the specified class name and alias.
|
void |
addAuxiliarySearchTarget(String className,
String alias,
String viewName)
Adds an Auxiliary search target, from the specified class name, alias, and view.
|
void |
addBindValue(AttributeValue bindValue)
Adds a bind value.
|
void |
addBypassSecurityAlias(String alias)
Adds an alias that indicates the matching search target should not have
the security clause applied.
|
void |
addColumnDescriptor(ColumnDescriptor colDesc)
Adds a Column descriptor.
|
String |
ARRAY_ATTR_CONTAINS_ALL(String input)
Generates a array attribute qualification clause from
a specified attribute and a set of values, resulting in
a match if the array value contains all of the specified values.
|
String |
ARRAY_ATTR_CONTAINS_ANY(String input)
Generates a array attribute qualification clause from
a specified attribute and a set of values, resulting in
a match if the array value contains any of the specified values.
|
String |
ARRAY_ATTR_CONTAINS(String input)
Generates a array attribute qualification clause from
a specified attribute and value.
|
String |
ATTR(String input)
Translates an attribute specification into a column specification.
|
String |
AUDIT_TABLENAME(String input)
Translates an AuditSpecification name into the table name
used for that Audit history.
|
String |
AUDIT_VIEWNAME(String input)
Translates an AuditSpecification name into the view name
used for that Audit history.
|
String |
CATEGORY_JOIN(String input)
Generates a join clause between two targets, one being a category target.
|
String |
CLASS_TABLENAME(String input)
Translates a ClassObject name into a table name.
|
String |
CLASS_VIEWNAME(String input)
Translates a ClassObject name into a view name.
|
protected long[] |
computeDateValueRange(Long dateValue,
String granularity)
Compute a low/high value range for the specified numeric date value,
using the specified granularity.
|
protected String |
concatTokenList(List list)
Concatenate a list of tokens, comprised of literal strings and functions.
|
String |
CONTAINS_SCORE(String input)
Adds the SQL referencing the "Contains" score as a column in a search or
sort condition.
|
String |
CONTAINS_WORD(String input)
Generates a word-boundary LIKE qualification.
|
String |
CONTAINS(String input)
Adds a clause that restricts results according to a full text
search qualification.
|
String |
CONTENT_SCORE(String input)
Adds the SQL referencing the content score as a column in a search or
sort condition.
|
String |
CONTENT_SIZE(String input)
Adds the SQL referencing the content size as a column in a search or
sort condition.
|
static AttributeValue |
createSearchTarget(String targetToken)
Create a search target specification.
|
String |
DATE_COMPARE(String input)
Generates a date comparison clause from a specified attribute, a
logical operator, a date value, and a granularity value.
|
String |
DATE_VALUE_NOW(String input)
Generates a numeric value representing the current time.
|
void |
declareInnerSearchTarget(String input)
Deprecated.
9.3.3.0 use SEARCH_RESULT macro
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues)
Defines a PreparedSelectorGenerator.
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues,
Boolean useExistsClause)
Defines a PreparedSelectorGenerator.
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String joinCondition,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues)
Defines a PreparedSelectorGenerator.
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String joinCondition,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues,
Boolean useExistsClause)
Defines a PreparedSelectorGenerator.
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String joinCondition,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues,
Boolean useExistsClause,
ColumnDescriptor[] colDescs)
Defines a PreparedSelectorGenerator.
|
void |
define(LibrarySession session,
AttributeValue primaryTarget,
AttributeValue[] auxTargets,
String joinCondition,
String searchCondition,
String sortCondition,
AttributeValue[] bindValues,
Boolean useExistsClause,
ColumnDescriptor[] colDescs,
String[] bypassSecAliases)
Defines a PreparedSelectorGenerator.
|
String |
DOES_NOT_CONTAIN_WORD(String input)
Generates a word-boundary NOT LIKE qualification.
|
String |
EXACT_TYPE(String input)
Adds a qualification that requires an exact type match.
|
String |
EXISTS(String input)
Adds a qualification for a simple "exists" specification.
|
protected Attribute |
findAttributeByAuxName(LibrarySession session,
ClassObject co,
String attrName)
Lookup an Attribute using an auxilliary name.
|
protected ClassObject |
findClassObjectByAuxName(LibrarySession session,
String className)
Find a ClassObject using an auxilliary name.
|
protected int |
findFunctionEnd(String input,
int lcurlyPos)
Find the closing right curly that marks the end of the function,
given a string and the position of the left curly.
|
protected int |
findFunctionStart(String input,
int lcurlyPos)
Find the start of the function, given a string and the position of the
left curly.
|
protected String |
getAliasFromTarget(AttributeValue target)
Returns the alias name from the specified search target.
|
AttributeValue[] |
getAuxiliarySearchTargets()
Returns the auxiliary search targets.
|
AttributeValue[] |
getBindValues()
Returns the bind values.
|
String[] |
getBypassSecurityAliases()
Returns the bypass security aliases.
|
protected String |
getClassFromTarget(AttributeValue target)
Deprecated.
9.3.3.0 use
getClassNameFromTarget |
protected String |
getClassNameFromAlias(String alias)
Deprecated.
9.3.3.0 use
getClassObjectFromAlias . |
protected String |
getClassNameFromTarget(AttributeValue target)
Returns the class name from the specified search target.
|
protected ClassObject |
getClassObjectFromAlias(String alias)
Returns the ClassObject associated with the specified registered alias.
|
protected ClassObject |
getClassObjectFromTarget(AttributeValue target)
Returns the class object from the specified search target.
|
ColumnDescriptor[] |
getColumnDescriptors()
Returns the Column descriptors.
|
protected Method |
getFunctionMethod(String key)
Gets the method to use for resolving the specified function.
|
String |
getJoinClause()
Returns the join clause used to specify the joins in a
PreparedSelector.
|
String |
getJoinCondition()
Gets the raw join condition.
|
AttributeValue[] |
getOriginalAuxiliarySearchTargets()
Returns the original auxiliary search targets, specified when defined.
|
AttributeValue |
getOriginalPrimarySearchTarget()
Returns the original primary search target, specified when defined.
|
PreparedSelector |
getPreparedSelector()
Gets the generated PreparedSelector.
|
AttributeValue |
getPrimarySearchTarget()
Returns the primary search target.
|
String |
getSearchCondition()
Gets the raw search condition.
|
protected String |
getSearchTargetSqlFromAlias(String alias)
Generates the SQL for a search target, identified by registered alias.
|
LibrarySession |
getSession()
Gets the session context used by this instance.
|
String |
getSortClause()
Returns the Sort Clause.
|
String |
getSortCondition()
Gets the raw sort condition.
|
Boolean |
getUseExistsClause()
Returns the explicit "Use exists clause" setting.
|
String |
getWhereClause()
Returns the "where Clause" used as the search condition in a
PreparedSelector.
|
String |
IN_FOLDER(String input)
Generates the clause that restricts a specified alias to a particular
folder.
|
protected boolean |
isNumber(String value)
Check if the input string represents a number.
|
String |
LATEST_VERSION(String input)
Adds a qualification that restricts results for only the latest
version or unversioned items.
|
String |
LITERAL(String input)
A no-op function, returning the literal resolution of the
input string.
|
protected String |
lookupClassNameByNickname(String nickname)
Looks up a ClassObject name by the specified class "nickname".
|
protected AttributeValue |
lookupSearchTarget(AttributeValue target)
Returns the search target from the table map matching the provided
target's associated alias.
|
protected AttributeValue |
lookupSearchTarget(String alias)
Lookup a search target by registered alias.
|
protected AttributeValue |
lookupSearchTarget(String alias,
boolean enforce)
Lookup a search target by registered alias.
|
protected AttributeValue[] |
lookupSearchTargets(AttributeValue[] targets)
Returns the search targets from the table map matching the provided
targets associated aliases.
|
String |
LOWER(String input)
Applies a lowercasing SQL function.
|
String |
MAP_ATTR_EXISTS_WITH_ALIAS(String input)
Generates a map attribute qualification exists clause with
a defined alias for the map table, and containing
an arbitrary inner search clause with the map table.
|
String |
MAP_ATTR_EXISTS(String input)
Generates a map attribute qualification exists clause containing
an arbitrary inner search clause with the map table.
|
String |
MAP_ATTR_KEYED_VALUE(String input)
Generates a map attribute qualification clause containing
a non-null key match from a specified attribute and key value.
|
protected void |
overrideTargetViewName(String alias,
String viewName)
Overrides the view name to be used with the search target identified
by the alias specified.
|
protected List |
parseInput(String input)
Create a token list from an input string.
|
protected Long |
parseNumber(String value)
Return numeric equivalent of the specified string, or return null
if not a number.
|
String |
PROPERTY(String input)
Generates a property qualification clause from a specified alias,
property name, and property data type.
|
protected void |
registerFunctionMethods(Class genClass,
String[] funcNames)
Register function methods for the specified PreparedSelectorGenerator class.
|
protected AttributeValue |
registerSearchTarget(AttributeValue searchTarget)
Registers a new search target after validation.
|
protected AttributeValue |
registerSearchTarget(String input)
Parses and registers a new search target.
|
String |
RELATION_JOIN(String input)
Generates a join clause between a left PublicObject, a right PublicObject, and a Relation
that connects the two.
|
String |
SEARCH_TARGET(String input)
Registers a new search target, and generates SQL for it to appear
in a "from clause".
|
String |
SECURITY_CLAUSE(String input)
Adds a security qualification for an alias.
|
void |
setAuxiliarySearchTargets(AttributeValue[] targets)
Sets the auxiliary search targets.
|
void |
setBindValues(AttributeValue[] bindValues)
Sets the bind values.
|
void |
setBypassSecurityAliases(String[] bypassSecAliases)
Sets the aliases that indicates which PO classes should not have
the security clause applied.
|
void |
setColumnDescriptors(ColumnDescriptor[] colDescs)
Sets the Column descriptors.
|
void |
setJoinCondition(String joinCondition)
Sets the join condition.
|
void |
setPrimarySearchTarget(AttributeValue target)
Sets the primary search target.
|
void |
setPrimarySearchTarget(String className,
String alias)
Sets the primary search target, from the specified class name and alias.
|
void |
setPrimarySearchTarget(String className,
String alias,
String viewName)
Sets the primary search target, from the specified class name, alias, and view.
|
void |
setSession(LibrarySession session)
Sets the session context.
|
void |
setSortCondition(String sortCondition)
Sets the Sort condition.
|
void |
setUseExistsClause(Boolean useExists)
Returns the explicit "Use exists clause" setting.
|
void |
setWhereCondition(String searchCondition)
Sets the WHERE clause condition.
|
protected void |
throwInvalidFunction(String funcName,
String input)
Throw an exception indicating an invalid search function.
|
String |
UNDER_FOLDER(String input)
Generates the clause that restricts a specified alias to a particular
folder or one of its subfolders.
|
String |
UPPER(String input)
Adds an upper function.
|
void |
validate()
Validate the search specifications.
|
protected AttributeValue |
validateBindValue(AttributeValue bindValue)
Validate a bind value.
|
protected void |
validateJoinCondition(String joinCondition)
Validate the join condition.
|
protected void |
validateSearchCondition(String search)
Validate the search condition.
|
protected AttributeValue |
validateSearchTarget(AttributeValue target)
Validate a search target, and registers it if it is valid.
|
protected void |
validateSortCondition(String sort)
Validate the sort condition.
|
protected void |
verifyDocumentTarget(String alias)
Verify that the class name in the search target identified
by the alias specified is DOCUMENT.
|
protected static final String CONTEXT_DOCUMENT_VIEW_NAME
public PreparedSelectorGenerator()
protected void registerFunctionMethods(Class genClass, String[] funcNames)
genClass
- the PreparedSelectorGenerator (or subclass) classfuncNames
- the function namespublic void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String searchCondition, String sortCondition, AttributeValue[] bindValues) throws IfsException
Delegates to the complete 10-arg variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetssearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesIfsException
- if the operation fails.public void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String joinCondition, String searchCondition, String sortCondition, AttributeValue[] bindValues) throws IfsException
Delegates to the complete 10-arg variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionsearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesIfsException
- if the operation fails.public void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String searchCondition, String sortCondition, AttributeValue[] bindValues, Boolean useExistsClause) throws IfsException
Delegates to the complete 10-arg variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetssearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesuseExistsClause
- whether to use EXISTS syntax for
UNDER_FOLDER functionsIfsException
- if the operation fails.public void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String joinCondition, String searchCondition, String sortCondition, AttributeValue[] bindValues, Boolean useExistsClause) throws IfsException
Delegates to the complete 10-arg variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionsearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesuseExistsClause
- whether to use EXISTS syntax for
UNDER_FOLDER functionsIfsException
- if the operation fails.public void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String joinCondition, String searchCondition, String sortCondition, AttributeValue[] bindValues, Boolean useExistsClause, ColumnDescriptor[] colDescs) throws IfsException
Delegates to the complete 10-arg variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionsearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesuseExistsClause
- whether to use EXISTS syntax for
UNDER_FOLDER functionscolDescs
- the ColumnDescriptors (when using getSearchResults())IfsException
- if the operation fails.public void define(LibrarySession session, AttributeValue primaryTarget, AttributeValue[] auxTargets, String joinCondition, String searchCondition, String sortCondition, AttributeValue[] bindValues, Boolean useExistsClause, ColumnDescriptor[] colDescs, String[] bypassSecAliases) throws IfsException
This is the complete variant.
session
- the session contextprimaryTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionsearchCondition
- the search selectionsortCondition
- the sort specificationbindValues
- the bind valuesuseExistsClause
- whether to use EXISTS syntax for
UNDER_FOLDER functionscolDescs
- the ColumnDescriptors (when using getSearchResults())bypassSecAliases
- the aliases that indicates bypassing security for POsIfsException
- if the operation fails.public void setSession(LibrarySession session)
session
- the session contextpublic void setPrimarySearchTarget(String className, String alias) throws IfsException
className
- the class namealias
- the aliasIfsException
- if operation fails.public void setPrimarySearchTarget(String className, String alias, String viewName) throws IfsException
Note: the class name is usually specified as null if a view is specified.
className
- the class name (should usually be null)alias
- the aliasviewName
- the literal view or table nameIfsException
- if operation fails.public void setPrimarySearchTarget(AttributeValue target)
target
- the primary search targetpublic void addAuxiliarySearchTarget(String className, String alias) throws IfsException
className
- the class namealias
- the aliasIfsException
- if operation fails.public void addAuxiliarySearchTarget(String className, String alias, String viewName) throws IfsException
Note: the class name is usually specified as null if a view is specified.
className
- the class name (should usually be null)alias
- the aliasviewName
- the literal view or table nameIfsException
- if operation fails.public void addAuxiliarySearchTarget(AttributeValue target)
target
- the search targetpublic void setAuxiliarySearchTargets(AttributeValue[] targets)
targets
- the auxiliary search targetspublic void addBindValue(AttributeValue bindValue)
bindValue
- the bind valuepublic void setBindValues(AttributeValue[] bindValues)
bindValues
- the bind valuespublic void addColumnDescriptor(ColumnDescriptor colDesc)
colDesc
- the Column descriptorpublic void setColumnDescriptors(ColumnDescriptor[] colDescs)
colDescs
- the ColumnDescriptorspublic void addBypassSecurityAlias(String alias)
alias
- the alias that identifies the search targetpublic void setBypassSecurityAliases(String[] bypassSecAliases)
bypassSecAliases
- the bypass security aliasespublic void setJoinCondition(String joinCondition)
joinCondition
- the join conditionpublic void setWhereCondition(String searchCondition)
searchCondition
- the search conditionpublic void setSortCondition(String sortCondition)
sortCondition
- the sort conditionpublic void setUseExistsClause(Boolean useExists)
public PreparedSelector getPreparedSelector() throws IfsException
The returned instance has the required settings from the
inputs specified during define()
. Additional
settings may be applied subsequently (e.g. adding a SQL hint).
IfsException
- if the operation failspublic LibrarySession getSession()
public String getJoinCondition()
public String getSearchCondition()
public String getSortCondition()
public String getJoinClause() throws IfsException
IfsException
- if the operation fails.public String getWhereClause() throws IfsException
IfsException
- if the operation fails.public String getSortClause() throws IfsException
IfsException
- if the operation fails.public AttributeValue getOriginalPrimarySearchTarget()
public AttributeValue[] getOriginalAuxiliarySearchTargets()
public AttributeValue getPrimarySearchTarget() throws IfsException
IfsException
- if the operation fails.public AttributeValue[] getAuxiliarySearchTargets() throws IfsException
IfsException
- if the operation fails.public ColumnDescriptor[] getColumnDescriptors() throws IfsException
IfsException
- if the operation fails.public String[] getBypassSecurityAliases() throws IfsException
IfsException
- if operation failspublic AttributeValue[] getBindValues() throws IfsException
IfsException
- if the operation fails.public Boolean getUseExistsClause() throws IfsException
IfsException
- if the operation fails.public void validate() throws IfsException
IfsException
- if the operation failsprotected void validateJoinCondition(String joinCondition) throws IfsException
joinCondition
- the join conditionIfsException
- if the operation failsprotected void validateSearchCondition(String search) throws IfsException
search
- the search conditionIfsException
- if the operation failsprotected void validateSortCondition(String sort) throws IfsException
sort
- the sort conditionIfsException
- if the operation failsprotected AttributeValue validateBindValue(AttributeValue bindValue) throws IfsException
bindValue
- the bind value.IfsException
- if the operation fails.protected AttributeValue validateSearchTarget(AttributeValue target) throws IfsException
target
- the search target.IfsException
- if the operation fails.public void declareInnerSearchTarget(String input) throws IfsException
This method should no longer be used.
The input expression is: class alias
where: class is a class name, nickname, or category display name,
and alias is a valid table alias.
input
- the input expression.IfsException
- if operation fails.protected AttributeValue registerSearchTarget(String input) throws IfsException
The input expression is: class alias
where: class is a class name, nickname, or category display name,
and alias is a valid table alias.
input
- the input expression.IfsException
- if operation fails.protected AttributeValue registerSearchTarget(AttributeValue searchTarget) throws IfsException
searchTarget
- the search target to registerIfsException
- if operation fails.protected ClassObject findClassObjectByAuxName(LibrarySession session, String className) throws IfsException
Subclasses can override this to provide alternate name checks, such as ECM code attempting a DisplayName lookup.
session
- the session contextclassName
- the name given for the classIfsException
- if operation fails.protected Attribute findAttributeByAuxName(LibrarySession session, ClassObject co, String attrName) throws IfsException
Used as a last resort when an attribute specification does not map to an attribute for the associated alias.
session
- the session context.co
- the ClassObject to look in.attrName
- the name given for the attribute.IfsException
- if operation fails.protected String lookupClassNameByNickname(String nickname) throws IfsException
This can be overriden by subclasses, to provide nickname look for application-specific classes (e.g. for ECM). The caller ensures that the nickname is forced to uppercase.
nickname
- the class nickname (must be all uppercase)IfsException
- if operation fails.protected AttributeValue lookupSearchTarget(String alias) throws IfsException
alias
- the registered alias.IfsException
- if operation fails.protected AttributeValue lookupSearchTarget(String alias, boolean enforce) throws IfsException
alias
- the registered alias.enforce
- if true, throw an exception if not found;
if false, return null if not foundIfsException
- if operation fails.protected String getClassFromTarget(AttributeValue target) throws IfsException
getClassNameFromTarget
target
- the search target specification.IfsException
- if operation fails.protected String getClassNameFromTarget(AttributeValue target) throws IfsException
target
- the search target specification.IfsException
- if operation fails.protected String getAliasFromTarget(AttributeValue target) throws IfsException
target
- the search target specification.IfsException
- if operation fails.protected String getClassNameFromAlias(String alias) throws IfsException
getClassObjectFromAlias
.Throws if the alias is not known.
alias
- the search target aliasIfsException
- if operation fails.protected ClassObject getClassObjectFromAlias(String alias) throws IfsException
alias
- the search target aliasIfsException
- if operation fails.protected ClassObject getClassObjectFromTarget(AttributeValue target) throws IfsException
target
- the search target specification.IfsException
- if operation fails.protected AttributeValue lookupSearchTarget(AttributeValue target) throws IfsException
target
- the provided search target.IfsException
- if operation fails.protected AttributeValue[] lookupSearchTargets(AttributeValue[] targets) throws IfsException
targets
- the provided search targets.IfsException
- if operation fails.protected void verifyDocumentTarget(String alias) throws IfsException
If the class name is DOCUMENT, this method also overrides the view name in the search target, so that odmz_context_document is used in the search instead of odmv_document.
alias
- the search target alias.IfsException
- if operation fails.protected void overrideTargetViewName(String alias, String viewName) throws IfsException
alias
- the search target alias.viewName
- the view name.IfsException
- if operation fails.protected String getSearchTargetSqlFromAlias(String alias) throws IfsException
The SQL is: "viewname alias".
alias
- the registered alias.IfsException
- if operation fails.protected void throwInvalidFunction(String funcName, String input) throws IfsException
funcName
- the function name.input
- the input string.IfsException
- IFS-35235protected boolean isNumber(String value)
value
- the input string.protected Long parseNumber(String value)
value
- the input string.protected long[] computeDateValueRange(Long dateValue, String granularity) throws IfsException
For example, if the date value specified was the numeric represenation of '14-aug-2009 17:50:20' and a comparison level of MONTH is specified, then the range returned is '01-aug-2009 00:00:00.0' and '31-aug-2009 23:59:59.999'.
dateValue
- a non-null numeric date value, obtained via
getTime
on a java.util.Dategranularity
- the granularity, one of "YEAR", "MONTH", "DAY",
"HOUR", "MINUTE", or "SECOND"IfsException
- if the operation failspublic static AttributeValue createSearchTarget(String targetToken) throws IfsException
Format of the string is PreparedSelector.createSearchTarget
.
targetToken
- the string token representing the search targetIfsException
- if the operation failsprotected List parseInput(String input) throws IfsException
The list will be compromised of both literal Strings and SelectorFunctions.
input
- the input string.IfsException
- if operation fails.protected int findFunctionStart(String input, int lcurlyPos) throws IfsException
input
- the input stringlcurlyPos
- the position of the left curlyIfsException
- if operation fails.protected int findFunctionEnd(String input, int lcurlyPos) throws IfsException
input
- the input stringlcurlyPos
- the position of the left curlyIfsException
- if operation fails.protected String concatTokenList(List list) throws IfsException
list
- the token list.IfsException
- if operation fails.public String LITERAL(String input) throws IfsException
input
- the input expression.IfsException
- if operation fails.public String EXACT_TYPE(String input) throws IfsException
input
- the input expression.IfsException
- if operation fails.public String CONTENT_SIZE(String input) throws IfsException
Derived from ContentObject.
input
- the input expression.IfsException
- if operation fails.public String CONTENT_SCORE(String input) throws IfsException
This function is only supported if the underlying database is Oracle.
input
- the input expression.IfsException
- if operation fails.public String CONTAINS_SCORE(String input) throws IfsException
The input must be specified as:
alias, ?, n
NOTE: the alias must be associated with a DOCUMENT_CONTEXT search target. NOTE: For Postgres, the score number is ignored.
The SQL generated for Oracle is: coalesce(CTXSYS.SCORE(n), length(?) * 0)
The SQL generated for Postgres is: ts_rank(alias.indexvector, to_tsquery(?))
input
- the input expression.IfsException
- if operation fails.public String CONTAINS(String input) throws IfsException
The input must be specified as one of:
alias, ?
or
alias, ?, n
NOTE: the alias must be associated with a DOCUMENT_CONTEXT search target. NOTE: For Postgres, the score number is ignored.
The SQL generated for Oracle is one of: (CTXSYS.CONTAINS(alias.contentindex, ?) > 0) or (CTXSYS.CONTAINS(alias.contentindex, ?, n) > 0)
The SQL generated for Postgres is: alias.indexvector @@ to_tsquery(?)
input
- the input expression.IfsException
- if operation fails.public String LATEST_VERSION(String input) throws IfsException
input
- the input expression.IfsException
- if operation fails.public String SEARCH_TARGET(String input) throws IfsException
The input expression is: class alias
where: class is a class name, nickname, or application-specific
display name, and alias is a valid table alias.
input
- the input expression.IfsException
- if operation fails.public String CLASS_TABLENAME(String input) throws IfsException
The input expression is: classobject_name
where: classobject_name is the class name.
input
- the input expression.IfsException
- if operation fails.public String CLASS_VIEWNAME(String input) throws IfsException
The input expression is: classobject_name
where: classobject_name is the class name.
input
- the input expression.IfsException
- if operation fails.public String AUDIT_TABLENAME(String input) throws IfsException
The input expression is: auditspecification_name
where: auditspecification_name is the AuditSpecification name.
input
- the input expression.IfsException
- if operation fails.public String AUDIT_VIEWNAME(String input) throws IfsException
The input expression is: auditspecification_name
where: auditspecification_name is the AuditSpecification name.
input
- the input expression.IfsException
- if operation fails.public String ATTR(String input) throws IfsException
input
- the input expression.IfsException
- if operation fails.public String CATEGORY_JOIN(String input) throws IfsException
The input expression is of the form: assocAlias, catAlias
.
input
- the input expression.IfsException
- if operation fails.public String RELATION_JOIN(String input) throws IfsException
The input expression is of the form: leftAlias, relationAlias, rightAlias
.
input
- the input expression.IfsException
- if operation fails.public String IN_FOLDER(String input) throws IfsException
The input expression is of the form: alias, ?
.
A bind value indicator must be used for the folder.
input
- the input expression.IfsException
- if operation fails.public String UNDER_FOLDER(String input) throws IfsException
The input expression must be one of two forms: alias, ?
or
alias, nnnnn
, where nnnnn is the ID of the top folder.
The first variant may only be used if the FolderIndex's MaxLevel parameter
is set to 0, and the corresponding bind value will be the top folder.
Otherwise, the second variant must be used.
input
- the input expression.IfsException
- if operation fails.public String EXISTS(String input) throws IfsException
The input expression must be:
class alias, ... class alias, condition
.
where:
input
- the input expression.IfsException
- if operation fails.public String UPPER(String input) throws IfsException
For Oracle this will be nls_upper.
input
- the input expression.IfsException
- if operation fails.public String LOWER(String input) throws IfsException
For Oracle this will be "nls_lower"; for Postgres it is "LOWER".
input
- the input expression.IfsException
- if operation fails.public String SECURITY_CLAUSE(String input) throws IfsException
Input must be "alias, ?", where the bind value indication is for the current user ID. If the specified registered alias is associated with a PublicObject class, a discover-security clause is returned. Otherwise, a clause of "29 != ?" is returned (which will always be true).
input
- the input expression.IfsException
- if operation fails.public String DATE_COMPARE(String input) throws IfsException
The operator must be one of: =, !=, >, >=, <, or <=. The granularity must be one of: YEAR, MONTH, DAY, HOUR, MINUTE, or SECOND. Case is not significant for these values.
The input expression is of the form:
.
For example, for comparing an attribute named "archivedate" equal to the
current time, with day granularity:
DATE_COMPARE{ATTR{cat.archivedate}, =, DATE_VALUE_NOW{}, Day}
.
input
- the input expression.IfsException
- if operation fails.public String DATE_VALUE_NOW(String input) throws IfsException
input
- the input expression.IfsException
- if operation fails.public String PROPERTY(String input) throws IfsException
The property name must be either a literal string or a bind variable. The property data type must be one of the supported scalar types: STRING, BOOLEAN, INTEGER, LONG, DOUBLE, or DATE. Case is not significant for these values.
The input expression is of the form:
.
For example:
PROPERTY{d, IFS.DOCUMENT.ThumbnailStatus, String} = ?
.
The SQL emitted for the above clause is:
(select stringvalue from odm_property where name =
'IFS.DOCUMENT.ThumbnailStatus' and bundle = d.propertybundle) = ?
input
- the input expression.IfsException
- if operation fails.public String ARRAY_ATTR_CONTAINS(String input) throws IfsException
The input expression is of the form:
.
The value can be literal or a bind variable.
For example:
ARRAY_ATTR_CONTAINS{d.AssociatedProjects, ?}
.
The SQL emitted for the above clause is:
exists (select 1 from
Where tblName is the string literal for the array attribute table name
(which varies based on data type), and attrId is the literal ID of the
Attribute specified.
input
- the input expression.IfsException
- if operation fails.public String ARRAY_ATTR_CONTAINS_ANY(String input) throws IfsException
The input expression is of the form:
.
The values can be literal or be bind variables,
including a combination of each type.
For example:
ARRAY_ATTR_CONTAINS_ANY{d.AssociatedProjects, ?, ?, ?}
.
The SQL emitted for the above clause is:
exists (select 1 from
Where tblName is the string literal for the array attribute table name
(which varies based on data type), and attrId is the literal ID of the
Attribute specified.
input
- the input expression.IfsException
- if operation fails.public String CONTAINS_WORD(String input) throws IfsException
The input expression is of the form:
.
The value can be literal or a bind variable.
For example:
CONTAINS_WORD{ATTR{d.name}, ?}
.
The SQL emitted for the above clause is:
' '||translate(d.name, chr(9)||chr(10)||chr(13), ' ')||' ' like '% '||?||' %'
input
- the input expression.IfsException
- if operation fails.public String DOES_NOT_CONTAIN_WORD(String input) throws IfsException
The input expression is of the form:
.
The value can be literal or a bind variable.
For example:
DOES_NOT_CONTAIN_WORD{ATTR{d.name}, ?}
.
The SQL emitted for the above clause is:
' '||translate(d.name, chr(9)||chr(10)||chr(13), ' ')||' ' not like '% '||?||' %'
input
- the input expression.IfsException
- if operation fails.public String ARRAY_ATTR_CONTAINS_ALL(String input) throws IfsException
The input expression is of the form:
.
The values can be literal or be bind variables,
including a combination of each type.
For example:
ARRAY_ATTR_CONTAINS_ALL{d.AssociatedProjects, ?, ?, ?}
.
The SQL emitted for the above clause is:
(exists (select 1 from
Where tblName is the string literal for the array attribute table name
(which varies based on data type), and attrId is the literal ID of the
Attribute specified.
input
- the input expression.IfsException
- if operation fails.public String MAP_ATTR_KEYED_VALUE(String input) throws IfsException
The input expression is of the form:
.
The keyvalue can be literal or a bind variable (bind variable
is recommended).
For example:
MAP_ATTR_KEYED_VALUE{d.Nicknames, ?}
.
The SQL emitted for the above clause is:
(select value from
Where maptblName is the string literal for the map attribute table name
(which is determined from the attribute specified), and attrId is the
literal ID of the Attribute specified.
input
- the input expression.IfsException
- if operation fails.public String MAP_ATTR_EXISTS(String input) throws IfsException
The input expression is of the form:
.
The innersearchclause can be any search clause that includes
map table qualifications, and may include other functions.
Examples:
MAP_ATTR_EXISTS{d.Nicknames, mapkey like ? and value like ?}
MAP_ATTR_EXISTS{d.Nicknames, mapkey is null and value like ?}
MAP_ATTR_EXISTS{d.Nicknames, mapkey = d.currentteam and value is null}
The SQL emitted for first clause above is:
exists (select 1 from
Where maptblName is the string literal for the map attribute table name
(which is determined from the attribute specified), and attrId is the
literal ID of the Attribute specified.
input
- the input expression.IfsException
- if operation fails.public String MAP_ATTR_EXISTS_WITH_ALIAS(String input) throws IfsException
The input expression is of the form:
.
The innersearchclause can be any search clause that includes
map table qualifications, and may include other functions.
The Map alias must not conflict with any of the primary or
auxiliary search aliases.
Example:
MAP_ATTR_EXISTS_WITH_ALIAS{d.Nicknames, map1, mapkey is null and
MAP_ATTR_EXISTS{d.DefaultNames, mapkey = map1.value}}
The SQL emitted for the clause above is:
exists (select 1 from
Where maptblName1 and maptblName2 are the table names for map attributes Nicknames and DefaultNames, respectively,
and attrId1 and attrId2 are the literal IDs of the Attributes specified.
input
- the input expression.IfsException
- if operation fails.protected Method getFunctionMethod(String key) throws IfsException
key
- the method nameIfsException
- if the operation failsCopyright © 2023. All rights reserved.