Interface ProductService

All Known Implementing Classes:
DefaultProductService

public interface ProductService
Service to read and update ProductModels.
Spring Bean ID:
productService
  • Method Details

    • getProduct

      @Deprecated(since="ages", forRemoval=true) ProductModel getProduct(String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages - as of release 4.3, please usegetProductForCode(String)

      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.

      Parameters:
      code - the code of the Product
      Returns:
      the Product with the specified code.
      Throws:
      UnknownIdentifierException - if no Product with the specified code is found
      AmbiguousIdentifierException - if more than one Product with the specified code is found
      IllegalArgumentException - if parameter code is null
    • getProductForCode

      ProductModel getProductForCode(String code)
      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.
      Parameters:
      code - the code of the Product
      Returns:
      the Product with the specified code.
      Throws:
      UnknownIdentifierException - if no Product with the specified code is found
      AmbiguousIdentifierException - if more than one Product with the specified code is found
      IllegalArgumentException - if parameter code is null
    • getProduct

      @Deprecated(since="ages", forRemoval=true) ProductModel getProduct(CatalogVersionModel catalogVersion, String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages - as of release 4.3, please use getProductForCode(CatalogVersionModel, String), however this method does not use any restrictions

      Returns the Product with the specified code belonging to the specified CatalogVersion. If the specified catalog version is not in the search restriction for the current user this method won't find any product (but it still exists). The admin user searches without any restrictions. 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). If there is no active catalog version specified CatalogVersion is set as active catalog version.

      Parameters:
      catalogVersion - the CatalogVersion of the Product
      code - the code of the Product
      Returns:
      the Product matching the specified code and CatalogVersion.
      Throws:
      UnknownIdentifierException - if no Product with the specified code and Catalog is found.
      AmbiguousIdentifierException - if more than one Product with the specified code and Catalog is found
    • getOrderableUnit

      UnitModel getOrderableUnit(ProductModel product)
      Returns for the given product the first found UnitModel from the PriceInformations of the product.
      Parameters:
      product - the ProductModel
      Returns:
      ProductModel.UNIT if no PriceInformations is available at the ProductModel
      Throws:
      IllegalArgumentException - if product is null.
      ModelNotFoundException - if no UnitModel was found for the given product
    • getUnit

      @Deprecated(since="ages", forRemoval=true) UnitModel getUnit(String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages - as of release 4.3, please useUnitService.getUnitForCode(String) Returns the Unit with the specified code.
      Parameters:
      code - the code of the Unit
      Returns:
      the Unit with the specified code
      Throws:
      UnknownIdentifierException - if no Product with the specified code and Catalog is found.
      AmbiguousIdentifierException - if more than one Product with the specified code and Catalog is found
    • getProducts

      @Deprecated(since="ages", forRemoval=true) List<ProductModel> getProducts(CategoryModel category)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages - as of release 4.3, please usegetProductsForCategory(CategoryModel) 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.
      Parameters:
      category - the category the returned Products belong to
      Returns:
      a list of Products which belong to the specified Category
      Throws:
      IllegalArgumentException - if parameter category is null
    • getProductsForCategory

      List<ProductModel> getProductsForCategory(CategoryModel category)
      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.
      Parameters:
      category - the category the returned Products belong to
      Returns:
      a list of Products which belong to the specified Category
      Throws:
      IllegalArgumentException - if parameter category is null
    • getOnlineProductsForCategory

      List<ProductModel> getOnlineProductsForCategory(CategoryModel category)
      Returns all online products that belong to the specified category.
      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.
      Throws:
      IllegalArgumentException - if parameter category is null
    • getOfflineProductsForCategory

      List<ProductModel> getOfflineProductsForCategory(CategoryModel category)
      Returns all offline products that belong to the specified category.
      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.
      Throws:
      IllegalArgumentException - if parameter category is null
    • getProducts

      @Deprecated(since="ages", forRemoval=true) 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 - as of release 4.3, please usegetProductsForCategory(CategoryModel, int, int)

      Returns the specified range of Products belonging to the specified Category as a List. For the search the current session active catalog versions of the current user are used.

      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
      Throws:
      IllegalArgumentException - if parameter category is null
    • getProductsForCategory

      List<ProductModel> getProductsForCategory(CategoryModel category, int start, int count)
      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.
      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
      Throws:
      IllegalArgumentException - if parameter category is null
    • getProductsCountForCategory

      Integer getProductsCountForCategory(CategoryModel category)
      Counts all products of the specific CategoryModel.
      Parameters:
      category - the CategoryModel
      Returns:
      amount of all products of the category
      Throws:
      IllegalArgumentException - if parameter category is null.
    • getAllProductsCountForCategory

      Integer getAllProductsCountForCategory(CategoryModel category)
      Counts all products of the specific CategoryModel excluding double linked products. This includes all its own products and products belonging to any sub category.
      Parameters:
      category - the CategoryModel
      Returns:
      amount of all products of the category
      Throws:
      IllegalArgumentException - if parameter category is null.
    • containsProductsForCategory

      boolean containsProductsForCategory(CategoryModel category)
      Checks whether or not the specific CategoryModel or any of its sub-categories contains at least one product.
      Parameters:
      category - the CategoryModel
      Returns:
      true if at least one product belong the the CategoryModel or any of its sub-categories, false otherwise.
      Throws:
      IllegalArgumentException - if parameter category is null.
    • getProductForCode

      ProductModel getProductForCode(CatalogVersionModel catalogVersion, String code)
      Returns the Product with the specified code belonging to the specified CatalogVersion.
      Parameters:
      catalogVersion - the CatalogVersion of the Product
      code - the code of the Product
      Returns:
      the Product matching the specified code and CatalogVersion.
      Throws:
      UnknownIdentifierException - if no Product with the specified code and Catalog is found.
      AmbiguousIdentifierException - if more than one Product with the specified code and Catalog is found
    • getAllProductsForCatalogVersion

      List<ProductModel> getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion)
      Returns all ProductModel list belonging to the specified CatalogVersionModel
      Parameters:
      catalogVersion - the CatalogVersion of the Products
      Returns:
      Product list belonging to the CatalogVersion