Interface ProductService

    • Method Detail

      • getProduct

        @Deprecated
        ProductModel getProduct​(java.lang.String code)
        Deprecated.
        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
        java.lang.IllegalArgumentException - if parameter code is null
      • getProductForCode

        ProductModel getProductForCode​(java.lang.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
        java.lang.IllegalArgumentException - if parameter code is null
      • getProduct

        @Deprecated
        ProductModel getProduct​(CatalogVersionModel catalogVersion,
                                java.lang.String code)
        Deprecated.
        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
      • getProducts

        @Deprecated
        java.util.List<ProductModel> getProducts​(CategoryModel category)
        Deprecated.
        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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getProductsForCategory

        java.util.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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getOnlineProductsForCategory

        java.util.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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getOfflineProductsForCategory

        java.util.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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getProducts

        @Deprecated
        SearchResult<ProductModel> getProducts​(CategoryModel category,
                                               int start,
                                               int count)
        Deprecated.
        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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getProductsForCategory

        java.util.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:
        java.lang.IllegalArgumentException - if parameter category is null
      • getProductsCountForCategory

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

        java.lang.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:
        java.lang.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:
        java.lang.IllegalArgumentException - if parameter category is null.
      • getProductForCode

        ProductModel getProductForCode​(CatalogVersionModel catalogVersion,
                                       java.lang.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

        java.util.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