Class DefaultModelHelper

java.lang.Object
de.hybris.platform.cockpit.helpers.impl.DefaultModelHelper
All Implemented Interfaces:
ModelHelper

public class DefaultModelHelper extends Object implements ModelHelper
Default implementation of the model helper.
  • Constructor Details

    • DefaultModelHelper

      public DefaultModelHelper()
  • Method Details

    • saveModel

      public void saveModel(ItemModel model, boolean createUndoOperations) throws ValueHandlerException
      Description copied from interface: ModelHelper
      Saves 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:
      saveModel in interface ModelHelper
      Parameters:
      model - the model to save
      createUndoOperations - 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: ModelHelper
      Saves 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:
      saveModel in interface ModelHelper
      Parameters:
      model - the model to save
      createUndoOperations - 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: ModelHelper
      Saves 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:
      saveModels in interface ModelHelper
      Parameters:
      models - models to save
      createUndoOperations - 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: ModelHelper
      Saves 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:
      saveModels in interface ModelHelper
      Parameters:
      models - models to save
      createUndoOperations - undo operation will be created if set to true
      sendChangeEvents - 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

      protected DefaultModelHelper.ModificationInfo getModificationInfo(ItemModel model)
    • getOriginalValue

      protected Object getOriginalValue(ItemModel model, String attribute, ModelValueHistory history)
    • getOriginalValue

      protected Object getOriginalValue(ItemModel model, String attribute, Locale locale, ModelValueHistory history)
    • logModifications

      protected void logModifications(ItemModel model, DefaultModelHelper.ModificationInfo modificationInfo)
    • createUndoOperations

      protected void createUndoOperations(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: ModelHelper
      Removes 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:
      removeModel in interface ModelHelper
      Parameters:
      model - the model to remove
      createUndoOperation - 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: ModelHelper
      Removes 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:
      removeModel in interface ModelHelper
      Parameters:
      model - the model to remove
      createUndoOperation - undo operation will be created if set to true
      sendChangeEvents - 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, String attribute, boolean creationMode)
      Description copied from interface: ModelHelper
      Checks write permissions for the given item and attribute.
      Specified by:
      isWritable in interface ModelHelper
      Parameters:
      model - the item to check permission for
      attribute - the attribute to check permission for
      creationMode - creation mode
      Returns:
      true if write possible, false otherwise
    • valuesEqual

      protected boolean valuesEqual(Object value1, 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()