com.softslate.commerce.businessobjects.product
Interface ProductProcessor

All Superinterfaces:
BusinessObject
All Known Implementing Classes:
BasicProductProcessor

public interface ProductProcessor
extends BusinessObject

Interface for business logic methods affecting products and other related objects.

Instances implementing ProductProcessor are usually created in the Struts layer in response to a request from a user for product information. The ProductProcessor object uses data access objects to look up the information, and return it to the Struts layer.

When the application needs to create an instance that implements ProductProcessor, BusinessObjectFactory finds the name of the Java class to instantiate from the "productProcessorImplementer" setting in the npcSetting database table.

The default "productProcessorImplementer" is BasicProductProcessor.

Author:
David Tobey

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 cateory)
          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 properties)
           
 java.util.Collection processSettings(java.util.Map properties)
           
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Method Detail

getProductFromCode

public Product getProductFromCode(Product product)
                           throws java.lang.Exception
Retrieves product information from the database.

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

getCategoryFromCode

public Category getCategoryFromCode(Category cateory)
                             throws java.lang.Exception
Retrieves category information from the database.

Parameters:
cateory - 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

loadCategoryTree

public java.util.Collection loadCategoryTree()
                                      throws java.lang.Exception
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.

Returns:
A Collection representing the store's category tree.
Throws:
java.lang.Exception

loadBuiltInCategories

public java.util.Collection loadBuiltInCategories()
                                           throws java.lang.Exception
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.

Returns:
A Collection of Category objects.
Throws:
java.lang.Exception

getProductList

public ProductList getProductList(ProductList productList)
                           throws java.lang.Exception
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.

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
Throws:
java.lang.Exception

loadProductsAndCount

public java.util.Map loadProductsAndCount(java.util.Map parameters)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

addProduct

public void addProduct(java.util.Map parameters)
                throws java.lang.Exception
Throws:
java.lang.Exception

loadProductFromID

public java.util.Map loadProductFromID(java.util.Map parameters)
                                throws java.lang.Exception
Throws:
java.lang.Exception

editProduct

public void editProduct(java.util.Map parameters)
                 throws java.lang.Exception
Throws:
java.lang.Exception

editDeleteProducts

public void editDeleteProducts(java.util.Map parameters)
                        throws java.lang.Exception
Throws:
java.lang.Exception

deleteProduct

public void deleteProduct(java.util.Map parameters)
                   throws java.lang.Exception
Throws:
java.lang.Exception

generateSettingsMap

public java.util.HashMap generateSettingsMap(java.util.Collection settings)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getAllAttributesAndOptions

public java.util.Collection getAllAttributesAndOptions(int productID)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

loadSettings

public java.util.Collection loadSettings(java.util.Map properties)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

processSettings

public java.util.Collection processSettings(java.util.Map properties)
                                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005