public class OwSearchCriteria extends Object implements OwField, OwFieldDefinition, OwFormat
Search criteria tuple containing property, operator and value.
Used to create SQL Statement or a search form entry.
Search are used with OwNetwork.doSearch(...) function.
To be implemented with the specific DMS system.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Field and Description |
---|---|
static int |
ATTRIBUTE_ALLOWWILDCARD
attribute bit flag used with m_iAttributes member: Allow the use of wildcards also for integer values, i.e.
|
static int |
ATTRIBUTE_HIDDEN
attribute bit flag used with m_iAttributes member: A value that is hidden.
|
static int |
ATTRIBUTE_IGNORE_DATE
attribute bit flag used with m_iAttributes member: Ignore the date part of a date value.
|
static int |
ATTRIBUTE_IGNORE_TIME
attribute bit flag used with m_iAttributes member: Ignore the time part of a date value.
|
static int |
ATTRIBUTE_NONE
attribute bit flag used with m_iAttributes member: No attributes.
|
static int |
ATTRIBUTE_READONLY
attribute bit flag used with m_iAttributes member: A value that can not be changed
|
static int |
ATTRIBUTE_REQUIRED
attribute bit flag used with m_iAttributes member: A required value that must be filled in.
|
protected OwFieldDefinition |
m_FieldDefinition
field definition defining this search criteria
|
protected int |
m_iAttributes
flag indicating if the criteria can be edited in a search template view or if it is hidden
|
protected int |
m_iOp
criteria operator which should be applied to the value as defined in OwSearchCriteria
|
protected Object |
m_oDefaultValue
the default value
|
protected Object |
m_oValue
compare value for the search
|
protected OwSearchCriteria |
m_secondrangecriteria
optional second child criteria for range searches
|
protected String |
m_strInstruction
the instruction to the search criteria
|
protected String |
m_strUniqueName
a unique name that identifies this criteria
|
protected Collection |
m_wildcarddefinitions
Collection of OwWildCardDefinition wildcard definition for this criteria, or null if no wildcards are allowed
|
Constructor and Description |
---|
OwSearchCriteria() |
Modifier and Type | Method and Description |
---|---|
boolean |
canValidate()
check if validation is implemented
|
boolean |
canWildCard()
check if criteria allows the use of wildcards
|
int |
getAttributes()
get the flag indicating if the criteria can be edited in a search template view or if it is hidden
|
String |
getClassName()
get the name of the class
|
List |
getComplexChildClasses()
get child properties classes of a complex property class
|
Object |
getDefaultValue()
get the default search value
|
String |
getDescription(Locale locale_p)
get the description defined by the DMS System
|
String |
getDisplayName(Locale locale_p)
get the displayable name of the type as defined by the DMS System
can be identical to getClassName
|
OwEnumCollection |
getEnums()
get a list of enum objects for the enum type (see isEnum)
|
OwFieldDefinition |
getFieldDefinition()
get the corresponding field definition of the field
|
OwFormat |
getFormat()
get the formatter object for string representation
|
String |
getInstruction()
get the instruction to the search criteria
|
String |
getJavaClassName()
get the java class name of java object associated with this property
|
Object |
getMaxValue()
get the max allowed value, or Integer len for String or null if not defined
|
Object |
getMinValue()
get the min allowed value, or Integer len for String or null if not defined
|
Object |
getNativeType()
get the native type which is defined by the underlying system
WARNING: The returned object is opaque.
|
Node |
getNodeFromValue(Object value_p,
Document doc_p)
create a XML serialization of the given field value
|
int |
getOperator()
get the criteria operator which should be applied to the value as defined in OwSearchCriteria
|
String |
getOperatorDisplayName(Locale locale_p)
convert a operator ID to a displayable name
|
Collection |
getOperators()
get a collection of possible filter / search operators for the field
|
String |
getOriginalJavaClassName()
get the original class name, in case data type was overridden by allow wildcard
|
OwSearchCriteria |
getSecondRangeCriteria()
get a optional second child criteria for range searches
|
Format |
getTextFormat(int iFieldProviderType_p)
get the optional formatter object for string representation, according to the given context type
|
String |
getUniqueName()
get a unique name that identifies this criteria
|
Object |
getValue()
get the compare value for the search
|
Object |
getValueFromNode(Node node_p)
create a value for the field described by this class with the given XML Node serialization
|
Object |
getValueFromString(String text_p)
create a value for the field described by this class with the given String serialization
|
Collection |
getWildCardDefinitions()
get the wildcard definitions for this criteria
|
boolean |
ignoreDate()
check if the format should ignore date part of date values
|
boolean |
ignoreTime()
check if the format should ignore time part of date values
|
boolean |
isAllowWildcard()
check if the criteria allows wildcard even if underlying type is number
|
boolean |
isArray()
check if property contains a list of values
|
boolean |
isComplex()
check if the property is a component that contains another child properties
|
boolean |
isCriteriaOperatorRange()
check if criteria has a second range criteria fo ranges
|
boolean |
isDateType()
check if criteria is a date criteria
|
boolean |
isEnum()
check if property is a enum type (see getEnums)
|
boolean |
isHidden()
check if the criteria can be edited in a search template view or if it is hidden
|
boolean |
isIgnoreDate()
check if the criteria ignores the date part
|
boolean |
isIgnoreTime()
check if the criteria ignores the time part
|
boolean |
isReadonly()
check if the criteria is visible but read-only
|
boolean |
isRequired()
check if the criteria must be set
|
boolean |
isType(Class base_p)
check if given java class name is base type
|
void |
setInitialAndDefaultValue(Object oValue_p)
set the initial/default value for the search
|
void |
setOperator(int iOp_p)
set the criteria operator which should be applied to the value as defined in OwSearchCriteria
|
void |
setValue(Object oValue_p)
set the compare value for the search
|
void |
setWildCardDefinitions(Collection wildcarddefinitions_p)
set the wildcard definitions for this criteria
|
String |
toString() |
String |
validate(int fieldProviderType_p,
Object object_p,
Locale locale_p)
validate the given value
|
public static final int ATTRIBUTE_NONE
public static final int ATTRIBUTE_HIDDEN
public static final int ATTRIBUTE_READONLY
public static final int ATTRIBUTE_REQUIRED
public static final int ATTRIBUTE_ALLOWWILDCARD
public static final int ATTRIBUTE_IGNORE_TIME
public static final int ATTRIBUTE_IGNORE_DATE
protected OwFieldDefinition m_FieldDefinition
protected int m_iOp
protected Object m_oValue
protected Object m_oDefaultValue
protected OwSearchCriteria m_secondrangecriteria
protected int m_iAttributes
protected String m_strInstruction
protected Collection m_wildcarddefinitions
protected String m_strUniqueName
public Collection getWildCardDefinitions()
public void setWildCardDefinitions(Collection wildcarddefinitions_p)
wildcarddefinitions_p
- Collection of OwWildCardDefinition, or null if no wildcards are allowedpublic String getInstruction()
public int getOperator()
public void setOperator(int iOp_p)
public String getOperatorDisplayName(Locale locale_p)
locale_p
- public OwSearchCriteria getSecondRangeCriteria()
public boolean isCriteriaOperatorRange()
public int getAttributes()
public boolean isHidden()
public boolean isReadonly()
public boolean isRequired()
isRequired
in interface OwFieldDefinition
public boolean isIgnoreTime()
public boolean isIgnoreDate()
public boolean isAllowWildcard()
public boolean canWildCard()
public Object getValue()
public void setValue(Object oValue_p)
public void setInitialAndDefaultValue(Object oValue_p)
oValue_p
- public OwFieldDefinition getFieldDefinition() throws Exception
getFieldDefinition
in interface OwField
Exception
public String getUniqueName()
public String getClassName()
OwFieldDefinition
getClassName
in interface OwFieldDefinition
public Object getDefaultValue() throws Exception
getDefaultValue
in interface OwFieldDefinition
Exception
public String getDisplayName(Locale locale_p)
OwFieldDefinition
getDisplayName
in interface OwFieldDefinition
locale_p
- Locale to usepublic OwFormat getFormat()
getFormat
in interface OwFieldDefinition
public OwEnumCollection getEnums() throws Exception
OwFieldDefinition
getEnums
in interface OwFieldDefinition
Exception
public String getJavaClassName()
OwFieldDefinition
getJavaClassName
in interface OwFieldDefinition
public String getOriginalJavaClassName()
String
public Object getMaxValue() throws Exception
OwFieldDefinition
getMaxValue
in interface OwFieldDefinition
Exception
public Object getMinValue() throws Exception
OwFieldDefinition
getMinValue
in interface OwFieldDefinition
Exception
public Object getNativeType() throws Exception
OwFieldDefinition
getNativeType
in interface OwFieldDefinition
Exception
public Node getNodeFromValue(Object value_p, Document doc_p) throws Exception
OwFieldDefinition
getNodeFromValue
in interface OwFieldDefinition
value_p
- Object with field valuedoc_p
- DOM Document to add toException
public Object getValueFromNode(Node node_p) throws Exception
OwFieldDefinition
getValueFromNode
in interface OwFieldDefinition
node_p
- the serialized value as a XML DOM NodeException
public Object getValueFromString(String text_p) throws Exception
getValueFromString
in interface OwFieldDefinition
text_p
- String the serialized valueException
public boolean isArray() throws Exception
OwFieldDefinition
isArray
in interface OwFieldDefinition
Exception
public boolean isEnum() throws Exception
OwFieldDefinition
isEnum
in interface OwFieldDefinition
Exception
public String getDescription(Locale locale_p)
OwFieldDefinition
getDescription
in interface OwFieldDefinition
locale_p
- Locale to usepublic Collection getOperators() throws Exception
OwFieldDefinition
getOperators
in interface OwFieldDefinition
Exception
public boolean isType(Class base_p) throws ClassNotFoundException
base_p
- a Class
ClassNotFoundException
public boolean ignoreTime()
OwFormat
ignoreTime
in interface OwFormat
public Format getTextFormat(int iFieldProviderType_p)
getTextFormat
in interface OwFormat
iFieldProviderType_p
- int as defined in OwFieldProvider.TYPE_...public boolean isDateType()
public String validate(int fieldProviderType_p, Object object_p, Locale locale_p)
OwFormat
public boolean canValidate()
OwFormat
canValidate
in interface OwFormat
public boolean ignoreDate()
OwFormat
ignoreDate
in interface OwFormat
public boolean isComplex()
OwFieldDefinition
isComplex
in interface OwFieldDefinition
OwFieldDefinition.getComplexChildClasses()
public List getComplexChildClasses() throws Exception
OwFieldDefinition
getComplexChildClasses
in interface OwFieldDefinition
Exception
OwFieldDefinition.isComplex()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.