Class DefaultProductService

All Implemented Interfaces:
ProductService, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class DefaultProductService extends AbstractBusinessService implements ProductService
Default implementation of the ProductService.
See Also:
  • Constructor Details

    • DefaultProductService

      public DefaultProductService()
  • Method Details

    • getProductForCode

      public ProductModel getProductForCode(String code)
      Description copied from interface: ProductService
      Returns the Product with the specified code. As default the search uses the current session user, the current session language and the current active catalog versions (which are stored at the session in the attribute SESSION_CATALOG_VERSIONS). For modifying the search session context see FlexibleSearchQuery.
      Specified by:
      getProductForCode in interface ProductService
      Parameters:
      code - the code of the Product
      Returns:
      the Product with the specified code.
    • getProduct

      @Deprecated(since="ages", forRemoval=true) public ProductModel getProduct(String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Specified by:
      getProduct in interface ProductService
      Parameters:
      code - the code of the Product
      Returns:
      the Product with the specified code.
    • getOrderableUnit

      @Deprecated(since="ages", forRemoval=true) public UnitModel getOrderableUnit(ProductModel product)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Description copied from interface: ProductService
      Returns for the given product the first found UnitModel from the PriceInformations of the product.
      Specified by:
      getOrderableUnit in interface ProductService
      Parameters:
      product - the ProductModel
      Returns:
      ProductModel.UNIT if no PriceInformations is available at the ProductModel
    • getAllProductsCountForCategory

      public Integer getAllProductsCountForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Counts all products of the specific CategoryModel excluding double linked products. This includes all its own products and products belonging to any sub category.
      Specified by:
      getAllProductsCountForCategory in interface ProductService
      Parameters:
      category - the CategoryModel
      Returns:
      amount of all products of the category
    • getProductsCountForCategory

      public Integer getProductsCountForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Counts all products of the specific CategoryModel.
      Specified by:
      getProductsCountForCategory in interface ProductService
      Parameters:
      category - the CategoryModel
      Returns:
      amount of all products of the category
    • containsProductsForCategory

      public boolean containsProductsForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Checks whether or not the specific CategoryModel or any of its sub-categories contains at least one product.
      Specified by:
      containsProductsForCategory in interface ProductService
      Parameters:
      category - the CategoryModel
      Returns:
      true if at least one product belong the the CategoryModel or any of its sub-categories, false otherwise.
    • getUnit

      @Deprecated(since="ages", forRemoval=true) public UnitModel getUnit(String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Specified by:
      getUnit in interface ProductService
      Parameters:
      code - the code of the Unit
      Returns:
      the Unit with the specified code
    • getProduct

      @Deprecated(since="ages", forRemoval=true) public ProductModel getProduct(CatalogVersionModel catalogVersion, String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Specified by:
      getProduct in interface ProductService
      Parameters:
      catalogVersion - the CatalogVersion of the Product
      code - the code of the Product
      Returns:
      the Product matching the specified code and CatalogVersion.
    • getProductForCode

      public ProductModel getProductForCode(CatalogVersionModel catalogVersion, String code)
      Description copied from interface: ProductService
      Returns the Product with the specified code belonging to the specified CatalogVersion.
      Specified by:
      getProductForCode in interface ProductService
      Parameters:
      catalogVersion - the CatalogVersion of the Product
      code - the code of the Product
      Returns:
      the Product matching the specified code and CatalogVersion.
    • getProducts

      @Deprecated(since="ages", forRemoval=true) public List<ProductModel> getProducts(CategoryModel category)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Specified by:
      getProducts in interface ProductService
      Parameters:
      category - the category the returned Products belong to
      Returns:
      a list of Products which belong to the specified Category
    • getProductsForCategory

      public List<ProductModel> getProductsForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Returns all Products belonging to the specified Category as a List. For the search the current session active catalog versions of the current user are used.
      Specified by:
      getProductsForCategory in interface ProductService
      Parameters:
      category - the category the returned Products belong to
      Returns:
      a list of Products which belong to the specified Category
    • getProducts

      @Deprecated(since="ages", forRemoval=true) public SearchResult<ProductModel> getProducts(CategoryModel category, int start, int count)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      Specified by:
      getProducts in interface ProductService
      Parameters:
      category - the category the returned Products belong to
      start - index position of the first Product, which will be included in the returned List
      count - number of Products which will be returned in the List
      Returns:
      a list of Products with belong to the specified Category
    • getProductsForCategory

      public List<ProductModel> getProductsForCategory(CategoryModel category, int start, int count)
      Description copied from interface: ProductService
      Returns the specified range of Products belonging to the specified Category as a List. For the search the current session active catalogversions of the current user are used.
      Specified by:
      getProductsForCategory in interface ProductService
      Parameters:
      category - the category the returned Products belong to
      start - index position of the first Product, which will be included in the returned List
      count - number of Products which will be returned in the List
      Returns:
      a list of Products with belong to the specified Category
    • getOnlineProductsForCategory

      public List<ProductModel> getOnlineProductsForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Returns all online products that belong to the specified category.
      Specified by:
      getOnlineProductsForCategory in interface ProductService
      Parameters:
      category - the category the returned products belong to
      Returns:
      all found products that belong to the specified category, or empty collection if no product can be found.
    • getOfflineProductsForCategory

      public List<ProductModel> getOfflineProductsForCategory(CategoryModel category)
      Description copied from interface: ProductService
      Returns all offline products that belong to the specified category.
      Specified by:
      getOfflineProductsForCategory in interface ProductService
      Parameters:
      category - the category the returned products belong to
      Returns:
      all found products that belong to the specified category, or empty collection if no product can be found.
    • getAllProductsForCatalogVersion

      public List<ProductModel> getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion)
      Description copied from interface: ProductService
      Returns all ProductModel list belonging to the specified CatalogVersionModel
      Specified by:
      getAllProductsForCatalogVersion in interface ProductService
      Parameters:
      catalogVersion - the CatalogVersion of the Products
      Returns:
      Product list belonging to the CatalogVersion
    • setProductDao

      public void setProductDao(ProductDao productDao)
    • getProductDao

      protected ProductDao getProductDao()
      Returns:
      the productDao
    • setUnitDao

      @Deprecated(since="ages", forRemoval=true) public void setUnitDao(UnitDao unitDao)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
    • setPriceService

      @Deprecated(since="ages", forRemoval=true) public void setPriceService(PriceService priceService)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages