Interface ProductReferenceService
-
- All Known Implementing Classes:
DefaultProductReferenceService
public interface ProductReferenceServiceService providing product references oriented functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<ProductReferenceModel>getProductReferences(java.lang.String qualifier, ProductModel source, ProductModel target, boolean activeOnly)ReturnsProductReferenceModels that join the two given products in the given source/target configuration having the givenProductReferenceModel.QUALIFIERvalue.java.util.Collection<ProductReferenceModel>getProductReferencesForSourceAndTarget(ProductModel source, ProductModel target, boolean activeOnly)Returns allProductReferenceModels that join the two given products in the given (persisted) source/target configuration.java.util.Collection<ProductReferenceModel>getProductReferencesForSourceProduct(ProductModel source, ProductReferenceTypeEnum referenceType, boolean activeOnly)Returns allProductReferenceModels for the given (persisted) sourceProductModeland for the specificProductReferenceTypeEnum.java.util.Collection<ProductReferenceModel>getProductReferencesForTargetProduct(ProductModel target, ProductReferenceTypeEnum referenceType, boolean activeOnly)Returns allProductReferenceModels for the given (persisted) targetProductModeland for the specificProductReferenceTypeEnum.
-
-
-
Method Detail
-
getProductReferencesForSourceProduct
java.util.Collection<ProductReferenceModel> getProductReferencesForSourceProduct(ProductModel source, ProductReferenceTypeEnum referenceType, boolean activeOnly)
Returns allProductReferenceModels for the given (persisted) sourceProductModeland for the specificProductReferenceTypeEnum. Example: UsingProductReferenceTypeEnum.ACCESSORIESreturns the related (accessories)ProductReferenceModels, NOT the actual products (accessories), useProductReferenceModel.getTarget()to get the actual accessory product.- Parameters:
source- the sourceProductModelreferenceType- the type of the reference -ProductReferenceTypeEnum. If this argument isnull, the productReferences of all types will be returned.activeOnly- - iftrue, only active product references will be returned.- Returns:
- a collection of
ProductReferenceModels or an empty list if there are no source references for the given product - Throws:
java.lang.IllegalArgumentException- ifsourceproduct is null.
-
getProductReferencesForTargetProduct
java.util.Collection<ProductReferenceModel> getProductReferencesForTargetProduct(ProductModel target, ProductReferenceTypeEnum referenceType, boolean activeOnly)
Returns allProductReferenceModels for the given (persisted) targetProductModeland for the specificProductReferenceTypeEnum. Example: UsingProductReferenceTypeEnum.CROSSELLINGreturns the related (for cross selling)ProductReferenceModels, NOT the actual cross selled (source) products, useProductReferenceModel.getSource()to get the source product of the cross selling.- Parameters:
target- the targetProductModelreferenceType- the type of the reference -ProductReferenceTypeEnum. If this argument isnull, the productReferences of all types will be returned.activeOnly- - iftrue, only active product references will be returned.- Returns:
- a collection of
ProductReferenceModels or empty list if there are no target references for the given product. - Throws:
java.lang.IllegalArgumentException- iftargetproduct is null.
-
getProductReferencesForSourceAndTarget
java.util.Collection<ProductReferenceModel> getProductReferencesForSourceAndTarget(ProductModel source, ProductModel target, boolean activeOnly)
Returns allProductReferenceModels that join the two given products in the given (persisted) source/target configuration. One can get multipleProductReferenceModels as one product may reference another in different way (differentProductReferenceModel.REFERENCETYPE) Example: two products can be joined by a reference ofProductReferenceTypeEnum.ACCESSORIESandProductReferenceTypeEnum.CROSSELLINGtypes, which means that one is an accessory of the other and - at the same time - they are configured in the cross-selling strategy.- Parameters:
source- the sourceProductModeltarget- the targetProductModelactiveOnly- - iftrue, only active Product references will be returned.- Returns:
- Collection of the
ProductReferenceModels or empty list. - Throws:
java.lang.IllegalArgumentException- if eithersourceortargetproduct is null.
-
getProductReferences
java.util.Collection<ProductReferenceModel> getProductReferences(java.lang.String qualifier, ProductModel source, ProductModel target, boolean activeOnly)
ReturnsProductReferenceModels that join the two given products in the given source/target configuration having the givenProductReferenceModel.QUALIFIERvalue.- Parameters:
qualifier- the desiredProductReferenceModel.QUALIFIER. If this argument isnullor empty string, it will be ignored as a search criterion.source- the sourceProductModeltarget- the targetProductModelactiveOnly- - iftrue, only active Product references will be returned.- Returns:
- Collection of the
ProductReferenceModels or empty list. - Throws:
java.lang.IllegalArgumentException- if eithersourceortargetproduct is null.
-
-