public class DefaultVariantsService extends AbstractBusinessService implements VariantsService
VariantsService.AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultVariantsService() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<VariantTypeModel> |
getAllVariantTypes()
Searches all existing variant types.
|
java.util.Map<java.lang.String,java.util.Collection<java.lang.Object>> |
getAssignedVariantAttributes(ProductModel baseProduct)
Searches variant attributes with all assigned values for given base product.
|
java.util.Set<java.lang.String> |
getVariantAttributes(java.lang.String variantProductType)
Returns a set of variant attribute qualifiers for the given
variantProductType. |
java.util.List<VariantAttributeDescriptorModel> |
getVariantAttributesForVariantType(VariantTypeModel variantType)
Returns the attribute descriptors of the given
VariantType. |
java.lang.Object |
getVariantAttributeValue(VariantProductModel variant,
java.lang.String qualifier)
Returns for the given
VariantProductModel and given attribute qualifier the value of this
attribute. |
java.util.Collection<VariantProductModel> |
getVariantProductForAttributeValues(ProductModel baseProduct,
java.util.Map<java.lang.String,java.lang.Object> filterValues)
Filters a range of variants from a given base product according to the given variant attribute qualifier-value
map.
|
VariantTypeModel |
getVariantTypeForCode(java.lang.String code)
Returns a
VariantTypeModel instance for the given code. |
void |
setTypeService(TypeService typeService) |
void |
setVariantAttributesForVariantType(VariantTypeModel variantType,
java.util.List<VariantAttributeDescriptorModel> newAttributes)
Tries to assign new variant attribute descriptors for the given variant type.
|
void |
setVariantAttributeValue(VariantProductModel variant,
java.lang.String qualifier,
java.lang.Object value)
|
void |
setVariantTypeDao(VariantTypeDao variantTypeDao) |
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic VariantTypeModel getVariantTypeForCode(java.lang.String code)
VariantTypeModel instance for the given code.getVariantTypeForCode in interface VariantsServicecode - the variant type code. Must exists in the system and must be not null.public java.util.Set<java.lang.String> getVariantAttributes(java.lang.String variantProductType)
variantProductType.getVariantAttributes in interface VariantsServicevariantProductType - the variant type code. Must exists in the system and must be a variant type.variantProductType no variant attributes were found.public java.lang.Object getVariantAttributeValue(VariantProductModel variant, java.lang.String qualifier)
VariantProductModel and given attribute qualifier the value of this
attribute.
TODO: to be changed, remove the jalo part. At this moment the jalo-way has to be used because there is no chance
to read the attribute value in SL, because it's not a part of the model.getVariantAttributeValue in interface VariantsServicevariant - the variant productqualifier - the attribute qualifierpublic void setVariantAttributeValue(VariantProductModel variant, java.lang.String qualifier, java.lang.Object value)
VariantProductModel the given value to the given attribute
qualifier.
TODO: to be changed, remove the jalo part. At this moment the jalo-way has to be used because there is no chance
to read the attribute value in SL, because it's not a part of the model.setVariantAttributeValue in interface VariantsServicevariant - the variant productqualifier - the attribute qualifiervalue - the value to be setpublic void setTypeService(TypeService typeService)
public void setVariantTypeDao(VariantTypeDao variantTypeDao)
public java.util.Collection<VariantTypeModel> getAllVariantTypes()
getAllVariantTypes in interface VariantsServicepublic java.util.Map<java.lang.String,java.util.Collection<java.lang.Object>> getAssignedVariantAttributes(ProductModel baseProduct)
getAssignedVariantAttributes in interface VariantsServicebaseProduct - the base product for all variantspublic java.util.Collection<VariantProductModel> getVariantProductForAttributeValues(ProductModel baseProduct, java.util.Map<java.lang.String,java.lang.Object> filterValues)
getVariantProductForAttributeValues in interface VariantsServicebaseProduct - the base product to get variants forfilterValues - the variant attribute values (attribute qualifier->value map) to match. if null or empty an
empty List will be returned.public java.util.List<VariantAttributeDescriptorModel> getVariantAttributesForVariantType(VariantTypeModel variantType)
VariantType.getVariantAttributesForVariantType in interface VariantsServicevariantType - the variant typepublic void setVariantAttributesForVariantType(VariantTypeModel variantType, java.util.List<VariantAttributeDescriptorModel> newAttributes)
VariantAttributeDescriptorModels.setVariantAttributesForVariantType in interface VariantsServicevariantType - the variant typenewAttributes - the attributes which should be assignedCopyright © 2018 SAP SE. All Rights Reserved.