Class DefaultModelHelper

  • All Implemented Interfaces:
    ModelHelper

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

      • DefaultModelHelper

        public DefaultModelHelper()
    • Method Detail

      • 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​(java.util.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​(java.util.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
      • 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)
      • 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,
                                  java.lang.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​(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)
      • setUiAccessRightService

        public void setUiAccessRightService​(UIAccessRightService uiAccessRightService)
      • setI18nService

        public void setI18nService​(I18NService i18nService)
      • getI18nService

        protected I18NService getI18nService()
      • setCommonI18NService

        public void setCommonI18NService​(CommonI18NService commonI18NService)
      • 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()