Class DefaultModelHelper
java.lang.Object
de.hybris.platform.cockpit.helpers.impl.DefaultModelHelper
- All Implemented Interfaces:
ModelHelper
Default implementation of the model helper.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckUserRights(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) protected voidcheckUserRights(ItemModel model, String attribute, boolean creationMode) protected voidcreateUndoOperation(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) protected voidcreateUndoOperations(Set<DefaultModelHelper.ModificationInfo> modificationInfos) protected CommonI18NServiceprotected I18NServiceprotected LocalizationServiceDeprecated.since 6.3protected ModelServiceprotected DefaultModelHelper.ModificationInfogetModificationInfo(ItemModel model) protected ObjectgetOriginalValue(ItemModel model, String attribute, ModelValueHistory history) protected ObjectgetOriginalValue(ItemModel model, String attribute, Locale locale, ModelValueHistory history) protected SystemServiceprotected TypeServiceprotected UIAccessRightServiceprotected UndoManagerbooleanisWritable(ItemModel model, String attribute, boolean creationMode) Checks write permissions for the given item and attribute.protected voidlogModifications(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) voidremoveModel(ItemModel model, boolean createUndoOperation) Removes the given model and creates a change log entry.voidremoveModel(ItemModel model, boolean createUndoOperation, boolean sendChangeEvents) Removes the given model and creates a change log entry.voidSaves the given model and creates a change log entry.voidSaves the given model and creates a change log entry.voidsaveModels(Set<ItemModel> models, boolean createUndoOperations) Saves given models and creates change log entry for each modification.voidsaveModels(Set<ItemModel> models, boolean createUndoOperations, boolean sendChangeEvents) Saves given models and creates change log entry for each modification.protected voidsendItemChangeEvent(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetI18nService(I18NService i18nService) voidsetLocalizationService(LocalizationService localizationService) Deprecated.since 6.3voidsetModelService(ModelService modelService) voidsetSystemService(SystemService systemService) voidsetTypeService(TypeService typeService) voidsetUiAccessRightService(UIAccessRightService uiAccessRightService) voidsetUndoManager(UndoManager undoManager) protected booleanvaluesEqual(Object value1, Object value2, boolean localized)
-
Constructor Details
-
DefaultModelHelper
public DefaultModelHelper()
-
-
Method Details
-
saveModel
Description copied from interface:ModelHelperSaves the given model and creates a change log entry. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
saveModelin interfaceModelHelper- Parameters:
model- the model to savecreateUndoOperations- undo operation will be created if set to true- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
saveModel
public void saveModel(ItemModel model, boolean createUndoOperations, boolean sendChangeEvents) throws ValueHandlerException Description copied from interface:ModelHelperSaves the given model and creates a change log entry. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
saveModelin interfaceModelHelper- Parameters:
model- the model to savecreateUndoOperations- undo operation will be created if set to true- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
saveModels
public void saveModels(Set<ItemModel> models, boolean createUndoOperations) throws ValueHandlerException Description copied from interface:ModelHelperSaves given models and creates change log entry for each modification. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
saveModelsin interfaceModelHelper- Parameters:
models- models to savecreateUndoOperations- undo operation will be created if set to true- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
saveModels
public void saveModels(Set<ItemModel> models, boolean createUndoOperations, boolean sendChangeEvents) throws ValueHandlerException Description copied from interface:ModelHelperSaves given models and creates change log entry for each modification. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
saveModelsin interfaceModelHelper- Parameters:
models- models to savecreateUndoOperations- undo operation will be created if set to truesendChangeEvents- if true, item change events will be sent- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
sendItemChangeEvent
protected void sendItemChangeEvent(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) -
checkUserRights
protected void checkUserRights(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) throws ValueHandlerException - Throws:
ValueHandlerException
-
checkUserRights
protected void checkUserRights(ItemModel model, String attribute, boolean creationMode) throws ValueHandlerException - Throws:
ValueHandlerException
-
getModificationInfo
-
getOriginalValue
-
getOriginalValue
protected Object getOriginalValue(ItemModel model, String attribute, Locale locale, ModelValueHistory history) -
logModifications
protected void logModifications(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) -
createUndoOperations
-
createUndoOperation
protected void createUndoOperation(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo) -
removeModel
Description copied from interface:ModelHelperRemoves the given model and creates a change log entry. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
removeModelin interfaceModelHelper- Parameters:
model- the model to removecreateUndoOperation- undo operation will be created if set to true- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
removeModel
public void removeModel(ItemModel model, boolean createUndoOperation, boolean sendChangeEvents) throws ValueHandlerException Description copied from interface:ModelHelperRemoves the given model and creates a change log entry. It also checks user rights and if this check fails the ValueHandlerException will be thrown.- Specified by:
removeModelin interfaceModelHelper- Parameters:
model- the model to removecreateUndoOperation- undo operation will be created if set to truesendChangeEvents- if true, item change events will be sent- Throws:
ValueHandlerException- when problem occurs, e.g. user rights check fails
-
isWritable
Description copied from interface:ModelHelperChecks write permissions for the given item and attribute.- Specified by:
isWritablein interfaceModelHelper- Parameters:
model- the item to check permission forattribute- the attribute to check permission forcreationMode- creation mode- Returns:
- true if write possible, false otherwise
-
valuesEqual
-
setModelService
-
getModelService
-
setTypeService
-
getTypeService
-
setSystemService
-
getSystemService
-
setUiAccessRightService
-
getUiAccessRightService
-
setI18nService
-
getI18nService
-
setCommonI18NService
-
getCommonI18NService
-
setLocalizationService
Deprecated.since 6.3 -
getLocalizationService
Deprecated.since 6.3 -
setUndoManager
-
getUndoManager
-