Interface ProductFacade
-
- All Known Implementing Classes:
DefaultProductFacade
,DefaultProductVariantFacade
public interface ProductFacade
Product facade interface. Its main purpose is to retrieve product related DTOs using existing services.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.List<ConfigurationInfoData>
getConfiguratorSettingsForCode(java.lang.String code)
Collect product configurator settings by product code.ProductData
getProductForCodeAndOptions(java.lang.String code, java.util.Collection<ProductOption> options)
Gets the product by code.ProductData
getProductForOptions(ProductModel productModel, java.util.Collection<ProductOption> options)
Deprecated.Since 6.0.java.util.List<ProductReferenceData>
getProductReferencesForCode(java.lang.String code, ProductReferenceTypeEnum referenceType, java.util.List<ProductOption> options, java.lang.Integer limit)
Deprecated.Since 5.0.java.util.List<ProductReferenceData>
getProductReferencesForCode(java.lang.String code, java.util.List<ProductReferenceTypeEnum> referenceTypes, java.util.List<ProductOption> options, java.lang.Integer limit)
Retrieves product references of a product given its code.java.util.List<ReviewData>
getReviews(java.lang.String productCode)
Gets the reviews for specified product.java.util.List<ReviewData>
getReviews(java.lang.String productCode, java.lang.Integer numberOfReviews)
Gets the first X reviews for specified product.ReviewData
postReview(java.lang.String productCode, ReviewData reviewData)
Post review for specified product code.
-
-
-
Method Detail
-
getProductForOptions
@Deprecated(since="6.0") ProductData getProductForOptions(ProductModel productModel, java.util.Collection<ProductOption> options)
Deprecated.Since 6.0. UsegetProductForCodeAndOptions(String, Collection)
instead.Gets the product data. The current session data (catalog versions, user) are used, so the valid product for the current session parameters will be returned. UsegetProductForCodeAndOptions(String, Collection)
if you only have the code.- Parameters:
productModel
- the productModeloptions
- options set that determines amount of information that will be attached to the returned product. If empty or null default BASIC option is assumed- Returns:
- the
ProductData
-
getProductForCodeAndOptions
ProductData getProductForCodeAndOptions(java.lang.String code, java.util.Collection<ProductOption> options) throws UnknownIdentifierException, java.lang.IllegalArgumentException
Gets the product by code. The current session data (catalog versions, user) are used, so the valid product for the current session parameters will be returned. UsegetProductForOptions(ProductModel, Collection)
if you have the model already.- Parameters:
code
- the code of the product to be foundoptions
- options set that determines amount of information that will be attached to the returned product. If empty or null default BASIC option is assumed- Returns:
- the
ProductData
- Throws:
java.lang.IllegalArgumentException
- when given product code is nullUnknownIdentifierException
- when product with the given code is not found
-
postReview
ReviewData postReview(java.lang.String productCode, ReviewData reviewData) throws UnknownIdentifierException, java.lang.IllegalArgumentException
Post review for specified product code. Current session catalog version is used to retrieve proper product. NewCustomerReviewModel
entry will be created.- Parameters:
productCode
- the product code that given review will be assigned toreviewData
- the review data to be created in the system- Returns:
- the created review converted into
ReviewData
object - Throws:
java.lang.IllegalArgumentException
- when given review data is nullUnknownIdentifierException
- when product with the given code is not found
-
getReviews
java.util.List<ReviewData> getReviews(java.lang.String productCode) throws UnknownIdentifierException
Gets the reviews for specified product. Current session catalog version is used to retrieve reviews from proper product.- Parameters:
productCode
- the product code- Returns:
- the reviews that are assigned to specified product
- Throws:
UnknownIdentifierException
- when product with the given code is not found
-
getReviews
java.util.List<ReviewData> getReviews(java.lang.String productCode, java.lang.Integer numberOfReviews) throws UnknownIdentifierException, java.lang.IllegalArgumentException
Gets the first X reviews for specified product. Current session catalog version is used to retrieve reviews from proper product.- Parameters:
productCode
- the product codenumberOfReviews
- the number of reviews to show, if null shows all reviews, if exceeds the total number of reviews, shows all available reviews- Returns:
- the first X reviews that are assigned to specified product
- Throws:
UnknownIdentifierException
- when product with the given code is not foundjava.lang.IllegalArgumentException
- when the quantity of numberOfReviews is negative
-
getProductReferencesForCode
@Deprecated(since="5.0") java.util.List<ProductReferenceData> getProductReferencesForCode(java.lang.String code, ProductReferenceTypeEnum referenceType, java.util.List<ProductOption> options, java.lang.Integer limit)
Deprecated.Since 5.0. Use {getProductReferencesForCode(String, List, List, Integer)
instead.Retrieves product references of a product given its code.- Parameters:
code
- the product codereferenceType
- the product reference typeoptions
- options set that determines amount of information that will be attached to the returned productlimit
- maximum number of references to retrieve. If null, all available references will be retrieved- Returns:
- the product references
-
getProductReferencesForCode
java.util.List<ProductReferenceData> getProductReferencesForCode(java.lang.String code, java.util.List<ProductReferenceTypeEnum> referenceTypes, java.util.List<ProductOption> options, java.lang.Integer limit)
Retrieves product references of a product given its code.- Parameters:
code
- the product codereferenceTypes
- the product reference types to return.options
- options set that determines amount of information that will be attached to the returned product.limit
- maximum number of references to retrieve. If null, all available references will be retrieved.- Returns:
- the product references
-
getConfiguratorSettingsForCode
@Nonnull java.util.List<ConfigurationInfoData> getConfiguratorSettingsForCode(@Nonnull java.lang.String code)
Collect product configurator settings by product code.- Parameters:
code
- product code- Returns:
- list of configurator settings
-
-