Interface ModelHelper

  • All Known Implementing Classes:
    DefaultModelHelper

    public interface ModelHelper
    Contains useful methods for managing service layer models in a cockpit environment.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isWritable​(ItemModel model, java.lang.String attribute, boolean creationMode)
      Checks write permissions for the given item and attribute.
      void removeModel​(ItemModel model, boolean createUndoOperation)
      Removes the given model and creates a change log entry.
      void removeModel​(ItemModel model, boolean createUndoOperation, boolean sendChangeEvents)
      Removes the given model and creates a change log entry.
      void saveModel​(ItemModel model, boolean createUndoOperation)
      Saves the given model and creates a change log entry.
      void saveModel​(ItemModel model, boolean createUndoOperation, boolean sendChangeEvents)
      Saves the given model and creates a change log entry.
      void saveModels​(java.util.Set<ItemModel> models, boolean createUndoOperation)
      Saves given models and creates change log entry for each modification.
      void saveModels​(java.util.Set<ItemModel> models, boolean createUndoOperation, boolean sendChangeEvents)
      Saves given models and creates change log entry for each modification.
    • Method Detail

      • saveModel

        void saveModel​(ItemModel model,
                       boolean createUndoOperation)
                throws ValueHandlerException
        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.
        Parameters:
        model - the model to save
        createUndoOperation - undo operation will be created if set to true
        Throws:
        ValueHandlerException - when problem occurs, e.g. user rights check fails
      • saveModel

        void saveModel​(ItemModel model,
                       boolean createUndoOperation,
                       boolean sendChangeEvents)
                throws ValueHandlerException
        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.
        Parameters:
        model - the model to save
        createUndoOperation - undo operation will be created if set to true
        Throws:
        ValueHandlerException - when problem occurs, e.g. user rights check fails
      • saveModels

        void saveModels​(java.util.Set<ItemModel> models,
                        boolean createUndoOperation)
                 throws ValueHandlerException
        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.
        Parameters:
        models - models to save
        createUndoOperation - undo operation will be created if set to true
        Throws:
        ValueHandlerException - when problem occurs, e.g. user rights check fails
      • saveModels

        void saveModels​(java.util.Set<ItemModel> models,
                        boolean createUndoOperation,
                        boolean sendChangeEvents)
                 throws ValueHandlerException
        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.
        Parameters:
        models - models to save
        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
      • removeModel

        void removeModel​(ItemModel model,
                         boolean createUndoOperation)
                  throws ValueHandlerException
        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.
        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

        void removeModel​(ItemModel model,
                         boolean createUndoOperation,
                         boolean sendChangeEvents)
                  throws ValueHandlerException
        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.
        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

        boolean isWritable​(ItemModel model,
                           java.lang.String attribute,
                           boolean creationMode)
        Checks write permissions for the given item and attribute.
        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