com.ibm.commerce.search.beans
Class SearchBaseDataBean

java.lang.Object
  |
  +--com.ibm.commerce.beans.InputDataBeanImpl
        |
        +--com.ibm.commerce.beans.SmartDataBeanImpl
              |
              +--com.ibm.commerce.search.beans.SearchBaseDataBean
All Implemented Interfaces:
DataBean, InputDataBean, SearchConstants, java.io.Serializable, SmartDataBean
Direct Known Subclasses:
CatalogSearchListDataBean, CategorySearchListDataBean, CatEntrySearchListDataBean

public abstract class SearchBaseDataBean
extends SmartDataBeanImpl
implements SearchConstants

Insert the type's description here.

See Also:
Serialized Form

Field Summary
protected  Cursor aCursor
          aCursor (Cursor): This is a virtual cursor to manage paging of result set in pageSize blocks.
protected  java.lang.String beginIndex
          beginIndex (String): The value of this variable is used identify the first result of the any page.
protected  CommandContext commandContext
          commandContext (CommandContext): Commerce context containing session data
protected  java.lang.String databaseType
          databaseType (String): This is a virtual cursor to manage paging of result set in pageSize blocks.
protected  java.lang.String pageSize
          pageSize (String): The value of this variable is used identify the number of elements on each page.
protected  RuleQuery q
          q (RuleQuery): The search interface query object containing generated SQL
protected  java.lang.String resultCount
          resultCount (String): The total number of elements found in result set.
 
Fields inherited from class com.ibm.commerce.beans. SmartDataBeanImpl
COPYRIGHT
 
Fields inherited from class com.ibm.commerce.beans. InputDataBeanImpl
requestProperties
 
Fields inherited from interface com.ibm.commerce.search.beans. SearchConstants
ALL, ALL_CATALOG, ALL_CATEGORIES, ALLWORDS, ANYWORDS, ATTRVALUE_FLOATVALUE, ATTRVALUE_INTEGERVALUE, ATTRVALUE_STRINGVALUE, BOTH, CASE_SENSITIVE, CATGPENREL_BOTH_SCHEMA_TYPE, CATGPENREL_PRODUCT_SCHEMA_TYPE, COPYRIGHT, DISTINCT_RESULT, EXACTPHRASE, ITEM, LISTPRICE_ON, MASTER_CATALOG, OPERATOR_EQUAL, OPERATOR_GREATER, OPERATOR_GREATER_EQUAL, OPERATOR_IN, OPERATOR_LESS, OPERATOR_LESS_EQUAL, OPERATOR_LIKE, OPERATOR_NOT_EQUAL, OPERATOR_NOT_LIKE, PRODUCT, SEARCH_IN_CATEGORYNAME, SEARCH_IN_CATEGORYNAME_AND_DESCRIPTIONS, SEARCH_IN_CATEGORYNAME_AND_SHORT_DESCRIPTION, SEARCH_IN_KEYWORD, SEARCH_IN_PRODUCTNAME, SEARCH_IN_PRODUCTNAME_AND_DESCRIPTIONS, SEARCH_IN_PRODUCTNAME_AND_SHORT_DESCRIPTION
 
Fields inherited from interface com.ibm.commerce.beans. DataBean
emptyString
 
Constructor Summary
SearchBaseDataBean()
          SearchDataBean constructor comment.
 
Method Summary
protected abstract  void execute()
          Build complete query and retrieve result set
 java.lang.String getBeginIndex()
          Returns beginIndex of type String
protected  int getNumericOperator(java.lang.String opKey)
          The input search criteria operators are of type String.
 java.lang.String getPageSize()
          Return pageSize of type String
 java.lang.String getResultCount()
          Returns resultCount
protected  int getStringOperator(java.lang.String opKey)
          Converts Operators (LIKE,EQUAL,NOTLIKE) to search interface integer constant
protected  void initialize()
          Defines cursor begin index and page size
protected  boolean isEmpty(java.lang.String str)
          Checks if a string is null or blank space.
abstract  void populate()
          Insert the method's description here.
 void setBeginIndex(java.lang.String newBeginIndex)
          The beginIndex identifies the first element result of any page from total number of elements in result set.
 void setPageSize(java.lang.String newPageSize)
          To set pageSize defines the number elements in each page
protected abstract  void setPredefinedAttributes()
          Processes data bean variables from request object
 void setResultCount(java.lang.String newResultCount)
          The resultCount is the total number of elements in result set
 
Methods inherited from class com.ibm.commerce.beans. SmartDataBeanImpl
fulfills, getCommandContext, getResources, setCommandContext
 
Methods inherited from class com.ibm.commerce.beans. InputDataBeanImpl
getRequestProperties, setRequestProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.beans. InputDataBean
getRequestProperties, setRequestProperties
 

Field Detail

beginIndex

protected java.lang.String beginIndex
beginIndex (String): The value of this variable is used identify the first result of the any page.

pageSize

protected java.lang.String pageSize
pageSize (String): The value of this variable is used identify the number of elements on each page.

aCursor

protected Cursor aCursor
aCursor (Cursor): This is a virtual cursor to manage paging of result set in pageSize blocks.

databaseType

protected java.lang.String databaseType
databaseType (String): This is a virtual cursor to manage paging of result set in pageSize blocks.

resultCount

protected java.lang.String resultCount
resultCount (String): The total number of elements found in result set.

q

protected RuleQuery q
q (RuleQuery): The search interface query object containing generated SQL

commandContext

protected CommandContext commandContext
commandContext (CommandContext): Commerce context containing session data
Constructor Detail

SearchBaseDataBean

public SearchBaseDataBean()
SearchDataBean constructor comment.
Method Detail

execute

protected abstract void execute()
                         throws java.lang.Exception
Build complete query and retrieve result set
java.lang.Exception

getBeginIndex

public java.lang.String getBeginIndex()
Returns beginIndex of type String
Returns:
The starting index for a page

getNumericOperator

protected int getNumericOperator(java.lang.String opKey)
The input search criteria operators are of type String. This method converts numeric input operators ( =, >, >=, <=,<) of type String to an equivalent integer constant defined in search inteface class RuleQuery.
Parameters:
opKey - The input search criteria operator (numeric operator) of type String value.
Returns:
The integer value of a numeric operator defined in RuleQuery.

getPageSize

public java.lang.String getPageSize()
Return pageSize of type String
Returns:
The number of search result records to be dispalyed in a page.

getResultCount

public java.lang.String getResultCount()
Returns resultCount
Returns:
The number of rows retrieved for this search criteria.

getStringOperator

protected int getStringOperator(java.lang.String opKey)
Converts Operators (LIKE,EQUAL,NOTLIKE) to search interface integer constant
Parameters:
opKey - The search interface constant for operators Like, Equal and Not Equal.
Returns:

initialize

protected void initialize()
                   throws java.lang.Exception
Defines cursor begin index and page size
java.lang.Exception

isEmpty

protected boolean isEmpty(java.lang.String str)
Checks if a string is null or blank space.
Parameters:
str - Input string that is to be checked for null or blank space.
Returns:
flase if null or space, true otherwise.

populate

public abstract void populate()
                       throws java.lang.Exception
Insert the method's description here.
Specified by:
populate in interface SmartDataBean
Overrides:
populate in class SmartDataBeanImpl
Throws:
java.lang.Exception - should not happen since there is no data retrieved to populate the databean.

setBeginIndex

public void setBeginIndex(java.lang.String newBeginIndex)
The beginIndex identifies the first element result of any page from total number of elements in result set.
Parameters:
newBeginIndex - int

setPageSize

public void setPageSize(java.lang.String newPageSize)
To set pageSize defines the number elements in each page
Parameters:
newPageSize - int

setPredefinedAttributes

protected abstract void setPredefinedAttributes()
                                         throws java.lang.Exception
Processes data bean variables from request object
java.lang.Exception

setResultCount

public void setResultCount(java.lang.String newResultCount)
The resultCount is the total number of elements in result set
Parameters:
newResultCount - java.lang.String