com.wewebu.ow.server.field
Class OwStandardDecoratorSearchNode

java.lang.Object
  extended by com.wewebu.ow.server.field.OwSearchNode
      extended by com.wewebu.ow.server.field.OwStandardDecoratorSearchNode
Direct Known Subclasses:
OwStandardCrossMappings.OwCrossDecoratorSearchNode

public abstract class OwStandardDecoratorSearchNode
extends OwSearchNode

OwSearchNode wrapper to implement a decorator pattern.

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.field.OwSearchNode
OwSearchNode.OwSearchList, OwSearchNode.OwSearchMap, OwSearchNode.OwSearchNodeFieldProvider
 
Field Summary
 
Fields inherited from class com.wewebu.ow.server.field.OwSearchNode
FILTER_HIDDEN, FILTER_NONE, FILTER_NONPROPERTY, FILTER_READONLY, m_Childs, m_Criteria, m_iNodeType, m_iOp, NODE_TYPE_CBR, NODE_TYPE_COMBINATION, NODE_TYPE_CRITERIA, NODE_TYPE_PROPERTY, NODE_TYPE_SPECIAL, PERSIST_END_RANGE_NAME, PERSIST_OPERATOR_ATTR_NAME, PERSIST_SEARCH_NODE_NAME, PERSIST_START_RANGE_NAME, PERSIST_UNIQUE_NAME__ATTR_NAME, SEARCH_OP_AND, SEARCH_OP_OR, SEARCH_OP_UNDEF
 
Constructor Summary
OwStandardDecoratorSearchNode()
           
 
Method Summary
 void add(OwSearchNode search_p)
          add a search node.
 Object clone()
          clone the search tree
abstract  OwSearchCriteria createWrappedCriteria(OwSearchCriteria criteria_p)
          get the decorated object, to be implemented be overridden classes
 void dump(Writer w_p)
          dump the search tree
 OwSearchNode findSearchNode(int nodeType_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 filter_p)
          get a list which contains all the criteria in the OwSearchNode Tree
 Map getCriteriaMap(int filter_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
abstract  OwSearchNode getWrappedSearchNode()
          get the decorated object, to be implemented be overridden classes
 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
 
Methods inherited from class com.wewebu.ow.server.field.OwSearchNode
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwStandardDecoratorSearchNode

public OwStandardDecoratorSearchNode()
Method Detail

getWrappedSearchNode

public abstract OwSearchNode getWrappedSearchNode()
get the decorated object, to be implemented be overridden classes


createWrappedCriteria

public abstract OwSearchCriteria createWrappedCriteria(OwSearchCriteria criteria_p)
get the decorated object, to be implemented be overridden classes


getCriteria

public OwSearchCriteria getCriteria()
Description copied from class: OwSearchNode
get the criteria of this node

Overrides:
getCriteria in class OwSearchNode
Returns:
OwSearchCriteria or null if node contains children

getCriteriaList

public List getCriteriaList(int filter_p)
Description copied from class: OwSearchNode
get a list which contains all the criteria in the OwSearchNode Tree

Overrides:
getCriteriaList in class OwSearchNode
Parameters:
filter_p - int any combination of OwSearchNode.FILTER_...
Returns:
List which contains all the criteria in the OwSearchNode Tree

getCriteriaMap

public Map getCriteriaMap(int filter_p)
Description copied from class: OwSearchNode
get a map which maps all the criteria in the OwSearchNode Tree to their unique name

Overrides:
getCriteriaMap in class OwSearchNode
Parameters:
filter_p - int any combination of OwSearchNode.FILTER_...
Returns:
Map which contains all the criteria in the OwSearchNode Tree

add

public void add(OwSearchNode search_p)
         throws Exception
Description copied from class: OwSearchNode
add a search node. This node must not contain a criteria

Overrides:
add in class OwSearchNode
Parameters:
search_p - the search to add
Throws:
Exception

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: OwSearchNode
clone the search tree

Overrides:
clone in class OwSearchNode
Returns:
OwSearchNode copy
Throws:
CloneNotSupportedException

dump

public void dump(Writer w_p)
          throws Exception
Description copied from class: OwSearchNode
dump the search tree

Overrides:
dump in class OwSearchNode
Throws:
Exception

findSearchNode

public OwSearchNode findSearchNode(int nodeType_p)
Description copied from class: OwSearchNode
find the first occurrence of a search node

Overrides:
findSearchNode in class OwSearchNode
Returns:
OwSearchNode or null if not found

getChilds

public List getChilds()
Description copied from class: OwSearchNode
get children of this search node which are combined using the m_iOp Operator

Overrides:
getChilds in class OwSearchNode
Returns:
List of OwSearchNode Objects, or null if node contains a criteria

getFieldProvider

public OwFieldProvider getFieldProvider()
Description copied from class: OwSearchNode
get a field provider interface for the search

Overrides:
getFieldProvider in class OwSearchNode
Returns:
OwFieldProvider

getNodeType

public int getNodeType()
Description copied from class: OwSearchNode
get the type of the branch can be one of the NODE_TYPE_... definitions used to distinguish the search branches and make search creation easier

Overrides:
getNodeType in class OwSearchNode
Returns:
int

getOperator

public int getOperator()
Description copied from class: OwSearchNode
get the criteria operator which should be applied to the subnodes as defined in OwSearchCriteria

Overrides:
getOperator in class OwSearchNode

getPersistentNode

public Node getPersistentNode(Document doc_p)
                       throws Exception
Description copied from class: OwSearchNode
get a XML node that persists the current state of the criteria and that can be used with setPersistentNode() to recreate the state

Overrides:
getPersistentNode in class OwSearchNode
Throws:
Exception

isCriteriaNode

public boolean isCriteriaNode()
Description copied from class: OwSearchNode
check if search node is a criteria node

Overrides:
isCriteriaNode in class OwSearchNode
Returns:
true = criteria node, false = branch containing other OwSearchNode nodes.

isEmpty

public boolean isEmpty()
Description copied from class: OwSearchNode
check if any criteria are set

Overrides:
isEmpty in class OwSearchNode
Returns:
true = no criteria are set, false = at least one criteria is set

isValid

public boolean isValid()
                throws Exception
Description copied from class: OwSearchNode
(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.

Overrides:
isValid in class OwSearchNode
Returns:
true if valid
Throws:
Exception

reset

public void reset()
           throws Exception
Description copied from class: OwSearchNode
clear all criteria and set to default values

Overrides:
reset in class OwSearchNode
Throws:
Exception

setPersistentNode

public void setPersistentNode(Node persistentNode_p)
                       throws Exception
Description copied from class: OwSearchNode
set a XML node that persists the current state of the criteria

Overrides:
setPersistentNode in class OwSearchNode
Parameters:
persistentNode_p - org.w3c.dom.Node XML node
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.