Interface ProductService
- All Known Implementing Classes:
DefaultProductService
ProductModels.- Spring Bean ID:
- productService
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsProductsForCategory(CategoryModel category) Checks whether or not the specificCategoryModelor any of its sub-categories contains at least one product.getAllProductsCountForCategory(CategoryModel category) Counts all products of the specificCategoryModelexcluding double linked products.getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion) Returns allProductModellist belonging to the specifiedCatalogVersionModelgetOfflineProductsForCategory(CategoryModel category) Returns all offline products that belong to the specified category.getOnlineProductsForCategory(CategoryModel category) Returns all online products that belong to the specified category.getOrderableUnit(ProductModel product) Returns for the givenproductthe first foundUnitModelfrom the PriceInformations of the product.getProduct(CatalogVersionModel catalogVersion, String code) Deprecated, for removal: This API element is subject to removal in a future version.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)getProductForCode(CatalogVersionModel catalogVersion, String code) Returns the Product with the specified code belonging to the specified CatalogVersion.getProductForCode(String code) Returns the Product with the specified code.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.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)getProductsCountForCategory(CategoryModel category) Counts all products of the specificCategoryModel.getProductsForCategory(CategoryModel category) Returns all Products belonging to the specified Category as a List.getProductsForCategory(CategoryModel category, int start, int count) Returns the specified range of Products belonging to the specified Category as a List.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.
-
Method Details
-
getProduct
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 seeFlexibleSearchQuery.- Parameters:
code- the code of the Product- Returns:
- the Product with the specified code.
- Throws:
UnknownIdentifierException- if no Product with the specified code is foundAmbiguousIdentifierException- if more than one Product with the specified code is foundIllegalArgumentException- if parameter code isnull
-
getProductForCode
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 attributeSESSION_CATALOG_VERSIONS). For modifying the search session context seeFlexibleSearchQuery.- Parameters:
code- the code of the Product- Returns:
- the Product with the specified code.
- Throws:
UnknownIdentifierException- if no Product with the specified code is foundAmbiguousIdentifierException- if more than one Product with the specified code is foundIllegalArgumentException- if parameter code isnull
-
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 usegetProductForCode(CatalogVersionModel, String), however this method does not use any restrictionsReturns 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 Productcode- 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
Returns for the givenproductthe first foundUnitModelfrom the PriceInformations of the product.- Parameters:
product- theProductModel- Returns:
ProductModel.UNITif no PriceInformations is available at theProductModel- Throws:
IllegalArgumentException- ifproductisnull.ModelNotFoundException- if noUnitModelwas found for the givenproduct
-
getUnit
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, 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
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
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
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 tostart- index position of the first Product, which will be included in the returned Listcount- 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
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 tostart- index position of the first Product, which will be included in the returned Listcount- 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
Counts all products of the specificCategoryModel.- Parameters:
category- theCategoryModel- Returns:
- amount of all products of the category
- Throws:
IllegalArgumentException- if parametercategoryisnull.
-
getAllProductsCountForCategory
Counts all products of the specificCategoryModelexcluding double linked products. This includes all its own products and products belonging to any sub category.- Parameters:
category- theCategoryModel- Returns:
- amount of all products of the category
- Throws:
IllegalArgumentException- if parametercategoryisnull.
-
containsProductsForCategory
Checks whether or not the specificCategoryModelor any of its sub-categories contains at least one product.- Parameters:
category- theCategoryModel- Returns:
- true if at least one product belong the the
CategoryModelor any of its sub-categories, false otherwise. - Throws:
IllegalArgumentException- if parametercategoryisnull.
-
getProductForCode
Returns the Product with the specified code belonging to the specified CatalogVersion.- Parameters:
catalogVersion- the CatalogVersion of the Productcode- 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
Returns allProductModellist belonging to the specifiedCatalogVersionModel- Parameters:
catalogVersion- the CatalogVersion of the Products- Returns:
- Product list belonging to the CatalogVersion
-
getProductForCode(CatalogVersionModel, String), however this method does not use any restrictions