Interface ClassificationService
-
- All Known Implementing Classes:
DefaultClassificationService
public interface ClassificationServiceService to obtain information about a product's features and to search for products with classifcation attribute filters applied- Spring Bean ID:
- classificationService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Collection<ClassificationAttributeUnitModel>getAttributeUnits(ClassificationSystemVersionModel systemVersion)Returns a list of all classification attribute units.FeaturegetFeature(ItemModel item, ClassAttributeAssignmentModel assignment)Deprecated.since ages - usegetFeature(ProductModel, ClassAttributeAssignmentModel)instead.FeaturegetFeature(ProductModel product, ClassAttributeAssignmentModel assignment)Returns a classification feature for a given product and assignment.FeatureListgetFeatures(ProductModel product)Returns a list of classification features for a given product.FeatureListgetFeatures(ProductModel product, java.util.List<ClassAttributeAssignmentModel> assignments)Returns a list of classification features for a given product and assignments.ProductFilterResultgetProductsByFilter(ProductFilter filter)Returns all products for which the given filter applies.voidreplaceFeatures(ProductModel product, FeatureList featureList)Sets all the features from the list to the product model.voidsetFeature(ProductModel product, Feature feature)Sets a singleFeatureto the givenProductModel.voidsetFeatures(ProductModel product, FeatureList featureList)Sets the given list of classificationFeatures to the givenProductModel.
-
-
-
Method Detail
-
getFeatures
FeatureList getFeatures(ProductModel product)
Returns a list of classification features for a given product.- Parameters:
product- the product to load the features for- Returns:
- the list of features
- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted
-
getFeature
@Deprecated Feature getFeature(ItemModel item, ClassAttributeAssignmentModel assignment)
Deprecated.since ages - usegetFeature(ProductModel, ClassAttributeAssignmentModel)instead.Returns a classification feature for a given item.- Parameters:
item- the item to load the features for- Returns:
- the features
-
getFeature
Feature getFeature(ProductModel product, ClassAttributeAssignmentModel assignment)
Returns a classification feature for a given product and assignment.- Parameters:
product- the item to load the features for- Returns:
- the features
- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted,assignmentis null
-
getProductsByFilter
ProductFilterResult getProductsByFilter(ProductFilter filter) throws UnknownIdentifierException, AmbiguousIdentifierException
Returns all products for which the given filter applies. The filter is defined in terms of a category and a number of classification attribute code/value pairs. Attribute values can be given as String. This method will convert string values to the type of the actual classification attribute before applying the filter. Scalar types are converted by using thevalueOfmethod of attribute value's class. When the attribute is of type enum the string is interpreted as the code of the enum value.- Parameters:
filter- the filter to apply- Returns:
- the filtered products
- Throws:
UnknownIdentifierException- when a attribute with a given code cannot be foundAmbiguousIdentifierException- when there's more than one attribute with a given code
-
setFeatures
void setFeatures(ProductModel product, FeatureList featureList)
Sets the given list of classificationFeatures to the givenProductModel. Any other existing feature at the product model which is not in the list won't change- Parameters:
product- the productfeatureList- the FeatureList object- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted,featureListis null
-
replaceFeatures
void replaceFeatures(ProductModel product, FeatureList featureList)
Sets all the features from the list to the product model. The existing features at the producr model which are not in the feature list are removed (untyped feature) or the feature values of this feature are cleared (typed feature)- Parameters:
product- the Product modelfeatureList- contains the features with new/changed feature values. Or features with the same feature values which are already stored - those won't change then.- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted,featureListis null
-
setFeature
void setFeature(ProductModel product, Feature feature)
Sets a singleFeatureto the givenProductModel. Any other Feature at the product model won't be changed.- Parameters:
product- the productfeature- the feature- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted,featureis null
-
getAttributeUnits
java.util.Collection<ClassificationAttributeUnitModel> getAttributeUnits(ClassificationSystemVersionModel systemVersion)
Returns a list of all classification attribute units.- Parameters:
systemVersion- the system version of the classification- Returns:
- the classification attribute units
-
getFeatures
FeatureList getFeatures(ProductModel product, java.util.List<ClassAttributeAssignmentModel> assignments)
Returns a list of classification features for a given product and assignments.- Parameters:
product- the product to load the features forassignments- list of assignments- Returns:
- the list of features
- Throws:
java.lang.IllegalArgumentException- thrown whenproductis null or is not persisted
-
-