uk.ac.ebi.intact.application.commons.search
Class SearchHelper

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.commons.search.SearchHelper
All Implemented Interfaces:
SearchHelperI

public class SearchHelper
extends java.lang.Object
implements SearchHelperI

Performs an intelligent search on the intact database.

Version:
$Id: SearchHelper.java,v 1.2 2004/03/19 12:04:40 smudali Exp $
Author:
Samuel Kerrien (skerrien@ebi.ac.uk)

Constructor Summary
SearchHelper(org.apache.log4j.Logger logger)
          Create a search helper for which all the log message will be written by the provided logger.
 
Method Summary
 java.util.Collection doLookup(java.util.List searchClasses, java.lang.String values, IntactUserI user)
          Search in the IntAct data for a colleciton of object (type=searchClass).
 java.util.Collection doLookup(java.lang.String searchClass, java.lang.String values, IntactUserI user)
          Search in the IntAct data for a colleciton of object (type=searchClass).
 java.util.Collection doLookupSimple(java.lang.String searchClass, java.lang.String query, IntactUserI user)
          Peforms a simple search in the IntAct data for given search class and value.
 java.util.Collection getSearchCritera()
          Return a collection of search criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchHelper

public SearchHelper(org.apache.log4j.Logger logger)
Create a search helper for which all the log message will be written by the provided logger.

Parameters:
logger - the user's logger.
Method Detail

getSearchCritera

public java.util.Collection getSearchCritera()
Description copied from interface: SearchHelperI
Return a collection of search criteria.

Specified by:
getSearchCritera in interface SearchHelperI
Returns:
a Collection of CriteriaBean.

doLookupSimple

public java.util.Collection doLookupSimple(java.lang.String searchClass,
                                           java.lang.String query,
                                           IntactUserI user)
                                    throws IntactException
Description copied from interface: SearchHelperI
Peforms a simple search in the IntAct data for given search class and value. This search is limited to AC and short label fields.

Specified by:
doLookupSimple in interface SearchHelperI
Parameters:
searchClass - the search class to perform the search on (e.g., Experiment)
query - the search query; doesn't support mupltiple comma separated values.
user - the user to invoke search on.
Returns:
a collection of Intact objects of same class as searchClass or an empty collection if none found.
Throws:
IntactException - for any errors in searching the persistent system.

doLookup

public java.util.Collection doLookup(java.lang.String searchClass,
                                     java.lang.String values,
                                     IntactUserI user)
                              throws IntactException
Description copied from interface: SearchHelperI
Search in the IntAct data for a colleciton of object (type=searchClass). The objects found must match with the value given by the user (ac, shortlabel ...).

Specified by:
doLookup in interface SearchHelperI
Parameters:
searchClass - the search class we are looking for in the IntAct data.
values - the queryString for which the objects should match.
user - the IntAct datasource.
Returns:
A collection of Intact objects of the type searchClass.
Throws:
IntactException - if an erro occurs when searching in the database.

doLookup

public java.util.Collection doLookup(java.util.List searchClasses,
                                     java.lang.String values,
                                     IntactUserI user)
                              throws IntactException
Description copied from interface: SearchHelperI
Search in the IntAct data for a colleciton of object (type=searchClass). The objects found must match with the value given by the user (ac, shortlabel ...).

Specified by:
doLookup in interface SearchHelperI
Parameters:
searchClasses - the search classes (ordered by preference) we are looking for in the IntAct data.
values - the queryString for which the objects should match.
user - the IntAct datasource.
Returns:
A collection of Intact objects of the type searchClass.
Throws:
IntactException - if an erro occurs when searching in the database.


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk