com.softslate.commerce.businessobjects.product
Class BasicProductProcessor

java.lang.Object
  extended bycom.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended bycom.softslate.commerce.businessobjects.core.BaseBusinessProcessor
          extended bycom.softslate.commerce.businessobjects.product.BasicProductProcessor
All Implemented Interfaces:
BusinessObject, BusinessProcessor, ProductProcessor

public class BasicProductProcessor
extends BaseBusinessProcessor
implements ProductProcessor

Processes business logic affecting products and other related objects. BasicProductProcessor is the default implementation of the ProductProcessor interface for the application.

Author:
David Tobey
See Also:
ProductProcessor

Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Fields inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
 
Constructor Summary
BasicProductProcessor()
           
 
Method Summary
 void addProduct(java.util.Map parameters)
           
 void deleteProduct(java.util.Map parameters)
           
 void editDeleteProducts(java.util.Map parameters)
           
 void editProduct(java.util.Map parameters)
           
 java.util.HashMap generateSettingsMap(java.util.Collection settings)
           
 java.util.Collection getAllAttributesAndOptions(int productID)
           
 Category getCategoryFromCode(Category category)
          Retrieves category information from the database.
 Product getProductFromCode(Product product)
          Retrieves product information from the database.
 ProductList getProductList(ProductList productList)
          Retrieves information for a list of products from the database.
 java.util.Collection loadActiveProducts()
           
 java.util.Collection loadBuiltInCategories()
          Retrieves a Collection containing built in categories for the store.
 java.util.Collection loadCategoryTree()
          Retrieves a Collection representing the store's category tree.
 java.util.Map loadProductFromID(java.util.Map parameters)
           
 java.util.Map loadProductsAndCount(java.util.Map parameters)
           
 java.util.Collection loadSettings(java.util.Map parameters)
           
 java.util.Collection processSettings(java.util.Map parameters)
           
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatPrice, getBusinessObjectFactory, getDaoFactory, getSettingsBean, getUser, initialize, setBusinessObjectFactory, setDaoFactory, setSettingsBean, setUser
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessObject
formatDateTime, parseDateTime, prepareRequestData, sendHTTPPost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

BasicProductProcessor

public BasicProductProcessor()
Method Detail

loadCategoryTree

public java.util.Collection loadCategoryTree()
                                      throws java.lang.Exception
Description copied from interface: ProductProcessor
Retrieves a Collection representing the store's category tree. This Collection is composed of Maps, which in turn may contain other Collection s of Map s representing a given category's subcategories.

Specified by:
loadCategoryTree in interface ProductProcessor
Returns:
A Collection representing the store's category tree.
Throws:
java.lang.Exception

loadBuiltInCategories

public java.util.Collection loadBuiltInCategories()
                                           throws java.lang.Exception
Description copied from interface: ProductProcessor
Retrieves a Collection containing built in categories for the store. The systems built-in categories have the following unique codes: _features,_popular, _new, and _favorites. This Collection is composed of Category objects.

Specified by:
loadBuiltInCategories in interface ProductProcessor
Returns:
A Collection of Category objects.
Throws:
java.lang.Exception

getProductFromCode

public Product getProductFromCode(Product product)
                           throws java.lang.Exception
Description copied from interface: ProductProcessor
Retrieves product information from the database.

Specified by:
getProductFromCode in interface ProductProcessor
Parameters:
product - A Product object whose code property has been populated.
Returns:
A Product object with all its properties populated from the database. If the product does not exist in the database, Product.getProductID() will return 0.
Throws:
java.lang.Exception

generateSettingsMap

public java.util.HashMap generateSettingsMap(java.util.Collection settings)
                                      throws java.lang.Exception
Specified by:
generateSettingsMap in interface ProductProcessor
Throws:
java.lang.Exception

getAllAttributesAndOptions

public java.util.Collection getAllAttributesAndOptions(int productID)
                                                throws java.lang.Exception
Specified by:
getAllAttributesAndOptions in interface ProductProcessor
Throws:
java.lang.Exception

getCategoryFromCode

public Category getCategoryFromCode(Category category)
                             throws java.lang.Exception
Description copied from interface: ProductProcessor
Retrieves category information from the database.

Specified by:
getCategoryFromCode in interface ProductProcessor
Parameters:
category - A Category object whose code property has been populated.
Returns:
A Category object with all its properties populated from the database. If the category does not exist in the database, Category.getCategoryID() will return 0.
Throws:
java.lang.Exception

getProductList

public ProductList getProductList(ProductList productList)
                           throws java.lang.Exception
Description copied from interface: ProductProcessor
Retrieves information for a list of products from the database. Depending on the value of the productListType for the ProductList, the products could be the entire list of products in the system, the products under a given category, or the products matching a given search request.

Specified by:
getProductList in interface ProductProcessor
Parameters:
productList - A ProductList object whose itemsPerPage,firstCode, productListType, and optionally categoryID or searchString and stopWords properties have been set.
Returns:
A ProductList object with all its properties populated from the database.
Throws:
java.lang.Exception

loadActiveProducts

public java.util.Collection loadActiveProducts()
                                        throws java.lang.Exception
Specified by:
loadActiveProducts in interface ProductProcessor
Throws:
java.lang.Exception

loadProductsAndCount

public java.util.Map loadProductsAndCount(java.util.Map parameters)
                                   throws java.lang.Exception
Specified by:
loadProductsAndCount in interface ProductProcessor
Throws:
java.lang.Exception

addProduct

public void addProduct(java.util.Map parameters)
                throws java.lang.Exception
Specified by:
addProduct in interface ProductProcessor
Throws:
java.lang.Exception

loadProductFromID

public java.util.Map loadProductFromID(java.util.Map parameters)
                                throws java.lang.Exception
Specified by:
loadProductFromID in interface ProductProcessor
Throws:
java.lang.Exception

editProduct

public void editProduct(java.util.Map parameters)
                 throws java.lang.Exception
Specified by:
editProduct in interface ProductProcessor
Throws:
java.lang.Exception

editDeleteProducts

public void editDeleteProducts(java.util.Map parameters)
                        throws java.lang.Exception
Specified by:
editDeleteProducts in interface ProductProcessor
Throws:
java.lang.Exception

deleteProduct

public void deleteProduct(java.util.Map parameters)
                   throws java.lang.Exception
Specified by:
deleteProduct in interface ProductProcessor
Throws:
java.lang.Exception

loadSettings

public java.util.Collection loadSettings(java.util.Map parameters)
                                  throws java.lang.Exception
Specified by:
loadSettings in interface ProductProcessor
Throws:
java.lang.Exception

processSettings

public java.util.Collection processSettings(java.util.Map parameters)
                                     throws java.lang.Exception
Specified by:
processSettings in interface ProductProcessor
Throws:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005