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 awareAmetysObject
that 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 ModifiableModelAwareComposite
getComposite(String compositePath)
Retrieves the composite at the given pathdefault ModifiableModelAwareComposite
getComposite(String compositePath, boolean createNew)
Retrieves the composite at the given pathModifiableModelAwareDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.default ModifiableModelAwareComposite
getExternalComposite(String compositePath)
Retrieves the external composite at the given pathdefault ModifiableModelAwareComposite
getExternalComposite(String compositePath, boolean createNew)
Retrieves the external composite at the given pathdefault ModifiableModelAwareRepeater
getExternalRepeater(String repeaterPath)
Retrieves the external repeater at the given pathdefault ModifiableModelAwareRepeater
getExternalRepeater(String repeaterPath, boolean createNew)
Retrieves the external repeater at the given pathdefault ModifiableModelAwareComposite
getLocalComposite(String compositePath)
Retrieves the local composite at the given pathdefault ModifiableModelAwareComposite
getLocalComposite(String compositePath, boolean createNew)
Retrieves the local composite at the given pathdefault ModifiableModelAwareRepeater
getLocalRepeater(String repeaterPath)
Retrieves the local repeater at the given pathdefault ModifiableModelAwareRepeater
getLocalRepeater(String repeaterPath, boolean createNew)
Retrieves the local repeater at the given pathdefault ModifiableModelAwareRepeater
getRepeater(String repeaterPath)
Retrieves the repeater at the given pathdefault ModifiableModelAwareRepeater
getRepeater(String repeaterPath, boolean createNew)
Retrieves the repeater at the given pathdefault ModifiableRepositoryData
getRepositoryData()
Retrieves the repository data used by thisDataHolder
default void
removeExternalValue(String dataPath)
Removes the external value of the data at the given pathdefault void
removeLocalValue(String dataPath)
Removes the local value of the data at the given pathdefault void
removeValue(String dataPath)
Removes the stored value of the data at the given pathdefault void
setExternalValue(String dataPath, Object externalValue)
Sets the external value of the data at the given pathdefault void
setLocalValue(String dataPath, Object localValue)
Sets the local value of the data at the given pathdefault void
setStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status)
Set the status of the data at the given pathdefault void
setValue(String dataPath, Object value)
Sets the value of the data at the given pathdefault boolean
synchronizeValues(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 boolean
synchronizeValues(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:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getComposite
default ModifiableModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:DataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataHolder
- Specified by:
getComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getComposite
in interfaceModelAwareDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the composite to retrieve- Returns:
- the composite or
null
if 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:ModelAwareDataHolder
Retrieves the local composite at the given path- Specified by:
getLocalComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getLocalComposite
in interfaceModelAwareDataHolder
- Specified by:
getLocalComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrieve- Returns:
- the composite or
null
if 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:ModelAwareDataHolder
Retrieves the external composite at the given path- Specified by:
getExternalComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getExternalComposite
in interfaceModelAwareDataHolder
- Specified by:
getExternalComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrieve- Returns:
- the composite or
null
if 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:ModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getRepeater
in interfaceModelAwareDataHolder
- Specified by:
getRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the repeater to retrieve- Returns:
- the repeater or
null
if 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:ModelAwareDataHolder
Retrieves the local repeater at the given path- Specified by:
getLocalRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getLocalRepeater
in interfaceModelAwareDataHolder
- Specified by:
getLocalRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrieve- Returns:
- the repeater or
null
if 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:ModelAwareDataHolder
Retrieves the external repeater at the given path- Specified by:
getExternalRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getExternalRepeater
in interfaceModelAwareDataHolder
- Specified by:
getExternalRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrieve- Returns:
- the repeater or
null
if 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:ModifiableModelAwareDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the composite to retrievecreateNew
-true
to create the composite if it does not exist,false
otherwise- Returns:
- the composite or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Retrieves the local composite at the given path- Specified by:
getLocalComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrievecreateNew
-true
to create the composite if it does not exist,false
otherwise- Returns:
- the composite or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Retrieves the external composite at the given path- Specified by:
getExternalComposite
in interfaceModifiableModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrievecreateNew
-true
to create the composite if it does not exist,false
otherwise- Returns:
- the composite or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the repeater to retrievecreateNew
-true
to create the repeater if it does not exist,false
otherwise- Returns:
- the repeater or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Retrieves the local repeater at the given path- Specified by:
getLocalRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrievecreateNew
-true
to create the repeater if it does not exist,false
otherwise- Returns:
- the repeater or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Retrieves the external repeater at the given path- Specified by:
getExternalRepeater
in interfaceModifiableModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrievecreateNew
-true
to create the repeater if it does not exist,false
otherwise- Returns:
- the repeater or
null
if createNew isfalse
and 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:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Parameters:
values
- the values to synchronizeexternalizableDataProviderEP
- the extrernalizable data provider extension pointuseDefaultFromModel
-true
to use default values from the model if there is no value in theMap
for an item present in the view- Returns:
true
if some values have changed,false
otherwise- 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:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Parameters:
viewItemContainer
- TheViewItemContainer
containing all items to synchronizevalues
- the values to synchronizeexternalizableDataProviderEP
- the extrernalizable data provider extension pointuseDefaultFromModel
-true
to use default values from the model if there is no value in theMap
for an item present in the view- Returns:
true
if some values have changed,false
otherwise- 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:ModifiableModelAwareDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelAwareDataHolder
- Parameters:
dataPath
- path of the datavalue
- the value to set. Givenull
to 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:ModifiableModelAwareDataHolder
Sets the local value of the data at the given path- Specified by:
setLocalValue
in interfaceModifiableModelAwareDataHolder
- Parameters:
dataPath
- path of the externalizable datalocalValue
- the local value to set. Givenull
to 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:ModifiableModelAwareDataHolder
Sets the external value of the data at the given path- Specified by:
setExternalValue
in interfaceModifiableModelAwareDataHolder
- Parameters:
dataPath
- path of the externalizable dataexternalValue
- the external value to set. Givenull
to 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:ModifiableModelAwareDataHolder
Set the status of the data at the given path- Specified by:
setStatus
in 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:ModifiableModelAwareDataHolder
Removes the stored value of the data at the given path- Specified by:
removeValue
in interfaceModifiableDataHolder
- Specified by:
removeValue
in 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:ModifiableModelAwareDataHolder
Removes the local value of the data at the given path- Specified by:
removeLocalValue
in 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:ModifiableModelAwareDataHolder
Removes the external value of the data at the given path- Specified by:
removeExternalValue
in 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:DataHolder
Retrieves the repository data used by thisDataHolder
- Specified by:
getRepositoryData
in interfaceDataAwareAmetysObject
- Specified by:
getRepositoryData
in interfaceDataHolder
- Specified by:
getRepositoryData
in interfaceModifiableDataHolder
- Returns:
- the repository data used by this
DataHolder
-
-