Interface ModifiableModelAwareDataHolder
-
- All Superinterfaces:
DataHolder,ModelAwareDataHolder,ModifiableDataHolder
- All Known Subinterfaces:
CommentableContent,ModelAwareJCRAmetysObject,ModifiableContent,ModifiableModelAwareDataAwareAmetysObject,ModifiableWebContent,ModifiableWorkflowAwareContent,ProgramPart,TraversableProgramPart
- All Known Implementing Classes:
AbstractProgram,AbstractProgramPart,AbstractTraversableProgramPart,Catalog,Container,ContentBackupAmetysObject,ContentValue,Course,CourseList,CoursePart,DefaultModifiableModelAwareDataHolder,ModifiableDefaultContent,ModifiableDefaultWebContent,ModifiableModelAwareComposite,ModifiableModelAwareRepeaterEntry,OrgUnit,Person,Program,Site,SubProgram
public interface ModifiableModelAwareDataHolder extends ModifiableDataHolder, ModelAwareDataHolder
Interface for modifiable data containers with models
-
-
Field Summary
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ModifiableModelAwareCompositegetComposite(String compositePath)Retrieves the composite at the given pathModifiableModelAwareCompositegetComposite(String compositePath, boolean createNew)Retrieves the composite at the given pathModifiableModelAwareCompositegetExternalComposite(String compositePath)Retrieves the external composite at the given pathModifiableModelAwareCompositegetExternalComposite(String compositePath, boolean createNew)Retrieves the external composite at the given pathModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath)Retrieves the external repeater at the given pathModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath, boolean createNew)Retrieves the external repeater at the given pathModifiableModelAwareCompositegetLocalComposite(String compositePath)Retrieves the local composite at the given pathModifiableModelAwareCompositegetLocalComposite(String compositePath, boolean createNew)Retrieves the local composite at the given pathModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath)Retrieves the local repeater at the given pathModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath, boolean createNew)Retrieves the local repeater at the given pathModifiableModelAwareRepeatergetRepeater(String repeaterPath)Retrieves the repeater at the given pathModifiableModelAwareRepeatergetRepeater(String repeaterPath, boolean createNew)Retrieves the repeater at the given pathvoidremoveExternalValue(String dataPath)Removes the external value of the data at the given pathvoidremoveLocalValue(String dataPath)Removes the local value of the data at the given pathvoidremoveValue(String dataPath)Removes the stored value of the data at the given pathvoidsetExternalValue(String dataPath, Object externalValue)Sets the external value of the data at the given pathvoidsetLocalValue(String dataPath, Object localValue)Sets the local value of the data at the given pathvoidsetStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status)Set the status of the data at the given pathvoidsetValue(String dataPath, Object value)Sets the value of the data at the given pathdefault booleansynchronizeValues(Map<String,Object> values)Synchronizes the given values with the current onesdefault booleansynchronizeValues(Map<String,Object> values, boolean useDefaultFromModel)Synchronizes the given values with the current onesdefault booleansynchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP)Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external onebooleansynchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external onedefault booleansynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values)Synchronizes the given values with the current onesdefault booleansynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, boolean useDefaultFromModel)Synchronizes the given values with the current onesdefault booleansynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP)Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external onebooleansynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToSAX, dataToSAX, dataToSAX, dataToSAX, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasDefinition, hasExternalValue, hasLocalValue, hasValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
-
-
-
-
Method Detail
-
getComposite
ModifiableModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
ModifiableModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
ModifiableModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
ModifiableModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
ModifiableModelAwareComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
UndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a composite
-
getLocalComposite
ModifiableModelAwareComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the local composite at the given path- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
ModifiableModelAwareComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the external composite at the given path- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
ModifiableModelAwareRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the repeater at the given path- Parameters:
repeaterPath- path of the repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the local repeater at the given path- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the external repeater at the given path- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
synchronizeValues
default boolean synchronizeValues(Map<String,Object> values) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the current ones- Parameters:
values- the values to synchronize- Returns:
trueif some values have changed,falseotherwise- Throws:
IOException- if an error occurs while synchronizing I/O dataUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
synchronizeValues
default boolean synchronizeValues(Map<String,Object> values, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the current ones- Parameters:
values- the values to synchronizeuseDefaultFromModel-trueto use default values from the model if there is no value in theMapfor an item present in the view- Returns:
trueif some values have changed,falseotherwise- Throws:
IOException- if an error occurs while synchronizing I/O dataUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
synchronizeValues
default boolean synchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Parameters:
values- the values to synchronizeexternalizableDataProviderEP- the extrernalizable data provider extension point- Returns:
trueif some values have changed,falseotherwise- Throws:
UndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueIOException- if an error occurs while synchronizing I/O data
-
synchronizeValues
boolean synchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Parameters:
values- the values to synchronizeexternalizableDataProviderEP- the extrernalizable data provider extension pointuseDefaultFromModel-trueto use default values from the model if there is no value in theMapfor an item present in the view- Returns:
trueif some values have changed,falseotherwise- Throws:
UndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueIOException- if an error occurs while synchronizing I/O data
-
synchronizeValues
default boolean synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the current ones- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizevalues- the values to synchronize- Returns:
trueif some values have changed,falseotherwise- Throws:
IOException- if an error occurs while synchronizing I/O dataUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
synchronizeValues
default boolean synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the current ones- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizevalues- the values to synchronizeuseDefaultFromModel-trueto use default values from the model if there is no value in theMapfor an item present in the view- Returns:
trueif some values have changed,falseotherwise- Throws:
IOException- if an error occurs while synchronizing I/O dataUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
synchronizeValues
default boolean synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizevalues- the values to synchronizeexternalizableDataProviderEP- the extrernalizable data provider extension point- Returns:
trueif some values have changed,falseotherwise- Throws:
UndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueIOException- if an error occurs while synchronizing I/O data
-
synchronizeValues
boolean synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizevalues- the values to synchronizeexternalizableDataProviderEP- the extrernalizable data provider extension pointuseDefaultFromModel-trueto use default values from the model if there is no value in theMapfor an item present in the view- Returns:
trueif some values have changed,falseotherwise- Throws:
UndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueIOException- if an error occurs while synchronizing I/O data
-
setValue
void setValue(String dataPath, Object value) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Sets the value of the data at the given path- Parameters:
dataPath- path of the datavalue- the value to set. Givenullto empty the value.- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the type defined by the model doesn't match the given value to setBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setLocalValue
void setLocalValue(String dataPath, Object localValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Sets the local value of the data at the given path- Parameters:
dataPath- path of the externalizable datalocalValue- the local value to set. Givenullto empty the value.- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the type defined by the model doesn't match the given value to setBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setExternalValue
void setExternalValue(String dataPath, Object externalValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Sets the external value of the data at the given path- Parameters:
dataPath- path of the externalizable dataexternalValue- the external value to set. Givenullto empty the value.- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the type defined by the model doesn't match the given value to setBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setStatus
void setStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Set the status of the data at the given path- Parameters:
dataPath- path of the externalizable datastatus- the new status- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the type defined by the model doesn't match the given value to setBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeValue
void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Removes the stored value of the data at the given path- Specified by:
removeValuein interfaceModifiableDataHolder- Parameters:
dataPath- path of the data- Throws:
UndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the value of the parent of the given path is not an item container
-
removeLocalValue
void removeLocalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException
Removes the local value of the data at the given path- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- if the value at the given data path does not existUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the value of the parent of the given path is not an item containerBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeExternalValue
void removeExternalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException
Removes the external value of the data at the given path- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- if the value at the given data path does not existUndefinedItemPathException- if the given data path is not defined by the modelBadItemTypeException- if the value of the parent of the given path is not an item containerBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
-