Interface ModelHelper
-
- All Known Implementing Classes:
DefaultModelHelper
public interface ModelHelperContains useful methods for managing service layer models in a cockpit environment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisWritable(ItemModel model, java.lang.String attribute, boolean creationMode)Checks write permissions for the given item and attribute.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 createUndoOperation)Saves the given model and creates a change log entry.voidsaveModel(ItemModel model, boolean createUndoOperation, boolean sendChangeEvents)Saves the given model and creates a change log entry.voidsaveModels(java.util.Set<ItemModel> models, boolean createUndoOperation)Saves given models and creates change log entry for each modification.voidsaveModels(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 savecreateUndoOperation- 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 savecreateUndoOperation- 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 savecreateUndoOperation- 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 savecreateUndoOperation- 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
-
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 removecreateUndoOperation- 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 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
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 forattribute- the attribute to check permission forcreationMode- creation mode- Returns:
- true if write possible, false otherwise
-
-