Interface ProductProcessor
- All Superinterfaces:
BusinessObject
- All Known Implementing Classes:
BasicProductProcessor
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
appComponents.properties
file.
The default "productProcessorImplementer" is
BasicProductProcessor
.
- Author:
- David Tobey
-
Method Summary
Modifier and TypeMethodDescriptionaddProduct
(Map parameters) buildMatrix
(Product product) buildMatrix
(Product product, Integer attributeLimit, List<Integer> includedAttributeIds, List<Integer> includedOptionIds) cloneProduct
(Map parameters) createCategoryMapFromCategoryTree
(Collection categoryTree) deleteProduct
(Map parameters) editDeleteProducts
(Map parameters) editProduct
(Map parameters) editProductAssignment
(Map parameters) generateSettingsMap
(Collection settings) getAllAttributesAndOptions
(int productID) getCategoryFromCode
(Category category) Retrieves category information from the database.getCategoryFromCode
(Category category, boolean loadProducts) Retrieves category information from the database.getProductFromCode
(Product product) Retrieves product information from the database.getProductFromSeoCode
(Product product) Retrieves product information from the database.getProductList
(ProductList productList) Retrieves information for a list of products from the database.Retrieves all SKUs associated with attributes but not products, as a Collection of SKUs.Retrieves all SKUs associated with attributes but not products.Retrieves aCollection
containing built-in categories for the store.loadCategories
(String categoryList) Retrieves aCollection
containing categories corresponding to the codes of the argument.Retrieves aCollection
representing the store's category tree.int
loadProductFromCode
(Product product) loadProductFromCode
(String code) loadProductFromCode
(Map parameters) loadProductFromID
(Map parameters) loadProductsAndCount
(Map parameters) loadProductsForIndexing
(int firstProductID, int lastProductID) loadSettings
(Map properties) postChangingProductEvent
(Product product, Map parameters) processSettings
(Map properties) sortProductsByCode
(Map parameters) sortProductsByName
(Map parameters) Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
-
Method Details
-
getProductFromCode
Retrieves product information from the database. In the default implementation, this method callsProductDAO.loadProduct()
to populate the incomingProduct
using itscode
.- Parameters:
product
- AProduct
object whosecode
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,null
. - Throws:
Exception
-
getProductFromSeoCode
Retrieves product information from the database. In the default implementation, this method callsProductDAO.loadProductFromSeoCode()
to populate the incomingProduct
using itsseoCode
.- Parameters:
product
- AProduct
object whoseseoCode
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,null
. - Throws:
Exception
-
loadAttributeSKUs
Retrieves all SKUs associated with attributes but not products.- Returns:
- A
Map
of all theSKU
s in the system associated with attributes but not products. - Throws:
Exception
-
loadAttributeSKUCollection
Retrieves all SKUs associated with attributes but not products, as a Collection of SKUs.- Returns:
- A
Collection
of all theSKU
s in the system associated with attributes but not products. - Throws:
Exception
-
getCategoryFromCode
Retrieves category information from the database. In the default implementation, this method calls getCategoryFromCode(Category category, boolean loadProducts) with the loadProducts parameter set to true. category tree.- Parameters:
category
- ACategory
object whosecode
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,null
. - Throws:
Exception
-
getCategoryFromCode
Retrieves category information from the database. In the default implementation, this method callsCategoryDAO.loadCategory()
to populate the incomingCategory
using itscode
.If the loadProducts parameter is set to true, in addition to all of the category's regular properties, its
productListCollection
is populated with just thoseProduct
s falling on the current page being displayed. The paging parameters for the number of items to display and which page to display come from the incomingCategory
'sitemsPerPage
andfirstRow
properties, respectively.The method
ProductGatewayDAO.loadProductList(ProductList)
is used to pull in the category's products.Also in the default implementation, the
Category
'sparentCollection
andparentString
properties are set by callingCategoryDAO.loadParents()
. These properties are used in breadcrumbing and in the display of the category tree.- Parameters:
category
- ACategory
object whosecode
property has been populated.loadProducts
- If set to true, the category's products will be loaded into the category'sproductListCollection
property.- Returns:
- A
Category
object with all its properties populated from the database. If the category does not exist in the database,null
. - Throws:
Exception
-
loadCategoryTree
Retrieves aCollection
representing the store's category tree. Each item in theCollection
is an instance ofCategory
, which corresponds to each one of the "top level" categories defined in the store (i.e., categories whoseparentCategory
property isnull
). To render the tree, iterate through the top level categories and recursively navigate through each of theirsubcategoryCollection
s in turn.The default implementation of this method calls
ProductGatewayDAOHibernate.loadCategoryTree()
, which usesHibernate.initialize(java.lang.Object)
to pull the entire tree from the database non-lazily.- Returns:
- A
Collection
representing the store's category tree. - Throws:
Exception
-
loadBuiltInCategories
Retrieves aCollection
containing built-in categories for the store. Each item in theCollection
is an instance ofCategory
. Built-in categories are typically composed of specials or other featured products that need to displayed on arbitrary pages thoughout the store.Built-in categories are definined by the "builtInCategories" setting in the
sscSetting
database table, a comma-separated list of category codes.- Returns:
- A
Collection
ofCategory
objects representing the store's built-in categories. - Throws:
Exception
-
loadCategories
Retrieves aCollection
containing categories corresponding to the codes of the argument. Each item in theCollection
is an instance ofCategory
. This method is used to populate the 'headerCategoriesAndContentPages' and 'footerCategoriesAndContentPages' - the categories that appear as links in the header and footer of the store.- Returns:
- A
Collection
ofCategory
objects representing the store's built-in categories. - Throws:
Exception
-
getProductList
Retrieves information for a list of products from the database. Depending on the value of theproductListType
for theProductList
, 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
- AProductList
object whoseitemsPerPage
,firstCode
,productListType
, and optionallycategoryID
orsearchString
andstopWords
properties have been set.- Returns:
- A
ProductList
object with all its properties populated from the database. - Throws:
Exception
-
loadAllProducts
- Throws:
Exception
-
loadMaxProductID
- Throws:
Exception
-
loadProductsForIndexing
- Throws:
Exception
-
loadAllProductNamesCodesIDs
- Throws:
Exception
-
loadActiveProductNamesCodesIDs
- Throws:
Exception
-
loadProductsAndCount
- Throws:
Exception
-
addProduct
- Throws:
Exception
-
loadProductFromID
- Throws:
Exception
-
editProduct
- Throws:
Exception
-
editDeleteProducts
- Throws:
Exception
-
deleteProduct
- Throws:
Exception
-
generateSettingsMap
- Throws:
Exception
-
getAllAttributesAndOptions
- Throws:
Exception
-
loadSettings
- Throws:
Exception
-
processSettings
- Throws:
Exception
-
buildMatrix
-
buildMatrix
-
sortProductsByName
- Throws:
Exception
-
sortProductsByCode
- Throws:
Exception
-
cloneProduct
- Throws:
Exception
-
createCategoryMapFromCategoryTree
-
loadProductFromCode
- Throws:
Exception
-
postChangingProductEvent
- Throws:
Exception
-
loadProductFromCode
- Throws:
Exception
-
loadProductFromCode
- Throws:
Exception
-
editProductAssignment
- Throws:
Exception
-