Interface ModifiableModelAwareDataAwareAmetysObject
-
- All Superinterfaces:
AmetysObject,DataAwareAmetysObject,DataHolder,ModelAwareDataAwareAmetysObject,ModelAwareDataHolder,ModifiableDataHolder,ModifiableModelAwareDataHolder
- All Known Subinterfaces:
CommentableContent,ModelAwareJCRAmetysObject,ModifiableContent,ModifiableWebContent,ModifiableWorkflowAwareContent,ProgramPart,TraversableProgramPart
- All Known Implementing Classes:
AbstractProgram,AbstractProgramPart,AbstractTraversableProgramPart,Catalog,Container,ContentBackupAmetysObject,Course,CourseList,CoursePart,ModifiableDefaultContent,ModifiableDefaultWebContent,OrgUnit,Person,Program,Site,SubProgram
public interface ModifiableModelAwareDataAwareAmetysObject extends ModelAwareDataAwareAmetysObject, ModifiableModelAwareDataHolder
Model awareAmetysObjectthat can handle modifiable data.
-
-
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 default ModifiableModelAwareCompositegetComposite(String compositePath)Retrieves the composite at the given pathdefault ModifiableModelAwareCompositegetComposite(String compositePath, boolean createNew)Retrieves the composite at the given pathModifiableModelAwareDataHoldergetDataHolder()Returns theDataHolderof thisAmetysObject.default ModifiableModelAwareCompositegetExternalComposite(String compositePath)Retrieves the external composite at the given pathdefault ModifiableModelAwareCompositegetExternalComposite(String compositePath, boolean createNew)Retrieves the external composite at the given pathdefault ModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath)Retrieves the external repeater at the given pathdefault ModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath, boolean createNew)Retrieves the external repeater at the given pathdefault ModifiableModelAwareCompositegetLocalComposite(String compositePath)Retrieves the local composite at the given pathdefault ModifiableModelAwareCompositegetLocalComposite(String compositePath, boolean createNew)Retrieves the local composite at the given pathdefault ModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath)Retrieves the local repeater at the given pathdefault ModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath, boolean createNew)Retrieves the local repeater at the given pathdefault ModifiableModelAwareRepeatergetRepeater(String repeaterPath)Retrieves the repeater at the given pathdefault ModifiableModelAwareRepeatergetRepeater(String repeaterPath, boolean createNew)Retrieves the repeater at the given pathdefault ModifiableRepositoryDatagetRepositoryData()Retrieves the repository data used by thisDataHolderdefault voidremoveExternalValue(String dataPath)Removes the external value of the data at the given pathdefault voidremoveLocalValue(String dataPath)Removes the local value of the data at the given pathdefault voidremoveValue(String dataPath)Removes the stored value of the data at the given pathdefault voidsetExternalValue(String dataPath, Object externalValue)Sets the external value of the data at the given pathdefault voidsetLocalValue(String dataPath, Object localValue)Sets the local value of the data at the given pathdefault voidsetStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status)Set the status of the data at the given pathdefault voidsetValue(String dataPath, Object value)Sets the value of the data at the given pathdefault booleansynchronizeValues(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, 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.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToSAX, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasExternalValue, hasLocalValue, hasValue
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder
synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
-
-
-
Method Detail
-
getDataHolder
ModifiableModelAwareDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
getComposite
default 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 interfaceModelAwareDataAwareAmetysObject- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModelAwareDataAwareAmetysObject- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModelAwareDataAwareAmetysObject- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModelAwareDataAwareAmetysObject- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModelAwareDataAwareAmetysObject- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModelAwareDataAwareAmetysObject- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- 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
default ModifiableModelAwareComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- 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:
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
default ModifiableModelAwareComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- 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 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
default ModifiableModelAwareComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- 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 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
default ModifiableModelAwareRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- 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 emptyUndefinedItemPathException- if the given composite 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
default ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- 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 emptyUndefinedItemPathException- if the given composite 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
default ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- 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 emptyUndefinedItemPathException- if the given composite 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
-
synchronizeValues
default boolean synchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Description copied from interface:ModifiableModelAwareDataHolderSynchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValuesin interfaceModifiableModelAwareDataHolder- 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, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Description copied from interface:ModifiableModelAwareDataHolderSynchronizes the given values with the currentModifiableModelAwareDataHolder's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValuesin interfaceModifiableModelAwareDataHolder- 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
default void setValue(String dataPath, Object value) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderSets the value of the data at the given path- Specified by:
setValuein interfaceModifiableModelAwareDataHolder- 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
default void setLocalValue(String dataPath, Object localValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderSets the local value of the data at the given path- Specified by:
setLocalValuein interfaceModifiableModelAwareDataHolder- 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
default void setExternalValue(String dataPath, Object externalValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderSets the external value of the data at the given path- Specified by:
setExternalValuein interfaceModifiableModelAwareDataHolder- 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
default void setStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderSet the status of the data at the given path- Specified by:
setStatusin interfaceModifiableModelAwareDataHolder- 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
default void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, UnknownDataException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRemoves the stored value of the data at the given path- Specified by:
removeValuein interfaceModifiableDataHolder- Specified by:
removeValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelUnknownDataException- if the value at the given data path does not existBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeLocalValue
default void removeLocalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, UnknownDataException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRemoves the local value of the data at the given path- Specified by:
removeLocalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelUnknownDataException- if the value at the given data path does not existBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeExternalValue
default void removeExternalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, UnknownDataException, BadDataPathCardinalityException
Description copied from interface:ModifiableModelAwareDataHolderRemoves the external value of the data at the given path- Specified by:
removeExternalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the given data path is not defined by the modelUnknownDataException- if the value at the given data path does not existBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepositoryData
default ModifiableRepositoryData getRepositoryData()
Description copied from interface:DataHolderRetrieves the repository data used by thisDataHolder- Specified by:
getRepositoryDatain interfaceDataAwareAmetysObject- Specified by:
getRepositoryDatain interfaceDataHolder- Specified by:
getRepositoryDatain interfaceModifiableDataHolder- Returns:
- the repository data used by this
DataHolder
-
-