Interface ModifiableModelAwareDataHolder
- All Superinterfaces:
DataHolder,ModelAwareDataHolder,ModifiableDataHolder
- All Known Subinterfaces:
CalendarResource,CommentableContent,ContributorCommentableContent,ModelAwareJCRAmetysObject,ModelAwareJCRAmetysObject,ModifiableCalendarEvent,ModifiableContent,ModifiableIndexableComposite,ModifiableIndexableDataHolder,ModifiableIndexableRepeaterEntry,ModifiableModelAwareComposite,ModifiableModelAwareDataAwareAmetysObject,ModifiableModelAwareDataAwareAmetysObject,ModifiableModelAwareRepeaterEntry,ModifiableWebContent,ModifiableWorkflowAwareContent,ProgramPart,SharedContent,Task,TasksList,Thread,TrashElement,TraversableProgramPart
- All Known Implementing Classes:
AbstractProgram,AbstractProgramPart,AbstractTraversableProgramPart,Cart,Catalog,Container,ContentBackupAmetysObject,ContentConsistencyResult,ContentValue,Course,CourseList,CoursePart,DefaultModifiableModelAwareComposite,DefaultModifiableModelAwareDataHolder,DefaultModifiableModelAwareRepeaterEntry,DefaultSharedContent,DefaultTrashElement,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, 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 currentDataHolderThere can be no parent if the currentDataHolderis the rootgetRepeater(String repeaterPath) Retrieves the repeater at the given pathgetRepeater(String repeaterPath, boolean createNew) Retrieves the repeater at the given pathRetrieves theDataHolderthat is the root of the current onevoidremoveExternalizableMetadataIfExists(String dataPath) Removes the stored metadata (status and alternative value) for externalizable (or ex-externalizable) datavoidremoveExternalValue(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 pathvoidSets 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, dataToSAXMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasDefinition, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty, isMultipleMethods 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: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
<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- TheViewItemAccessorfor 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- TheViewItemAccessorfor 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. 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 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
-
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, 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:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Specified by:
getParentDataHolderin interfaceModifiableDataHolder- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Returns:
- the root
DataHolder
-