Class GenericItemObjectValueHandler
java.lang.Object
de.hybris.platform.cockpit.services.values.impl.GenericItemObjectValueHandler
- All Implemented Interfaces:
ObjectValueHandler
- Direct Known Subclasses:
WorkflowGenericItemObjectHandler
Object value handler implementation based upon generic item attribute access via
Item.getAttribute(String)
and Item.setAttribute(String, Object). Currently accepts items and PKs as source
objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcollectValues(ObjectValueContainer container, boolean allValues, Map<ItemAttributePropertyDescriptor, Object> originalValues, Map<ItemAttributePropertyDescriptor, Object> modifiedValues) protected ItemModelprotected TypeServiceprotected CommonI18NServiceprotected Set<ItemAttributePropertyDescriptor>getMatchingDescriptors(ItemModel itemModel, Set<PropertyDescriptor> descriptors) protected ObjectgetPathValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Set<String> languageIsos) protected TypeServiceprotected UIAccessRightServiceprotected ObjectgetValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Set<String> languageIsos, Collection<String> visibleLanguageIsos) protected Map<ItemAttributePropertyDescriptor,Object> getValues(ItemModel item, Set<ItemAttributePropertyDescriptor> descriptors, Set<String> languageIsos) protected ObjectgetValueSimple(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor) voidloadValues(ObjectValueContainer valueContainer, ObjectType type, Object source, Set<PropertyDescriptor> descriptors, Set<String> languageIsoCodes) Loads values of given descriptors and in given languages.protected voidlogChanges(ItemModel item, Map<ItemAttributePropertyDescriptor, Object> modifiedValues, Map<ItemAttributePropertyDescriptor, Object> originalValues) protected voidvoidsetCockpitTypeService(TypeService cockpitTypeService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetI18nService(I18NService i18NService) voidsetModelService(ModelService modelService) protected voidsetPathValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) voidsetTypeService(TypeService typeService) voidsetUiAccessRightService(UIAccessRightService accessService) protected voidsetValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) protected voidsetValues(ItemModel item, Map<ItemAttributePropertyDescriptor, Object> values) protected voidsetValueSimple(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) voidstoreValues(ObjectValueContainer container) Stores values of the given value container.voidstoreValues(ObjectValueContainer container, boolean forceWrite) Stores values of the given value container.protected ObjecttoPersistenceLayer(ItemAttributePropertyDescriptor propertyDescriptor, Object value) protected ObjecttoPersistenceLayerSimple(Object value) voidupdateValues(ObjectValueContainer container, Set<String> languageIsoCodes) Updates values of the given value container in given languages.voidupdateValues(ObjectValueContainer container, Set<String> languageIsoCodes, Set<PropertyDescriptor> descriptors) Updates values of given descriptors and in given languages.
-
Constructor Details
-
GenericItemObjectValueHandler
public GenericItemObjectValueHandler()
-
-
Method Details
-
loadValues
public void loadValues(ObjectValueContainer valueContainer, ObjectType type, Object source, Set<PropertyDescriptor> descriptors, Set<String> languageIsoCodes) throws ValueHandlerException Description copied from interface:ObjectValueHandlerLoads values of given descriptors and in given languages. Only object values this value handler is responsible for are loaded!- Specified by:
loadValuesin interfaceObjectValueHandler- Parameters:
valueContainer- container of all valuestype- type of the objectsource- the object itselfdescriptors- descriptors which should be loadedlanguageIsoCodes- languages in which the localized values should be loaded- Throws:
ValueHandlerException- if something goes wrong during value loading
-
getValues
protected Map<ItemAttributePropertyDescriptor,Object> getValues(ItemModel item, Set<ItemAttributePropertyDescriptor> descriptors, Set<String> languageIsos) throws ValueHandlerException - Throws:
ValueHandlerException
-
getValue
protected Object getValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Set<String> languageIsos, Collection<String> visibleLanguageIsos) throws ValueHandlerException - Throws:
ValueHandlerException
-
getPathValue
protected Object getPathValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Set<String> languageIsos) throws ValueHandlerException - Throws:
ValueHandlerException
-
getValueSimple
protected Object getValueSimple(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor) throws ValueHandlerException - Throws:
ValueHandlerException
-
getMatchingDescriptors
protected Set<ItemAttributePropertyDescriptor> getMatchingDescriptors(ItemModel itemModel, Set<PropertyDescriptor> descriptors) -
fetchItem
- Throws:
ValueHandlerException
-
storeValues
Description copied from interface:ObjectValueHandlerStores values of the given value container. Only object values this value handler is responsible for are stored!- Specified by:
storeValuesin interfaceObjectValueHandler- Parameters:
container- container of all values- Throws:
ValueHandlerException- something goes wrong during value storing
-
storeValues
public void storeValues(ObjectValueContainer container, boolean forceWrite) throws ValueHandlerException Description copied from interface:ObjectValueHandlerStores values of the given value container. Only object values this value handler is responsible for are stored!- Specified by:
storeValuesin interfaceObjectValueHandler- Parameters:
container- container of all valuesforceWrite- store values even if they are not marked as modified- Throws:
ValueHandlerException- something goes wrong during value storing
-
setValues
protected void setValues(ItemModel item, Map<ItemAttributePropertyDescriptor, Object> values) throws ValueHandlerException- Throws:
ValueHandlerException
-
setValue
protected void setValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) throws ValueHandlerException - Throws:
ValueHandlerException
-
setPathValue
protected void setPathValue(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) throws ValueHandlerException - Throws:
ValueHandlerException
-
setValueSimple
protected void setValueSimple(ItemModel item, ItemAttributePropertyDescriptor propertyDescriptor, Object value) throws ValueHandlerException - Throws:
ValueHandlerException
-
collectValues
protected void collectValues(ObjectValueContainer container, boolean allValues, Map<ItemAttributePropertyDescriptor, Object> originalValues, Map<ItemAttributePropertyDescriptor, Object> modifiedValues) -
updateValues
public void updateValues(ObjectValueContainer container, Set<String> languageIsoCodes, Set<PropertyDescriptor> descriptors) throws ValueHandlerException Description copied from interface:ObjectValueHandlerUpdates values of given descriptors and in given languages. Only object values this value handler is responsible for are updated!- Specified by:
updateValuesin interfaceObjectValueHandler- Parameters:
container- container of all valueslanguageIsoCodes- languages in which the localized values should be loadeddescriptors- descriptors which should be updated- Throws:
ValueHandlerException- if something goes wrong during value loading
-
updateValues
public void updateValues(ObjectValueContainer container, Set<String> languageIsoCodes) throws ValueHandlerException Description copied from interface:ObjectValueHandlerUpdates values of the given value container in given languages. Only object values this value handler is responsible for are updated!- Specified by:
updateValuesin interfaceObjectValueHandler- Parameters:
container- container of all valueslanguageIsoCodes- languages in which the localized values should be loaded- Throws:
ValueHandlerException- if something goes wrong during value loading
-
logChanges
protected void logChanges(ItemModel item, Map<ItemAttributePropertyDescriptor, Object> modifiedValues, Map<ItemAttributePropertyDescriptor, Object> originalValues) -
toPersistenceLayer
protected Object toPersistenceLayer(ItemAttributePropertyDescriptor propertyDescriptor, Object value) -
saveModel
-
toPersistenceLayerSimple
-
getCockpitTypeService
-
setCockpitTypeService
-
getTypeService
-
setTypeService
-
setModelService
-
getModelService
-
setI18nService
-
getI18NService
-
setUiAccessRightService
-
getUiAccessRightService
-
setCommonI18NService
-
getCommonI18NService
-