public class OwSearchNode extends Object
Class for searches
Searches are trees of OwSearchNode Objects.
Each node can contain either a list of child OwSearchNode Objects of a search criteria element.
The nodes are combined with SEARCH_OP_... operators "and" and "or".
The Criteria is by the OwSearchCriteria.
Search are used with OwRepository.doSearch(com.wewebu.ow.server.field.OwSearchNode, com.wewebu.ow.server.field.OwSort, java.util.Collection, int, int) 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 | Class and Description |
|---|---|
class |
OwSearchNode.OwSearchList
Deprecated.
since 4.0.0.0
|
class |
OwSearchNode.OwSearchMap
Deprecated.
since 4.0.0.0 don't use this class anymore
|
static class |
OwSearchNode.OwSearchNodeFieldProvider
Field provider interface for searches.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FILTER_HIDDEN
filter type for criteria traversing used in getCriteriaList
|
static int |
FILTER_NONE
filter type for criteria traversing used in getCriteriaList
|
static int |
FILTER_NONPROPERTY
filter type for criteria traversing used in getCriteriaList
|
static int |
FILTER_READONLY
filter type for criteria traversing used in getCriteriaList
|
protected LinkedList |
m_Childs
the children of this search node which are combined using the m_iOp Operator
|
protected OwSearchCriteria |
m_Criteria
criteria instance for this search node, null if OwSearchNode has children
|
protected int |
m_iNodeType
the type of the branch can be one of the NODE_TYPE_...
|
protected int |
m_iOp
combination operator which should be applied to the child OwSearchNode elements as defined in OwSearchNode
|
static int |
NODE_TYPE_CBR
node type searches for content based criteria
|
static int |
NODE_TYPE_COMBINATION
node, which combines other nodes
|
static int |
NODE_TYPE_CRITERIA
a criteria node
|
static int |
NODE_TYPE_PROPERTY
node type searches for properties like the metadata of documents
|
static int |
NODE_TYPE_SPECIAL
node type searches for special properties like resource path or class criteria
|
protected static String |
PERSIST_END_RANGE_NAME
DOM name for persistence see get/setPersistentNode()
|
protected static String |
PERSIST_OPERATOR_ATTR_NAME
DOM name for persistence see get/setPersistentNode()
|
protected static String |
PERSIST_SEARCH_NODE_NAME
DOM name for persistence see get/setPersistentNode()
|
protected static String |
PERSIST_START_RANGE_NAME
DOM name for persistence see get/setPersistentNode()
|
protected static String |
PERSIST_UNIQUE_NAME__ATTR_NAME
DOM name for persistence see get/setPersistentNode()
|
static int |
SEARCH_OP_AND
combination operator for the OwSearchNode child nodes of this OwSearchNode Node
|
static int |
SEARCH_OP_OR
combination operator for the OwSearchNode child nodes of this OwSearchNode Node
|
static int |
SEARCH_OP_UNDEF
combination operator for the OwSearchNode child nodes undefined
|
| Modifier | Constructor and Description |
|---|---|
protected |
OwSearchNode()
default constructor for overridden classes
|
|
OwSearchNode(int iOp_p,
int iNodeType_p)
create combination search with children but no criteria
|
|
OwSearchNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p)
create a search node with a criteria
|
|
OwSearchNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p)
create a search node with a criteria
|
|
OwSearchNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p,
Object minValue_p,
Object maxValue_p,
Object defaultValue_p,
String sJavaClassName_p)
decorator pattern to and override a search node with a criteria
|
|
OwSearchNode(OwField field_p,
int iOp_p,
int iAttributes_p)
create a search node with a criteria
|
|
OwSearchNode(OwField field_p,
int iOp_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p)
create a search node with a criteria
|
|
OwSearchNode(OwSearchCriteria criteria_p)
criteria constructor
|
|
OwSearchNode(OwSearchNode search_p)
create a copy with child tree
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(OwSearchNode search_p)
add a search node.
|
Object |
clone()
clone the search tree
|
void |
dump(Writer w_p)
dump the search tree
|
OwSearchNode |
findSearchNode(int iNodeType_p)
find the first occurrence of a search node
|
List |
getChilds()
get children of this search node which are combined using the m_iOp Operator
|
OwSearchCriteria |
getCriteria()
get the criteria of this node
|
List |
getCriteriaList(int iFilter_p)
get a list which contains all the criteria in the OwSearchNode Tree
|
Map |
getCriteriaMap(int iFilter_p)
get a map which maps all the criteria in the OwSearchNode Tree to their unique name
|
OwFieldProvider |
getFieldProvider()
get a field provider interface for the search
|
int |
getNodeType()
get the type of the branch can be one of the NODE_TYPE_...
|
int |
getOperator()
get the criteria operator which should be applied to the subnodes as defined in OwSearchCriteria
|
Node |
getPersistentNode(Document doc_p)
get a XML node that persists the current state of the criteria
and that can be used with setPersistentNode() to recreate the state
|
boolean |
isCriteriaNode()
check if search node is a criteria node
|
boolean |
isEmpty()
check if any criteria are set
|
boolean |
isValid()
(overridable) check if search tree is valid, can be used to perform a search,
or if required fields are missing, or if no criteria where submitted.
|
void |
reset()
clear all criteria and set to default values
|
void |
setPersistentNode(Node persistentNode_p)
set a XML node that persists the current state of the criteria
|
String |
toString() |
public static final int FILTER_NONE
public static final int FILTER_HIDDEN
public static final int FILTER_NONPROPERTY
public static final int FILTER_READONLY
public static final int NODE_TYPE_PROPERTY
public static final int NODE_TYPE_SPECIAL
public static final int NODE_TYPE_CBR
public static final int NODE_TYPE_CRITERIA
public static final int NODE_TYPE_COMBINATION
protected int m_iNodeType
public static final int SEARCH_OP_UNDEF
public static final int SEARCH_OP_AND
public static final int SEARCH_OP_OR
protected int m_iOp
protected OwSearchCriteria m_Criteria
protected LinkedList m_Childs
protected static final String PERSIST_SEARCH_NODE_NAME
protected static final String PERSIST_UNIQUE_NAME__ATTR_NAME
protected static final String PERSIST_OPERATOR_ATTR_NAME
protected static final String PERSIST_START_RANGE_NAME
protected static final String PERSIST_END_RANGE_NAME
public OwSearchNode(OwSearchCriteria criteria_p)
criteria_p - public OwSearchNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p)
fieldDefinition_p - OwFieldDefinition of criteriaiOp_p - criteria operator which should be applied to the value as defined in OwSearchCriteriaoInitialAndDefaultValue_p - initial and default value, for range operators it is a two field array, first field for first range criteria, second field for second range criteriaiAttributes_p - int attributes as defined with ATTRIBUTE_...strUniqueName_p - String a unique name that identifies this criteriastrInstruction_p - String instruction to be displayed, can be nullwildcarddefinitions_p - Collection of OwWildCardDefinition, or null if no wildcards are allowedpublic OwSearchNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p, Object minValue_p, Object maxValue_p, Object defaultValue_p, String sJavaClassName_p) throws Exception
fieldDefinition_p - OwFieldDefinitioniOp_p - criteria operator which should be applied to the value as defined in OwSearchCriteriaoInitialAndDefaultValue_p - initial and default value, for range operators it is a two field array, first field for first range criteria, second field for second range criteriaiAttributes_p - int attributes as defined with ATTRIBUTE_...strUniqueName_p - String a unique name that identifies this criteriastrInstruction_p - String instruction to be displayed, can be nullwildcarddefinitions_p - Collection of OwWildCardDefinition, or null if no wildcards are allowedminValue_p - Object value to override the inherited FieldDefinition with custom valuesmaxValue_p - Object value to override the inherited FieldDefinition with custom valuesdefaultValue_p - Object value to override the inherited FieldDefinition with custom valuessJavaClassName_p - String value to override the inherited FieldDefinition with custom valuesExceptionpublic OwSearchNode(OwField field_p, int iOp_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p) throws Exception
field_p - OwField criteria as fieldiOp_p - criteria operator which should be applied to the value as defined in OwSearchCriteriaiAttributes_p - int attributes as defined with ATTRIBUTE_...strUniqueName_p - String a unique name that identifies this criteriastrInstruction_p - String instruction to be displayed, can be nullwildcarddefinitions_p - Collection of OwWildCardDefinition, or null if no wildcards are allowedExceptionpublic OwSearchNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p)
fieldDefinition_p - OwFieldDefinition of criteriaiOp_p - criteria operator which should be applied to the value as defined in OwSearchCriteriaoInitialAndDefaultValue_p - initial and default value, for range operators it is a two field array, first field for first range criteria, second field for second range criteriaiAttributes_p - int attributes as defined with ATTRIBUTE_...public OwSearchNode(OwField field_p, int iOp_p, int iAttributes_p) throws Exception
field_p - OwField criteria as fieldiOp_p - criteria operator which should be applied to the value as defined in OwSearchCriteriaiAttributes_p - int attributes as defined with ATTRIBUTE_...Exceptionpublic OwSearchNode(int iOp_p,
int iNodeType_p)
iOp_p - combination operator which should be applied to the child OwSearchNode elements as defined in OwSearchNodeiNodeType_p - the type of the branch can be one of the NODE_TYPE_... definitionpublic OwSearchNode(OwSearchNode search_p) throws Exception
Exceptionprotected OwSearchNode()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic int getOperator()
public List getCriteriaList(int iFilter_p)
iFilter_p - int any combination of OwSearchNode.FILTER_...public Map getCriteriaMap(int iFilter_p)
iFilter_p - int any combination of OwSearchNode.FILTER_...public void reset()
throws Exception
Exceptionpublic OwSearchCriteria getCriteria()
public List getChilds()
public int getNodeType()
public boolean isEmpty()
public boolean isCriteriaNode()
public void add(OwSearchNode search_p) throws Exception
search_p - the search to addExceptionpublic void setPersistentNode(Node persistentNode_p) throws Exception
persistentNode_p - org.w3c.dom.Node XML nodeExceptionpublic Node getPersistentNode(Document doc_p) throws Exception
Exceptionpublic OwFieldProvider getFieldProvider()
public OwSearchNode findSearchNode(int iNodeType_p)
public boolean isValid()
throws Exception
ExceptionCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.