|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softslate.commerce.businessobjects.core.BaseBusinessObject com.softslate.commerce.businessobjects.core.BaseBusinessProcessor com.softslate.commerce.businessobjects.product.BasicProductProcessor
public class BasicProductProcessor
Processes business logic affecting products and other related objects.
BasicProductProcessor
is the default implementation of the
ProductProcessor
interface for the application.
Field Summary | |
---|---|
(package private) static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
BasicProductProcessor()
|
Method Summary | |
---|---|
void |
addProduct(java.util.Map parameters)
|
boolean |
buildMatrix(java.util.Collection matrix,
java.util.Collection options,
java.util.Collection attributes,
Product product)
|
java.util.Collection |
buildMatrix(Product product)
|
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. |
Category |
getCategoryFromCode(Category category,
boolean loadProducts)
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 |
loadAllProductNamesCodesIDs()
|
java.util.Collection |
loadAllProducts()
|
java.util.Collection |
loadAllProductsSortedByName()
|
java.util.Collection |
loadAttributeSKUCollection()
Retrieves all SKUs associated with attributes but not products, as a Collection of SKUs. |
java.util.Map |
loadAttributeSKUs()
Retrieves all SKUs associated with attributes but not products. |
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. |
Product |
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)
|
java.util.Map |
sortProductsByName(java.util.Map parameters)
|
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor |
---|
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getProductIDs, getSettings, getUser, initialize, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, utils |
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 |
---|
static org.apache.commons.logging.Log log
Constructor Detail |
---|
public BasicProductProcessor()
Method Detail |
---|
public java.util.Collection loadCategoryTree() throws java.lang.Exception
ProductProcessor
Collection
representing the store's category
tree. Each item in the Collection
is an instance of
Category
, which
corresponds to each one of the "top level" categories defined in the
store (i.e., categories whose parentCategory
property is
null
). To render the tree, iterate through the top level
categories and recursively navigate through each of their
subcategoryCollection
s in turn.
The default implementation of this method calls
ProductGatewayDAOHibernate.loadCategoryTree()
,
which uses Hibernate.initialize(java.lang.Object)
to pull the entire tree from the database non-lazily.
loadCategoryTree
in interface ProductProcessor
Collection
representing the store's category
tree.
java.lang.Exception
public java.util.Collection loadBuiltInCategories() throws java.lang.Exception
ProductProcessor
Collection
containing built-in categories for
the store. Each item in the Collection
is an instance of
Category
.
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.
loadBuiltInCategories
in interface ProductProcessor
Collection
of Category
objects
representing the store's built-in categories.
java.lang.Exception
public Product getProductFromCode(Product product) throws java.lang.Exception
ProductProcessor
ProductDAO.loadProduct()
to
populate the incoming Product
using its code
.
getProductFromCode
in interface ProductProcessor
product
- A Product
object whose code
property has been populated.
Product
object with all its properties populated
from the database. If the product does not exist in the database,
null
.
java.lang.Exception
public java.util.Map loadAttributeSKUs() throws java.lang.Exception
ProductProcessor
loadAttributeSKUs
in interface ProductProcessor
Map
of all the SKU
s in the
system associated with attributes but not products.
java.lang.Exception
public java.util.Collection loadAttributeSKUCollection() throws java.lang.Exception
ProductProcessor
loadAttributeSKUCollection
in interface ProductProcessor
Collection
of all the SKU
s in
the system associated with attributes but not products.
java.lang.Exception
public Category getCategoryFromCode(Category category) throws java.lang.Exception
ProductProcessor
getCategoryFromCode
in interface ProductProcessor
category
- A Category
object whose code
property has been populated.
Category
object with all its properties
populated from the database. If the category does not exist in
the database, null
.
java.lang.Exception
public Category getCategoryFromCode(Category category, boolean loadProducts) throws java.lang.Exception
ProductProcessor
CategoryDAO.loadCategory()
to
populate the incoming Category
using its code
.
If the loadProducts parameter is set to true, in addition to all of the
category's regular properties, its productListCollection
is populated with just those Product
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 incoming
Category
's itemsPerPage
and
firstRow
properties, respectively.
The method
ProductGatewayDAO.loadProductList(ProductList)
is used to pull in the category's products.
Also in the default implementation, the Category
's
parentCollection
and parentString
properties are set by calling
CategoryDAO.loadParents()
.
These properties are used in breadcrumbing and in the display of the
category tree.
getCategoryFromCode
in interface ProductProcessor
category
- A Category
object whose code
property has been populated.loadProducts
- If set to true, the category's products will be loaded into
the category's productListCollection
property.
Category
object with all its properties
populated from the database. If the category does not exist in
the database, null
.
java.lang.Exception
public java.util.HashMap generateSettingsMap(java.util.Collection settings) throws java.lang.Exception
generateSettingsMap
in interface ProductProcessor
java.lang.Exception
public java.util.Collection getAllAttributesAndOptions(int productID) throws java.lang.Exception
getAllAttributesAndOptions
in interface ProductProcessor
java.lang.Exception
public ProductList getProductList(ProductList productList) throws java.lang.Exception
ProductProcessor
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.
getProductList
in interface ProductProcessor
productList
- A ProductList
object whose
itemsPerPage
,firstCode
,
productListType
, and optionally
categoryID
or searchString
and
stopWords
properties have been set.
ProductList
object with all its properties
populated from the database.
java.lang.Exception
public java.util.Collection loadAllProducts() throws java.lang.Exception
loadAllProducts
in interface ProductProcessor
java.lang.Exception
public java.util.Map sortProductsByName(java.util.Map parameters) throws java.lang.Exception
sortProductsByName
in interface ProductProcessor
java.lang.Exception
public java.util.Collection loadAllProductsSortedByName() throws java.lang.Exception
java.lang.Exception
public java.util.Collection loadAllProductNamesCodesIDs() throws java.lang.Exception
loadAllProductNamesCodesIDs
in interface ProductProcessor
java.lang.Exception
public java.util.Map loadProductsAndCount(java.util.Map parameters) throws java.lang.Exception
loadProductsAndCount
in interface ProductProcessor
java.lang.Exception
public void addProduct(java.util.Map parameters) throws java.lang.Exception
addProduct
in interface ProductProcessor
java.lang.Exception
public Product loadProductFromID(java.util.Map parameters) throws java.lang.Exception
loadProductFromID
in interface ProductProcessor
java.lang.Exception
public void editProduct(java.util.Map parameters) throws java.lang.Exception
editProduct
in interface ProductProcessor
java.lang.Exception
public void editDeleteProducts(java.util.Map parameters) throws java.lang.Exception
editDeleteProducts
in interface ProductProcessor
java.lang.Exception
public void deleteProduct(java.util.Map parameters) throws java.lang.Exception
deleteProduct
in interface ProductProcessor
java.lang.Exception
public java.util.Collection loadSettings(java.util.Map parameters) throws java.lang.Exception
loadSettings
in interface ProductProcessor
java.lang.Exception
public java.util.Collection processSettings(java.util.Map parameters) throws java.lang.Exception
processSettings
in interface ProductProcessor
java.lang.Exception
public java.util.Collection buildMatrix(Product product)
buildMatrix
in interface ProductProcessor
public boolean buildMatrix(java.util.Collection matrix, java.util.Collection options, java.util.Collection attributes, Product product)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |