java.lang.Objectcom.ibm.commerce.tools.util.CommonSearchHelperBean
com.ibm.commerce.tools.campaigns.CatalogSearchListDataBean
This data bean finds catalog entries or categories in a store. It accepts parameters to be used as the search criteria, generates and executes a SQL query to find the result set from the database, and returns the result to the view. In order to use the abstract class (com.ibm.commerce.tools.util.CommonSearchHelperBean) to support the DB side execution, the most important methods that would be necessary are the ones to contruct the database query and the list of data beans. You would also need to be able to get a list of entries that have been found and get a specific entry that has been found.
To make use of the com.ibm.commerce.tools.util.CommonSearchHelperBean class you must first create a query that will return the desired results from the database. Some hints as to how to do this can be taken from looking at the current EJB's and discovering what tables and contraints they currently use to retrieve the desired data. Any parameters that are to be passed to the query such as ordering information or search criteria must be received before the execution of the query. Some of these parameters will have been set throught the search or list data bean's constructor. They can also be set through calling set methods in the JSP. The com.ibm.commerce.tools.util.CommonSearchHelperBean provides a method to exectue the SQL statement. It sets up a cursor and a com.ibm.commerce.base.objects.ServerJDBCHelperAccessBean and passes the cursor and the returned SQL string (that you have built in the buildQuery method you have implemented) to the com.ibm.commerce.base.objects.ServerJDBCHelperAccessBean. The result size is then set, taken from the cursor. Using the cursor we can account for high volumes of returned results by dividing the results onto an appropriate number of pages. Next you would have to implement the buildResultDataBean method. This method would need to get the results from the returned vector and parse each row into the set methods of a data bean. One would need to either create or augment an existing data bean to allow parameters to be set in the data bean.
Field Summary | |
static java.lang.String | CATENTRY_TYPE_BUNDLE Values of the catalog entry type, for example: Product, Item, Package, and so on. |
static java.lang.String | CATENTRY_TYPE_DYNAMIC_KIT Values of the catalog entry type, for example: Product, Item, Package, and so on. |
static java.lang.String | CATENTRY_TYPE_ITEM Values of the catalog entry type, for example: Product, Item, Package, and so on. |
static java.lang.String | CATENTRY_TYPE_PACKAGE Values of the catalog entry type, for example: Product, Item, Package, and so on. |
static java.lang.String | CATENTRY_TYPE_PRODUCT Values of the catalog entry type, for example: Product, Item, Package, and so on. |
static java.lang.String | COPYRIGHT IBM copyright notice field. |
static java.lang.String | ORDER_BY_CATEGORY_NAME Database column on the category tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_CATEGORY_PARENT Database column on the category tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_CATEGORY_SHORTDESC Database column on the category tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_PRODUCT_CODE Database column on the catalog entry tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_PRODUCT_NAME Database column on the catalog entry tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_PRODUCT_SHORTDESC Database column on the catalog entry tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | ORDER_BY_PRODUCT_TYPE Database column on the catalog entry tables used in the order by clause of the SQL query to do sorting. |
static java.lang.String | SEARCH_TYPE_CATENTRY Values used to determine the kind of search it's performing, either catalog entry or category. |
static java.lang.String | SEARCH_TYPE_CATGROUP Values used to determine the kind of search it's performing, either catalog entry or category. |
static java.lang.String | TYPE_LIKE_CASE_SENSITIVE Values of the search type for each criteria. TYPE_LIKE_CASE_SENSITIVE - Matches containing and case sensitive TYPE_LIKE_IGNORE_CASE - Matches containing and case insensitive TYPE_MATCH_CASE_SENSITIVE - Exact phrase and case sensitive TYPE_MATCH_IGNORE_CASE - Exact phrase and case insensitive |
static java.lang.String | TYPE_LIKE_IGNORE_CASE Values of the search type for each criteria. TYPE_LIKE_CASE_SENSITIVE - Matches containing and case sensitive TYPE_LIKE_IGNORE_CASE - Matches containing and case insensitive TYPE_MATCH_CASE_SENSITIVE - Exact phrase and case sensitive TYPE_MATCH_IGNORE_CASE - Exact phrase and case insensitive |
static java.lang.String | TYPE_MATCH_CASE_SENSITIVE Values of the search type for each criteria. TYPE_LIKE_CASE_SENSITIVE - Matches containing and case sensitive TYPE_LIKE_IGNORE_CASE - Matches containing and case insensitive TYPE_MATCH_CASE_SENSITIVE - Exact phrase and case sensitive TYPE_MATCH_IGNORE_CASE - Exact phrase and case insensitive |
static java.lang.String | TYPE_MATCH_IGNORE_CASE Values of the search type for each criteria. TYPE_LIKE_CASE_SENSITIVE - Matches containing and case sensitive TYPE_LIKE_IGNORE_CASE - Matches containing and case insensitive TYPE_MATCH_CASE_SENSITIVE - Exact phrase and case sensitive TYPE_MATCH_IGNORE_CASE - Exact phrase and case insensitive |
Constructor Summary | |
CatalogSearchListDataBean() Constructor for CatalogSearchListDataBean. |
Method Summary | |
java.lang.String | buildQuery() Constructs the SQL query. |
void | buildResultDataBean(java.util.Vector resultVector) Constructs the list of result data beans. |
CatalogSearchDataBean[] | getCatalogList() Returns the list of data beans found from the search or list, represented by an array of CatalogSearchDataBean object. |
CatalogSearchDataBean | getCatalogListData(int index) Returns the specific data bean at the passed index within the array of data beans returned, represented by a CatalogSearchDataBean object. |
java.lang.String | getCatentryType() Gets the type of catalog entry that is being searched against, can be either all types of catalog entry, or items only. |
java.lang.String | getOrderby() Gets the parameter that is used to order the results in the SQL query. |
java.lang.String | getSearchType() Gets the type of search to be performed, which identifies whether this search logic is used to search for category or catalog entry. |
java.lang.String | getSrName() Gets the name of the item to search for, this is the value of the name criteria. |
java.lang.String | getSrNameType() Gets the type of search that is being performed to the name criteria. |
java.lang.String | getSrPartNumber() Gets the SKU of the item to search for, this is the value of the SKU criteria. |
java.lang.String | getSrPartNumberType() Gets the type of search that is being performed to the SKU criteria. |
java.lang.String | getSrShortDescription() Gets the short description of the item to search for, this is the value of the short description criteria. |
java.lang.String | getSrShortDescriptionType() Gets the type of search that is being performed to the short description criteria. |
void | setCatalogList(java.util.Vector newCatalogList) Sets the list of data beans found from the search or list. |
void | setCatentryType(java.lang.String newCatentryType) Sets the type of catalog entry that is being searched against, can be either all types of catalog entry, or items only. |
void | setOrderby(java.lang.String newOrderby) Sets the parameter that is used to order the results in the SQL query. |
void | setSearchType(java.lang.String newSearchType) Sets the type of search to be performed, which identifies whether this search logic is used to search for category or catalog entry. |
void | setSrName(java.lang.String newSrName) Sets the name of the item to search for, this is the value of the name criteria. |
void | setSrNameType(java.lang.String newSrNameType) Sets the type of search that is being performed to the name criteria. |
void | setSrPartNumber(java.lang.String newSrPartNumber) Sets the SKU of the item to search for, this is the value of the SKU criteria. |
void | setSrPartNumberType(java.lang.String newSrPartNumberType) Sets the type of search that is being performed to the SKU criteria. |
void | setSrShortDescription(java.lang.String newSrShortDescription) Sets the short description of the item to search for, this is the value of the short description criteria. |
void | setSrShortDescriptionType(java.lang.String newSrShortDescriptionType) Sets the type of search that is being performed to the short description criteria. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String COPYRIGHT
public static final java.lang.String ORDER_BY_PRODUCT_CODE
public static final java.lang.String ORDER_BY_PRODUCT_NAME
public static final java.lang.String ORDER_BY_PRODUCT_SHORTDESC
public static final java.lang.String ORDER_BY_PRODUCT_TYPE
public static final java.lang.String ORDER_BY_CATEGORY_NAME
public static final java.lang.String ORDER_BY_CATEGORY_SHORTDESC
public static final java.lang.String ORDER_BY_CATEGORY_PARENT
public static final java.lang.String TYPE_LIKE_CASE_SENSITIVE
public static final java.lang.String TYPE_LIKE_IGNORE_CASE
public static final java.lang.String TYPE_MATCH_CASE_SENSITIVE
public static final java.lang.String TYPE_MATCH_IGNORE_CASE
public static final java.lang.String SEARCH_TYPE_CATENTRY
public static final java.lang.String SEARCH_TYPE_CATGROUP
public static final java.lang.String CATENTRY_TYPE_PRODUCT
public static final java.lang.String CATENTRY_TYPE_ITEM
public static final java.lang.String CATENTRY_TYPE_PACKAGE
public static final java.lang.String CATENTRY_TYPE_BUNDLE
public static final java.lang.String CATENTRY_TYPE_DYNAMIC_KIT
Constructor Detail |
public CatalogSearchListDataBean()
Method Detail |
public java.lang.String buildQuery() throws java.lang.Exception
public void buildResultDataBean(java.util.Vector resultVector)
public CatalogSearchDataBean[] getCatalogList()
public CatalogSearchDataBean getCatalogListData(int index) throws java.lang.ArrayIndexOutOfBoundsException
public java.lang.String getSrName()
public java.lang.String getSrNameType()
public java.lang.String getOrderby()
public java.lang.String getSrPartNumber()
public java.lang.String getSrPartNumberType()
public java.lang.String getSearchType()
public java.lang.String getSrShortDescription()
public java.lang.String getSrShortDescriptionType()
public java.lang.String getCatentryType()
public void setCatalogList(java.util.Vector newCatalogList)
public void setSrName(java.lang.String newSrName)
public void setSrNameType(java.lang.String newSrNameType)
public void setOrderby(java.lang.String newOrderby)
public void setSrPartNumber(java.lang.String newSrPartNumber)
public void setSrPartNumberType(java.lang.String newSrPartNumberType)
public void setSearchType(java.lang.String newSearchType)
public void setSrShortDescription(java.lang.String newSrShortDescription)
public void setSrShortDescriptionType(java.lang.String newSrShortDescriptionType)
public void setCatentryType(java.lang.String newCatentryType)
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.