de.fh_mannheim.mm.dms.framework
Class Query

java.lang.Object
  extended byde.fh_mannheim.mm.dms.framework.Query
All Implemented Interfaces:
IElement

public class Query
extends java.lang.Object
implements IElement

This class converts a query string into a formatted string.

Version:
$Revision: 1.7 $
Author:
Jan Löffler, mail@jlsoft.de

Field Summary
static char charBOOLEAN_AND
          Chars for introducing a boolean value
static char charBOOLEAN_NOT
           
 
Constructor Summary
Query()
          Constructor.
Query(java.lang.String strQuery)
          Constructor.
Query(java.lang.String strQuery, int nLanguage, int nFiletype, FormattedDate minAge, FormattedDate maxAge, int nLimit, boolean bWebSearch, int nUserID)
          Constructor.
Query(java.lang.String strQuery, int nLanguage, int nFiletype, int nLimit, boolean bWebSearch, int nUserID)
          Constructor.
 
Method Summary
 void addQuery(java.lang.String strQuery)
          Add a query.
 void addQueryWord(java.lang.String strWord)
          Add a word.
 java.util.ArrayList getAllowedWords()
          Get all words, which are should exist.
 java.util.ArrayList getAllWords()
          Get all words.
 int getFiletype()
          Get filetype of query.
 java.util.ArrayList getForbiddenWords()
          Get all words, which are forbidden.
 int getLanguage()
          Get language of query.
 int getLimit()
          Get limit of query.
 FormattedDate getMaximumAge()
          Get maximum age of retrieved files.
 FormattedDate getMinimumAge()
          Get minimum age of retrieved files.
 java.lang.String getPattern()
          Get the formatted query for a new query
 java.util.ArrayList getRequiredWords()
          Get all words, which are required.
 int getUserID()
          Get user of query.
 boolean isComplete()
          Is query complete.
 boolean isWebSearchEnabled()
          Is websearch enabled or not.
 void setFiletype(int nFiletype)
          Set filetype of query.
 void setLanguage(int nLanguage)
          Set language of query.
 void setLimit(int nLimit)
          Set limit of query.
 void setMaximumAge(FormattedDate maxAge)
          Set maximum age of retrieved files.
 void setMinimumAge(FormattedDate minAge)
          Set minimum age of retrieved files.
 void setUserID(int nUserID)
          Set user of query.
 void setWebSearch(boolean bEnabled)
          Set websearch for query.
 org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
          Write information of query in a xml element.
 org.w3c.dom.Element toElement(org.w3c.dom.Element element, org.w3c.dom.Document doc)
          Write information of query in a xml element.
 java.lang.String toString()
          Get the formatted query
 java.lang.String toSummary()
          Get the formatted query
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

charBOOLEAN_AND

public static final char charBOOLEAN_AND
Chars for introducing a boolean value

See Also:
Constant Field Values

charBOOLEAN_NOT

public static final char charBOOLEAN_NOT
See Also:
Constant Field Values
Constructor Detail

Query

public Query()
Constructor.


Query

public Query(java.lang.String strQuery)
Constructor.

Parameters:
strQuery - Pre-selected query

Query

public Query(java.lang.String strQuery,
             int nLanguage,
             int nFiletype,
             int nLimit,
             boolean bWebSearch,
             int nUserID)
Constructor.

Parameters:
strQuery - Pre-selected query
nLanguage - Language
nFiletype - Filetype
nLimit - Limit
bWebSearch - WebSearch
nUserID - User

Query

public Query(java.lang.String strQuery,
             int nLanguage,
             int nFiletype,
             FormattedDate minAge,
             FormattedDate maxAge,
             int nLimit,
             boolean bWebSearch,
             int nUserID)
Constructor.

Parameters:
strQuery - Pre-selected query
nLanguage - Language
nFiletype - Filetype
minAge - Minimum Age as date
maxAge - Maximum Age as date
nLimit - Limit
bWebSearch - WebSearch
nUserID - User
Method Detail

addQueryWord

public void addQueryWord(java.lang.String strWord)
Add a word.

Parameters:
strWord - New keyword

addQuery

public void addQuery(java.lang.String strQuery)
Add a query.

Parameters:
strQuery - New query string

getLanguage

public int getLanguage()
Get language of query.

Returns:
language

getLimit

public int getLimit()
Get limit of query.

Returns:
limit

getMaximumAge

public FormattedDate getMaximumAge()
Get maximum age of retrieved files.

Returns:
age

getMinimumAge

public FormattedDate getMinimumAge()
Get minimum age of retrieved files.

Returns:
age

getFiletype

public int getFiletype()
Get filetype of query.

Returns:
filetype

getUserID

public int getUserID()
Get user of query.

Returns:
ID of user

getRequiredWords

public java.util.ArrayList getRequiredWords()
Get all words, which are required.

Returns:
words

getAllowedWords

public java.util.ArrayList getAllowedWords()
Get all words, which are should exist.

Returns:
words

getForbiddenWords

public java.util.ArrayList getForbiddenWords()
Get all words, which are forbidden.

Returns:
words

getAllWords

public java.util.ArrayList getAllWords()
Get all words.

Returns:
words

getPattern

public java.lang.String getPattern()
Get the formatted query for a new query

Returns:
query

isWebSearchEnabled

public boolean isWebSearchEnabled()
Is websearch enabled or not.

Returns:
true, if websearch is enabled

isComplete

public boolean isComplete()
Is query complete.

Returns:
true, if query is ready

setLanguage

public void setLanguage(int nLanguage)
Set language of query.

Parameters:
nLanguage - Language

setLimit

public void setLimit(int nLimit)
Set limit of query.

Parameters:
nLimit - Limit

setMinimumAge

public void setMinimumAge(FormattedDate minAge)
Set minimum age of retrieved files.

Parameters:
minAge - Minimum age as date

setMaximumAge

public void setMaximumAge(FormattedDate maxAge)
Set maximum age of retrieved files.

Parameters:
maxAge - Maximum age as date

setFiletype

public void setFiletype(int nFiletype)
Set filetype of query.

Parameters:
nFiletype - Filetype

setUserID

public void setUserID(int nUserID)
Set user of query.

Parameters:
nUserID - User

setWebSearch

public void setWebSearch(boolean bEnabled)
Set websearch for query.

Parameters:
bEnabled - Websearch enabled or not

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
Write information of query in a xml element.

Specified by:
toElement in interface IElement
Parameters:
doc - XML Document
Returns:
element

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Element element,
                                     org.w3c.dom.Document doc)
Write information of query in a xml element.

Specified by:
toElement in interface IElement
Parameters:
element - Root element
doc - XML Document
Returns:
element

toString

public java.lang.String toString()
Get the formatted query

Specified by:
toString in interface IElement
Returns:
query

toSummary

public java.lang.String toSummary()
Get the formatted query

Returns:
query