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 aCollectioncontaining built-in categories for the store.loadCategories(String categoryList) Retrieves aCollectioncontaining categories corresponding to the codes of the argument.Retrieves aCollectionrepresenting the store's category tree.intloadProductFromCode(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 incomingProductusing itscode.- Parameters:
product- AProductobject whosecodeproperty has been populated.- Returns:
- A
Productobject 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 incomingProductusing itsseoCode.- Parameters:
product- AProductobject whoseseoCodeproperty has been populated.- Returns:
- A
Productobject 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
Mapof all theSKUs 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
Collectionof all theSKUs 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- ACategoryobject whosecodeproperty has been populated.- Returns:
- A
Categoryobject 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 incomingCategoryusing itscode.If the loadProducts parameter is set to true, in addition to all of the category's regular properties, its
productListCollectionis populated with just thoseProducts 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'sitemsPerPageandfirstRowproperties, respectively.The method
ProductGatewayDAO.loadProductList(ProductList)is used to pull in the category's products.Also in the default implementation, the
Category'sparentCollectionandparentStringproperties are set by callingCategoryDAO.loadParents(). These properties are used in breadcrumbing and in the display of the category tree.- Parameters:
category- ACategoryobject whosecodeproperty has been populated.loadProducts- If set to true, the category's products will be loaded into the category'sproductListCollectionproperty.- Returns:
- A
Categoryobject with all its properties populated from the database. If the category does not exist in the database,null. - Throws:
Exception
-
loadCategoryTree
Retrieves aCollectionrepresenting the store's category tree. Each item in theCollectionis an instance ofCategory, which corresponds to each one of the "top level" categories defined in the store (i.e., categories whoseparentCategoryproperty isnull). To render the tree, iterate through the top level categories and recursively navigate through each of theirsubcategoryCollections 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
Collectionrepresenting the store's category tree. - Throws:
Exception
-
loadBuiltInCategories
Retrieves aCollectioncontaining built-in categories for the store. Each item in theCollectionis 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
sscSettingdatabase table, a comma-separated list of category codes.- Returns:
- A
CollectionofCategoryobjects representing the store's built-in categories. - Throws:
Exception
-
loadCategories
Retrieves aCollectioncontaining categories corresponding to the codes of the argument. Each item in theCollectionis 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
CollectionofCategoryobjects 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 theproductListTypefor 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- AProductListobject whoseitemsPerPage,firstCode,productListType, and optionallycategoryIDorsearchStringandstopWordsproperties have been set.- Returns:
- A
ProductListobject 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
-