org.objectweb.telosys.service.search
Class SQLSearchAncestor

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.service.StandardScreenService
          extended byorg.objectweb.telosys.service.search.SQLSearchAncestor
All Implemented Interfaces:
ScreenService
Direct Known Subclasses:
SQLSearch, SQLSearchWithCount, SQLSearchWithPages

public abstract class SQLSearchAncestor
extends StandardScreenService

Generic abstract class for SQL search services


Field Summary
protected  boolean _bDynamicParameters
           
protected  Criteria _criteria
           
protected  SQLDataSetDefinition _dsDefinition
           
protected  SearchMessages _messages
           
protected static int MAXI_DEFAULT
           
protected static int MAXI_NOT_SET
           
protected static int MAXI_UNLIMITED
           
 
Constructor Summary
SQLSearchAncestor()
           
 
Method Summary
 void after(ScreenSession screenSession, ServiceRequest serviceRequest, ServiceResponse serviceResponse)
          Hook method called after the search operation
( designed to be overridden in subclasses if necessary )
 void before(ScreenSession screenSession, ServiceRequest serviceRequest, ServiceResponse serviceResponse)
          Hook method called before the search operation
( designed to be overridden in subclasses if necessary )
protected  int countParams(java.util.Map requestParameters)
           
protected  int getDefaultMaxRows()
          Returns the default value for the maximum number of rows
protected  Joker getJoker()
          Returns the current "joker"
protected  int getMaxRows()
          Returns the current value for the maximum number of rows
protected  java.lang.String getParamValue(java.util.Map requestParameters, int iParamNum)
           
protected  java.lang.String getParamValue(java.util.Map requestParameters, java.lang.String sParamName)
           
protected  java.lang.String[] getStringParams(java.util.Map requestParameters)
          Return a String array of parameters
protected  void init(SQLDataSetDefinition def)
          Initializes the SQL search service (no dynamic parameters)
protected  void init(SQLDataSetDefinition def, Criteria criteria)
          Initializes the SQL search service (with dynamic parameters)
protected  boolean maxRowsIsNotSet()
          Returns true if the maximum number of rows is not set
protected  boolean maxRowsIsSet()
          Returns true if the maximum number of rows is set
protected  void setCriterias(java.util.Map requestParameters)
          Set the dynamic criterias according with the input parameters
protected  int setDefaultMaxRows()
          Set the default maximum number of rows
protected  void setJoker()
          Set the default "joker" ( all the "*" are replaced by "%" )
By default there's no joker
protected  void setJoker(Joker joker)
          Set the specific "joker" to use
By default there's no joker
protected  void setMaxRows(int iMaxi)
          Set the maximum number of rows
protected  void setMessages(SearchMessages messages)
          Set the messages provider to use
protected  void setSessionKey(java.lang.String s)
          Deprecated.  
 
Methods inherited from class org.objectweb.telosys.service.StandardScreenService
getName, getRenderer, getSessionKey, init
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.telosys.service.ScreenService
execute
 

Field Detail

MAXI_UNLIMITED

protected static final int MAXI_UNLIMITED
See Also:
Constant Field Values

MAXI_NOT_SET

protected static final int MAXI_NOT_SET
See Also:
Constant Field Values

MAXI_DEFAULT

protected static final int MAXI_DEFAULT
See Also:
Constant Field Values

_bDynamicParameters

protected boolean _bDynamicParameters

_criteria

protected Criteria _criteria

_dsDefinition

protected SQLDataSetDefinition _dsDefinition

_messages

protected SearchMessages _messages
Constructor Detail

SQLSearchAncestor

public SQLSearchAncestor()
Method Detail

init

protected void init(SQLDataSetDefinition def)
Initializes the SQL search service (no dynamic parameters)

Parameters:
def - the SQLDataset definition to use in this service

init

protected void init(SQLDataSetDefinition def,
                    Criteria criteria)
Initializes the SQL search service (with dynamic parameters)

Parameters:
def - the SQLDataset definition to use in this service
criteria - the SQL criteria to use

maxRowsIsSet

protected boolean maxRowsIsSet()
Returns true if the maximum number of rows is set

Returns:

maxRowsIsNotSet

protected boolean maxRowsIsNotSet()
Returns true if the maximum number of rows is not set

Returns:

setDefaultMaxRows

protected int setDefaultMaxRows()
Set the default maximum number of rows

Returns:

getDefaultMaxRows

protected int getDefaultMaxRows()
Returns the default value for the maximum number of rows

Returns:

setMaxRows

protected void setMaxRows(int iMaxi)
Set the maximum number of rows

Parameters:
iMaxi -

getMaxRows

protected int getMaxRows()
Returns the current value for the maximum number of rows

Returns:

setMessages

protected void setMessages(SearchMessages messages)
Set the messages provider to use

Parameters:
messages -

setSessionKey

protected void setSessionKey(java.lang.String s)
Deprecated.  

Do not use !

Parameters:
s -

setJoker

protected void setJoker(Joker joker)
Set the specific "joker" to use
By default there's no joker

Parameters:
joker -

setJoker

protected void setJoker()
Set the default "joker" ( all the "*" are replaced by "%" )
By default there's no joker


getJoker

protected Joker getJoker()
Returns the current "joker"

Returns:

getParamValue

protected java.lang.String getParamValue(java.util.Map requestParameters,
                                         java.lang.String sParamName)

getParamValue

protected java.lang.String getParamValue(java.util.Map requestParameters,
                                         int iParamNum)

countParams

protected int countParams(java.util.Map requestParameters)

getStringParams

protected java.lang.String[] getStringParams(java.util.Map requestParameters)
Return a String array of parameters

Parameters:
requestParameters -
Returns:
parameters array

setCriterias

protected void setCriterias(java.util.Map requestParameters)
Set the dynamic criterias according with the input parameters

Parameters:
requestParameters -
Returns:

before

public void before(ScreenSession screenSession,
                   ServiceRequest serviceRequest,
                   ServiceResponse serviceResponse)
Hook method called before the search operation
( designed to be overridden in subclasses if necessary )

Parameters:
screenSession -
serviceRequest -
serviceResponse -

after

public void after(ScreenSession screenSession,
                  ServiceRequest serviceRequest,
                  ServiceResponse serviceResponse)
Hook method called after the search operation
( designed to be overridden in subclasses if necessary )

Parameters:
screenSession -
serviceRequest -
serviceResponse -