Interface ModifiableModelAwareDataHolder
- All Superinterfaces:
DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
- All Known Subinterfaces:
CalendarResource
,CommentableContent
,ContributorCommentableContent
,ModelAwareJCRAmetysObject
,ModelAwareJCRAmetysObject
,ModifiableCalendar
,ModifiableCalendarEvent
,ModifiableContent
,ModifiableIndexableComposite
,ModifiableIndexableDataHolder
,ModifiableIndexableRepeaterEntry
,ModifiableModelAwareComposite
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareRepeaterEntry
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,ProgramPart
,SharedContent
,Task
,TasksList
,Thread
,TraversableProgramPart
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractTraversableProgramPart
,Cart
,Catalog
,Container
,ContentBackupAmetysObject
,ContentConsistencyResult
,ContentValue
,Course
,CourseList
,CoursePart
,DefaultModifiableModelAwareComposite
,DefaultModifiableModelAwareDataHolder
,DefaultModifiableModelAwareRepeaterEntry
,DefaultSharedContent
,Form
,FormEntry
,FormPageRule
,FormQuestion
,JCRCalendar
,JCRCalendarEvent
,JCRCalendarResource
,JCRTask
,JCRTasksList
,JCRThread
,ModifiableContentDataHolder
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,Query
,Site
,SubProgram
Interface for modifiable data containers with models
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Method Summary
Modifier and TypeMethodDescriptiongetComposite
(String compositePath) Retrieves the composite at the given pathgetComposite
(String compositePath, boolean createNew) Retrieves the composite at the given pathgetExternalComposite
(String compositePath) Retrieves the external composite at the given pathgetExternalComposite
(String compositePath, boolean createNew) Retrieves the external composite at the given pathgetExternalRepeater
(String repeaterPath) Retrieves the external repeater at the given pathgetExternalRepeater
(String repeaterPath, boolean createNew) Retrieves the external repeater at the given pathgetLocalComposite
(String compositePath) Retrieves the local composite at the given pathgetLocalComposite
(String compositePath, boolean createNew) Retrieves the local composite at the given pathgetLocalRepeater
(String repeaterPath) Retrieves the local repeater at the given pathgetLocalRepeater
(String repeaterPath, boolean createNew) Retrieves the local repeater at the given pathOptional<? extends ModifiableModelAwareDataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootgetRepeater
(String repeaterPath) Retrieves the repeater at the given pathgetRepeater
(String repeaterPath, boolean createNew) Retrieves the repeater at the given pathRetrieves theDataHolder
that is the root of the current onevoid
removeExternalizableMetadataIfExists
(String dataPath) Removes the stored metadata (status and alternative value) for externalizable (or ex-externalizable) datavoid
removeExternalValue
(String dataPath) Removes the external value of the data at the given pathvoid
removeLocalValue
(String dataPath) Removes the local value of the data at the given pathvoid
removeValue
(String dataPath) Removes the stored value of the data at the given pathvoid
setComments
(String dataName, List<DataComment> comments) Set the comments of the data with the given namevoid
setExternalValue
(String dataPath, Object externalValue) Sets the external value of the data at the given pathvoid
setLocalValue
(String dataPath, Object localValue) Sets the local value of the data at the given pathvoid
setStatus
(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) Set the status of the data at the given pathvoid
Sets the value of the data at the given path<T extends SynchronizationResult>
TsynchronizeValues
(Map<String, Object> values) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues
(Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues
(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues
(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the currentModifiableModelAwareDataHolder
's onesMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasComments, hasDefinition, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty, isMultiple
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
-
Method Details
-
getComposite
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 interfaceModelAwareDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- 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
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 interfaceModelAwareDataHolder
- 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
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 interfaceModelAwareDataHolder
- 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
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 interfaceModelAwareDataHolder
- 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
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 interfaceModelAwareDataHolder
- 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
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 interfaceModelAwareDataHolder
- 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
ModifiableModelAwareComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the composite at the given path- Specified by:
getComposite
in interfaceModifiableDataHolder
- 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:
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
-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 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
-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 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
-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 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
-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 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
-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 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
<T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values) throws UndefinedItemPathException, BadItemTypeExceptionSynchronizes the given values with the current ones- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
values
- the values to synchronize- Returns:
- the
SynchronizationResult
- 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 value
-
synchronizeValues
<T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeExceptionSynchronizes the given values with the current ones- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
values
- the values to synchronizecontext
- the context of the synchronization- Returns:
- the
SynchronizationResult
- 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 value
-
synchronizeValues
<T extends SynchronizationResult> T synchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws UndefinedItemPathException, BadItemTypeExceptionSynchronizes the given values with the current ones- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
viewItemAccessor
- TheViewItemAccessor
for all items to synchronizevalues
- the values to synchronize- Returns:
- the
SynchronizationResult
- 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 value
-
synchronizeValues
<T extends SynchronizationResult> T synchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeExceptionSynchronizes the given values with the currentModifiableModelAwareDataHolder
's ones- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
viewItemAccessor
- TheViewItemAccessor
for all items to synchronizevalues
- the values to synchronizecontext
- the context of the synchronization- Returns:
- the
SynchronizationResult
- 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 value
-
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. 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
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. 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
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. 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
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 there is a type issue while getting the parent (part of the dataPath without the last segment)BadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setComments
void setComments(String dataName, List<DataComment> comments) throws IllegalArgumentException, UndefinedItemPathException Set the comments of the data with the given name- Parameters:
dataName
- name of the datacomments
- the comments to set- Throws:
IllegalArgumentException
- if the given data name is null or emptyUndefinedItemPathException
- if the given data name is not defined by the model
-
removeValue
void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Removes the stored value of the data at the given path- Specified by:
removeValue
in 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, 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 emptyUndefinedItemPathException
- 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, 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 emptyUndefinedItemPathException
- 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
-
removeExternalizableMetadataIfExists
void removeExternalizableMetadataIfExists(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Removes the stored metadata (status and alternative value) for externalizable (or ex-externalizable) data- Parameters:
dataPath
- path of the data- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadItemTypeException
- if the value of the parent of the given path is not an item containerUndefinedItemPathException
- 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 multiple
-
getParentDataHolder
Optional<? extends ModifiableModelAwareDataHolder> getParentDataHolder()Description copied from interface:DataHolder
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the root- Specified by:
getParentDataHolder
in interfaceDataHolder
- Specified by:
getParentDataHolder
in interfaceModelAwareDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableDataHolder
- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolder
Retrieves theDataHolder
that is the root of the current one- Specified by:
getRootDataHolder
in interfaceDataHolder
- Specified by:
getRootDataHolder
in interfaceModelAwareDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableDataHolder
- Returns:
- the root
DataHolder
-