| java.lang.Object org.openharmonise.rm.search.Search
Search | public class Search implements Publishable(Code) | | Provides an interface to construct and run searches over
resources within the repository, allowing metadata conditions to be
specified using implementations of AbstractPropertyInstance
core data conditions to be specified using ColumnRef .
The class also implements Publishable in order that
a search can be specified in HaRP and the results can be published
as XML.
author: Michael Bell version: $Revision: 1.10 $ |
Method Summary | |
public void | addConditionColumn(ColumnRef colref, String sOperator, Vector values) Adds a condition to the search. | public void | addConditionGroup(AbstractParentObject grpObj) Adds a relationship condition to the search such that results will be
children of the given AbstractParentObject . | public void | addConditionProfile(Profile prof) Adds conditions to the search defined by the given Profile ,
i.e. | public void | addConditionProperty(AbstractPropertyInstance propInst) Adds a condition to this search which is defined by the given
AbstractPropertyInstance . | protected void | addFilterSourceConditions(Element xmlElement, State state) Adds conditions to the search based on the filter source found in the
State . | public void | addSelectColumn(ColumnRef colref) Adds a select column to be returned in the search. | public void | addSelectProperty(AbstractPropertyInstance propInst) Adds a select column to be returned in the search which corresponds to
the given property instance. | public void | addSubGroupsAsConditions(AbstractParentObject grpObj) Adds the sub groups of the given AbstractParentObject as
conditions of this search. | public void | cacheResults(boolean bCache) Switch caching of results on or off. | public List | executeSearch() Executed the search and returns a vector of objects representing the
results of the search. | public SelectStatement | generateSelectStatement() | public List | getConditionGroups() | public List | getConditionProfile() | public Set | getOrderByColumns() Returns a Set of ColumnRef s which
represents the column by which the results will be ordered. | public String | getOrderDirection(ColumnRef colref) Returns the direction the results will be ordered in
for the specified column reference. | public List | getSearchColumns() | protected String | getSearchText() | public DataStoreObject | getSearchType() Returns an object of the type that the search will be conducted on. | public String | getTagName() | public boolean | isApprovedSearch() | protected Element | list(Element list, HarmoniseOutput output, State state) Publishes the 'List' element. | public void | populate(Element xmlElement, State state) | protected void | processFilterConditions(Element xmlElement) Populates the search with filter conditions found in
xmlElement . | protected void | processSearchConditions(Element xmlElement, State state) Processes a 'Conditions' element to extract the conditions to be used in
the search. | public org.w3c.dom.Element | publish(Template template, HarmoniseOutput xmlDoc, State state) | public org.w3c.dom.Element | publish(Element topEl, HarmoniseOutput xmlDoc, State state) | protected void | publishResults(Element list, HarmoniseOutput output, State state, Template template, List results, int nPageId) Publishes the results contained in results using the given
Template under the Element list . | protected Element | search(Element search, HarmoniseOutput output, State state) Publishes the 'Search' element, at most fills in available values for
property instances. | public void | setApproved(boolean bApproved) | public void | setOrderBy(ColumnRef colref, String sOrderDirection) Sets the column which will be used for ordering the results as well as
the direction of the ordering. | public void | setOrderBy(AbstractPropertyInstance propInst, String sOrderDirection) Sets the property instance which should be used to order the search
results as well as the direction of the ordering. | public void | setResultSize(int nNum) Sets the maximum size of the list of results. | protected void | setSearchText(String sSearchText) Sets the text associated with this search. | public void | setSearchType(DataStoreObject dobj) Sets the object type that the search will be conducted on. | public void | setStringingOperator(String sOp) Sets the logical stringing operator to use between conditions. |
ATTRIB_INCLUSIVE | final public static String ATTRIB_INCLUSIVE(Code) | | |
ATTRIB_MAXRESULTS | final public static String ATTRIB_MAXRESULTS(Code) | | |
ATTRIB_OBJECT_TYPE | final public static String ATTRIB_OBJECT_TYPE(Code) | | |
ATTRIB_ORDERBY | final public static String ATTRIB_ORDERBY(Code) | | |
ATTRIB_ORDER_DIRECTION | final public static String ATTRIB_ORDER_DIRECTION(Code) | | |
ATTRIB_SELECTED | final public static String ATTRIB_SELECTED(Code) | | |
ATTRIB_STRICT_TYPING | final public static String ATTRIB_STRICT_TYPING(Code) | | |
TAG_CONDITIONS | final public static String TAG_CONDITIONS(Code) | | |
TAG_FILTERCONDITIONS | final public static String TAG_FILTERCONDITIONS(Code) | | |
TAG_FILTERSOURCE | final public static String TAG_FILTERSOURCE(Code) | | |
TAG_FURTHERLINKS | final public static String TAG_FURTHERLINKS(Code) | | |
TAG_SEARCHCONDITIONS | final public static String TAG_SEARCHCONDITIONS(Code) | | |
TAG_SEARCHTEXT | final public static String TAG_SEARCHTEXT(Code) | | |
TAG_SEARCH_OBJECT | final public static String TAG_SEARCH_OBJECT(Code) | | |
m_ConditionColumns | protected List m_ConditionColumns(Code) | | Vector of WhereCondition objects, all of the columns that an object
manages itself.
|
m_ConditionGroups | protected List m_ConditionGroups(Code) | | Vector of GroupObjects identifying which groups should be in the search
|
m_ConditionOperator | protected String m_ConditionOperator(Code) | | String operator to link the condition profile properties
|
m_ConditionProfile | protected List m_ConditionProfile(Code) | | the properties to be used in the search
|
m_SearchColumns | protected List m_SearchColumns(Code) | | Vector of ColumnRefs, identifies which columns should be returned
|
m_SearchProfile | protected List m_SearchProfile(Code) | | Vector of Properties, identifies which Properties should be returned
|
m_bApprovedSearch | protected boolean m_bApprovedSearch(Code) | | |
m_bFilterCondsInclusive | protected boolean m_bFilterCondsInclusive(Code) | | |
m_bFilterCondsNotFound | protected boolean m_bFilterCondsNotFound(Code) | | |
m_bIndexableSearch | protected boolean m_bIndexableSearch(Code) | | |
m_bStrictType | protected boolean m_bStrictType(Code) | | |
m_nLimit | protected int m_nLimit(Code) | | |
m_nPosition | protected int m_nPosition(Code) | | |
m_nResultTotal | protected int m_nResultTotal(Code) | | |
m_orderByColMap | protected Map m_orderByColMap(Code) | | |
m_orderByPropMap | protected Map m_orderByPropMap(Code) | | |
m_sFilterObjectClassname | protected String m_sFilterObjectClassname(Code) | | |
m_searchObjectProfile | protected Profile m_searchObjectProfile(Code) | | |
Search | public Search()(Code) | | Basic constructor
|
addConditionGroup | public void addConditionGroup(AbstractParentObject grpObj)(Code) | | Adds a relationship condition to the search such that results will be
children of the given AbstractParentObject .
Parameters: grpObj - |
addConditionProfile | public void addConditionProfile(Profile prof) throws DataAccessException(Code) | | Adds conditions to the search defined by the given Profile ,
i.e. the conditions will be specified by the property instances the
profile contains.
Parameters: prof - throws: DataAccessException - |
addConditionProperty | public void addConditionProperty(AbstractPropertyInstance propInst)(Code) | | Adds a condition to this search which is defined by the given
AbstractPropertyInstance .
Parameters: propInst - |
addFilterSourceConditions | protected void addFilterSourceConditions(Element xmlElement, State state) throws PublishException(Code) | | Adds conditions to the search based on the filter source found in the
State . Given a set of property instances specified in
xmlElement , the filter source object is located and
values for the conditions are taken for the conditions.
Parameters: xmlElement - Parameters: state - throws: PublishException - |
addSelectColumn | public void addSelectColumn(ColumnRef colref)(Code) | | Adds a select column to be returned in the search. Objects which are
returned will be populated with this data from the executed search as an
optimisation.
Note: the column referenced will be associated to the object's core data
rather than profile data
Parameters: colref - |
addSelectProperty | public void addSelectProperty(AbstractPropertyInstance propInst)(Code) | | Adds a select column to be returned in the search which corresponds to
the given property instance. Objects which are returned will be populated
with this data from the executed search as an optimisation.
Parameters: propInst - |
cacheResults | public void cacheResults(boolean bCache)(Code) | | Switch caching of results on or off. Default is on.
Parameters: bCache - |
getConditionGroups | public List getConditionGroups()(Code) | | Returns the m_ConditionGroups. |
getConditionProfile | public List getConditionProfile()(Code) | | |
getOrderByColumns | public Set getOrderByColumns()(Code) | | Returns a Set of ColumnRef s which
represents the column by which the results will be ordered.
a Set of ColumnRef s |
getOrderDirection | public String getOrderDirection(ColumnRef colref)(Code) | | Returns the direction the results will be ordered in
for the specified column reference.
the direction the results will be ordered infor the specified column reference |
getSearchColumns | public List getSearchColumns()(Code) | | Returns the m_SearchColumns. |
getSearchText | protected String getSearchText()(Code) | | Returns the text associated with this search
|
getSearchType | public DataStoreObject getSearchType()(Code) | | Returns an object of the type that the search will be conducted on.
|
isApprovedSearch | public boolean isApprovedSearch()(Code) | | |
list | protected Element list(Element list, HarmoniseOutput output, State state) throws PublishException(Code) | | Publishes the 'List' element. Executes the search defined by the XML and
returns XML which will be a list of results published as specified by the
'Template' child element of 'List'.
Parameters: list - Parameters: output - Parameters: state - @throwsPublishException |
processFilterConditions | protected void processFilterConditions(Element xmlElement) throws PublishException(Code) | | Populates the search with filter conditions found in
xmlElement .
Parameters: xmlElement - throws: PublishException - |
processSearchConditions | protected void processSearchConditions(Element xmlElement, State state) throws PublishException(Code) | | Processes a 'Conditions' element to extract the conditions to be used in
the search.
Parameters: xmlElement - Parameters: state - throws: PublishException - |
publishResults | protected void publishResults(Element list, HarmoniseOutput output, State state, Template template, List results, int nPageId) throws PublishException(Code) | | Publishes the results contained in results using the given
Template under the Element list .
Parameters: list - Parameters: output - Parameters: state - Parameters: template - Parameters: results - Parameters: nPageId - throws: PublishException - |
search | protected Element search(Element search, HarmoniseOutput output, State state) throws PublishException(Code) | | Publishes the 'Search' element, at most fills in available values for
property instances.
Parameters: search - Parameters: output - Parameters: state - @throwsPublishException |
setApproved | public void setApproved(boolean bApproved)(Code) | | Parameters: b - |
setOrderBy | public void setOrderBy(ColumnRef colref, String sOrderDirection)(Code) | | Sets the column which will be used for ordering the results as well as
the direction of the ordering.
Parameters: colref - Parameters: sOrderDirection - |
setOrderBy | public void setOrderBy(AbstractPropertyInstance propInst, String sOrderDirection)(Code) | | Sets the property instance which should be used to order the search
results as well as the direction of the ordering.
Parameters: propInst - Parameters: sOrderDirection - |
setResultSize | public void setResultSize(int nNum)(Code) | | Sets the maximum size of the list of results.
Parameters: nNum - |
setSearchText | protected void setSearchText(String sSearchText)(Code) | | Sets the text associated with this search.
Parameters: sSearchText - |
setStringingOperator | public void setStringingOperator(String sOp)(Code) | | Sets the logical stringing operator to use between conditions.
Parameters: sOp - |
|
|