org.silverpeas.search.searchEngine.model
Class QueryDescription

java.lang.Object
  extended by org.silverpeas.search.searchEngine.model.QueryDescription
All Implemented Interfaces:
Serializable

public final class QueryDescription
extends Object
implements Serializable

A QueryDescription packs a query with the different spaces and components to be searched.

See Also:
Serialized Form

Constructor Summary
QueryDescription()
          The no parameters constructor builds an empty query.
QueryDescription(String query)
          The constructor set only the query string.
 
Method Summary
 void addComponent(String component)
           
 void addExternalComponents(String server, String component, String path, String url)
          add new external component to the list
 void addFieldQueries(List<FieldDescription> fieldQueries)
           
 void addFieldQuery(FieldDescription fieldQuery)
           
 void addSpaceComponentPair(String space, String component)
          Add the given instance of the component to the searched instances set.
 void clearMultiFieldQuery()
           
 Set<ExternalComponent> getExtComponents()
           
 List<FieldDescription> getMultiFieldQuery()
           
 String getQuery()
          Return the query string.
 String getRequestedAuthor()
          Return the requested author.
 String getRequestedCreatedAfter()
          get the after date
 String getRequestedCreatedBefore()
          get the before date
 String getRequestedFolder()
           
 String getRequestedLanguage()
          Returns the requested language.
 String getRequestedUpdatedAfter()
           
 String getRequestedUpdatedBefore()
           
 String getSearchingUser()
          return the user.
 Set<SpaceComponentPair> getSpaceComponentPairSet()
          Return the set of all the component's instances whose the documents must be searched.
 Map<String,String> getXmlQuery()
           
 String getXmlTitle()
           
 boolean isEmpty()
           
 boolean isPeriodDefined()
           
 boolean isSearchByComponentType()
           
 boolean isSearchBySpace()
           
 void setFieldQueries(List<FieldDescription> fieldQueries)
           
 void setQuery(String query)
          Set the query string.
 void setRequestedAuthor(String author)
          Set the requested author.
 void setRequestedCreatedAfter(String afterdate)
          Set the after date
 void setRequestedCreatedBefore(String beforedate)
          Set the before date
 void setRequestedFolder(String requestedFolder)
           
 void setRequestedLanguage(String requestedLang)
          Set the requested language.
 void setRequestedUpdatedAfter(String requestedUpdatedAfter)
           
 void setRequestedUpdatedBefore(String requestedUpdatedBefore)
           
 void setSearchByComponentType(boolean searchByComponentType)
           
 void setSearchBySpace(boolean isSearchBySpace)
           
 void setSearchingUser(String searchingUser)
          Set the user
 void setXmlQuery(Map<String,String> xmlQuery)
           
 void setXmlTitle(String xmlTitle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryDescription

public QueryDescription()
The no parameters constructor builds an empty query. The setQuery and addSpaceComponentPair() methods should be called to initialize the query. Other criterium (language, creation date ...) can be set before the request is sent to the searchEngine.


QueryDescription

public QueryDescription(String query)
The constructor set only the query string. The addSpaceComponentPair() method should be called to set the components instances whose documents will be searched. Other criterium (language, creation date ...) can be set before the request is sent to the searchEngine.

Method Detail

setQuery

public void setQuery(String query)
Set the query string.


getQuery

public String getQuery()
Return the query string.

Returns:

setSearchingUser

public void setSearchingUser(String searchingUser)
Set the user

Parameters:
searchingUser - : the user.

getSearchingUser

public String getSearchingUser()
return the user.

Returns:
the user.

addSpaceComponentPair

public void addSpaceComponentPair(String space,
                                  String component)
Add the given instance of the component to the searched instances set.

Parameters:
space -
component -

addComponent

public void addComponent(String component)

getSpaceComponentPairSet

public Set<SpaceComponentPair> getSpaceComponentPairSet()
Return the set of all the component's instances whose the documents must be searched. The return Set is a set of SpaceComponentPair.

Returns:

setRequestedLanguage

public void setRequestedLanguage(String requestedLang)
Set the requested language.

Parameters:
requestedLang -

getRequestedLanguage

public String getRequestedLanguage()
Returns the requested language.

Returns:

setRequestedAuthor

public void setRequestedAuthor(String author)
Set the requested author.

Parameters:
author -

getRequestedAuthor

public String getRequestedAuthor()
Return the requested author.

Returns:

setRequestedCreatedBefore

public void setRequestedCreatedBefore(String beforedate)
Set the before date

Parameters:
beforedate -

getRequestedCreatedBefore

public String getRequestedCreatedBefore()
get the before date


setRequestedCreatedAfter

public void setRequestedCreatedAfter(String afterdate)
Set the after date


getRequestedCreatedAfter

public String getRequestedCreatedAfter()
get the after date


setXmlQuery

public void setXmlQuery(Map<String,String> xmlQuery)

getXmlQuery

public Map<String,String> getXmlQuery()

getXmlTitle

public String getXmlTitle()

setXmlTitle

public void setXmlTitle(String xmlTitle)

getMultiFieldQuery

public List<FieldDescription> getMultiFieldQuery()

clearMultiFieldQuery

public void clearMultiFieldQuery()

addFieldQuery

public void addFieldQuery(FieldDescription fieldQuery)

addFieldQueries

public void addFieldQueries(List<FieldDescription> fieldQueries)

setFieldQueries

public void setFieldQueries(List<FieldDescription> fieldQueries)

isEmpty

public boolean isEmpty()

isPeriodDefined

public boolean isPeriodDefined()

isSearchBySpace

public boolean isSearchBySpace()
Returns:
the searchBySpace

setSearchBySpace

public void setSearchBySpace(boolean isSearchBySpace)
Parameters:
searchBySpace - the searchBySpace to set

getRequestedUpdatedBefore

public String getRequestedUpdatedBefore()

setRequestedUpdatedBefore

public void setRequestedUpdatedBefore(String requestedUpdatedBefore)

getRequestedUpdatedAfter

public String getRequestedUpdatedAfter()

setRequestedUpdatedAfter

public void setRequestedUpdatedAfter(String requestedUpdatedAfter)

getExtComponents

public Set<ExternalComponent> getExtComponents()
Returns:
the external components

addExternalComponents

public void addExternalComponents(String server,
                                  String component,
                                  String path,
                                  String url)
add new external component to the list

Parameters:
server -
component -

isSearchByComponentType

public boolean isSearchByComponentType()

setSearchByComponentType

public void setSearchByComponentType(boolean searchByComponentType)

setRequestedFolder

public void setRequestedFolder(String requestedFolder)

getRequestedFolder

public String getRequestedFolder()


Copyright © 2016 Silverpeas. All Rights Reserved.