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 appComponents.properties file.

The default "productProcessorImplementer" is BasicProductProcessor.

Author:
David Tobey
  • Method Details

    • getProductFromCode

      Product getProductFromCode(Product product) throws Exception
      Retrieves product information from the database. In the default implementation, this method calls ProductDAO.loadProduct() to populate the incoming Product using its code.
      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, null.
      Throws:
      Exception
    • getProductFromSeoCode

      Product getProductFromSeoCode(Product product) throws Exception
      Retrieves product information from the database. In the default implementation, this method calls ProductDAO.loadProductFromSeoCode() to populate the incoming Product using its seoCode.
      Parameters:
      product - A Product object whose seoCode 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

      Map loadAttributeSKUs() throws Exception
      Retrieves all SKUs associated with attributes but not products.
      Returns:
      A Map of all the SKUs in the system associated with attributes but not products.
      Throws:
      Exception
    • loadAttributeSKUCollection

      Collection loadAttributeSKUCollection() throws Exception
      Retrieves all SKUs associated with attributes but not products, as a Collection of SKUs.
      Returns:
      A Collection of all the SKUs in the system associated with attributes but not products.
      Throws:
      Exception
    • getCategoryFromCode

      Category getCategoryFromCode(Category category) throws Exception
      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 - 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, null.
      Throws:
      Exception
    • getCategoryFromCode

      Category getCategoryFromCode(Category category, boolean loadProducts) throws Exception
      Retrieves category information from the database. In the default implementation, this method calls 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 Products 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.

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

      Collection loadCategoryTree() throws Exception
      Retrieves a 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 subcategoryCollections 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.

      Returns:
      A Collection representing the store's category tree.
      Throws:
      Exception
    • loadBuiltInCategories

      Collection loadBuiltInCategories() throws Exception
      Retrieves a 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.

      Returns:
      A Collection of Category objects representing the store's built-in categories.
      Throws:
      Exception
    • loadCategories

      Collection loadCategories(String categoryList) throws Exception
      Retrieves a Collection containing categories corresponding to the codes of the argument. Each item in the Collection is an instance of Category. 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 of Category objects representing the store's built-in categories.
      Throws:
      Exception
    • getProductList

      ProductList getProductList(ProductList productList) throws 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:
      Exception
    • loadAllProducts

      Collection loadAllProducts() throws Exception
      Throws:
      Exception
    • loadMaxProductID

      int loadMaxProductID() throws Exception
      Throws:
      Exception
    • loadProductsForIndexing

      Collection loadProductsForIndexing(int firstProductID, int lastProductID) throws Exception
      Throws:
      Exception
    • loadAllProductNamesCodesIDs

      Collection loadAllProductNamesCodesIDs() throws Exception
      Throws:
      Exception
    • loadActiveProductNamesCodesIDs

      Collection loadActiveProductNamesCodesIDs() throws Exception
      Throws:
      Exception
    • loadProductsAndCount

      Map loadProductsAndCount(Map parameters) throws Exception
      Throws:
      Exception
    • addProduct

      Map addProduct(Map parameters) throws Exception
      Throws:
      Exception
    • loadProductFromID

      Product loadProductFromID(Map parameters) throws Exception
      Throws:
      Exception
    • editProduct

      Map editProduct(Map parameters) throws Exception
      Throws:
      Exception
    • editDeleteProducts

      Map editDeleteProducts(Map parameters) throws Exception
      Throws:
      Exception
    • deleteProduct

      Map deleteProduct(Map parameters) throws Exception
      Throws:
      Exception
    • generateSettingsMap

      HashMap generateSettingsMap(Collection settings) throws Exception
      Throws:
      Exception
    • getAllAttributesAndOptions

      Collection getAllAttributesAndOptions(int productID) throws Exception
      Throws:
      Exception
    • loadSettings

      Collection loadSettings(Map properties) throws Exception
      Throws:
      Exception
    • processSettings

      Collection processSettings(Map properties) throws Exception
      Throws:
      Exception
    • buildMatrix

      Collection buildMatrix(Product product)
    • buildMatrix

      Collection buildMatrix(Product product, Integer attributeLimit, List<Integer> includedAttributeIds, List<Integer> includedOptionIds)
    • sortProductsByName

      Map sortProductsByName(Map parameters) throws Exception
      Throws:
      Exception
    • sortProductsByCode

      Map sortProductsByCode(Map parameters) throws Exception
      Throws:
      Exception
    • cloneProduct

      Map cloneProduct(Map parameters) throws Exception
      Throws:
      Exception
    • createCategoryMapFromCategoryTree

      Map createCategoryMapFromCategoryTree(Collection categoryTree)
    • loadProductFromCode

      Product loadProductFromCode(Product product) throws Exception
      Throws:
      Exception
    • postChangingProductEvent

      Map postChangingProductEvent(Product product, Map parameters) throws Exception
      Throws:
      Exception
    • loadProductFromCode

      Product loadProductFromCode(Map parameters) throws Exception
      Throws:
      Exception
    • loadProductFromCode

      Product loadProductFromCode(String code) throws Exception
      Throws:
      Exception
    • editProductAssignment

      Map editProductAssignment(Map parameters) throws Exception
      Throws:
      Exception