Class DefaultModelHelper
- java.lang.Object
-
- de.hybris.platform.cockpit.helpers.impl.DefaultModelHelper
-
- All Implemented Interfaces:
ModelHelper
public class DefaultModelHelper extends java.lang.Object implements ModelHelper
Default implementation of the model helper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDefaultModelHelper.ModificationInfo
-
Constructor Summary
Constructors Constructor Description DefaultModelHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcheckUserRights(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo)protected voidcheckUserRights(ItemModel model, java.lang.String attribute, boolean creationMode)protected voidcreateUndoOperation(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo)protected voidcreateUndoOperations(java.util.Set<DefaultModelHelper.ModificationInfo> modificationInfos)protected CommonI18NServicegetCommonI18NService()protected I18NServicegetI18nService()protected LocalizationServicegetLocalizationService()Deprecated.since 6.3protected ModelServicegetModelService()protected DefaultModelHelper.ModificationInfogetModificationInfo(ItemModel model)protected java.lang.ObjectgetOriginalValue(ItemModel model, java.lang.String attribute, ModelValueHistory history)protected java.lang.ObjectgetOriginalValue(ItemModel model, java.lang.String attribute, java.util.Locale locale, ModelValueHistory history)protected SystemServicegetSystemService()protected TypeServicegetTypeService()protected UIAccessRightServicegetUiAccessRightService()protected UndoManagergetUndoManager()booleanisWritable(ItemModel model, java.lang.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.voidsaveModel(ItemModel model, boolean createUndoOperations)Saves the given model and creates a change log entry.voidsaveModel(ItemModel model, boolean createUndoOperations, boolean sendChangeEvents)Saves the given model and creates a change log entry.voidsaveModels(java.util.Set<ItemModel> models, boolean createUndoOperations)Saves given models and creates change log entry for each modification.voidsaveModels(java.util.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(java.lang.Object value1, java.lang.Object value2, boolean localized)
-
-
-
Method Detail
-
saveModel
public void saveModel(ItemModel model, boolean createUndoOperations) 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
-
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(java.util.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(java.util.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, java.lang.String attribute, boolean creationMode) throws ValueHandlerException
- Throws:
ValueHandlerException
-
getModificationInfo
protected DefaultModelHelper.ModificationInfo getModificationInfo(ItemModel model)
-
getOriginalValue
protected java.lang.Object getOriginalValue(ItemModel model, java.lang.String attribute, ModelValueHistory history)
-
getOriginalValue
protected java.lang.Object getOriginalValue(ItemModel model, java.lang.String attribute, java.util.Locale locale, ModelValueHistory history)
-
logModifications
protected void logModifications(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo)
-
createUndoOperations
protected void createUndoOperations(java.util.Set<DefaultModelHelper.ModificationInfo> modificationInfos)
-
createUndoOperation
protected void createUndoOperation(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo)
-
removeModel
public void removeModel(ItemModel model, boolean createUndoOperation) 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 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
public boolean isWritable(ItemModel model, java.lang.String attribute, boolean creationMode)
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
protected boolean valuesEqual(java.lang.Object value1, java.lang.Object value2, boolean localized)
-
setModelService
public void setModelService(ModelService modelService)
-
getModelService
protected ModelService getModelService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getTypeService
protected TypeService getTypeService()
-
setSystemService
public void setSystemService(SystemService systemService)
-
getSystemService
protected SystemService getSystemService()
-
setUiAccessRightService
public void setUiAccessRightService(UIAccessRightService uiAccessRightService)
-
getUiAccessRightService
protected UIAccessRightService getUiAccessRightService()
-
setI18nService
public void setI18nService(I18NService i18nService)
-
getI18nService
protected I18NService getI18nService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setLocalizationService
@Deprecated public void setLocalizationService(LocalizationService localizationService)
Deprecated.since 6.3
-
getLocalizationService
@Deprecated protected LocalizationService getLocalizationService()
Deprecated.since 6.3
-
setUndoManager
public void setUndoManager(UndoManager undoManager)
-
getUndoManager
protected UndoManager getUndoManager()
-
-