Interface ModifiableModelAwareDataHolder
-
- All Superinterfaces:
DataHolder,ModelAwareDataHolder,ModifiableDataHolder
- All Known Subinterfaces:
CalendarResource,CommentableContent,ModelAwareJCRAmetysObject,ModifiableCalendar,ModifiableCalendarEvent,ModifiableContent,ModifiableModelAwareDataAwareAmetysObject,ModifiableWebContent,ModifiableWorkflowAwareContent,ProgramPart,Task,TasksList,TraversableProgramPart
- All Known Implementing Classes:
AbstractProgram,AbstractProgramPart,AbstractTraversableProgramPart,Cart,Catalog,Container,ContentBackupAmetysObject,ContentValue,Course,CourseList,CoursePart,DefaultModifiableModelAwareDataHolder,JCRCalendar,JCRCalendarEvent,JCRCalendarResource,JCRTask,JCRTasksList,ModifiableContentDataHolder,ModifiableDefaultContent,ModifiableDefaultWebContent,ModifiableModelAwareComposite,ModifiableModelAwareRepeaterEntry,OrgUnit,Person,Program,Query,Site,SubProgram
public interface ModifiableModelAwareDataHolder extends ModifiableDataHolder, ModelAwareDataHolder
Interface for modifiable data containers with models
-
-
Field Summary
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ModifiableModelAwareCompositegetComposite(String compositePath)Retrieves the composite at the given pathModifiableModelAwareCompositegetComposite(String compositePath, boolean createNew)Retrieves the composite at the given pathModifiableModelAwareCompositegetExternalComposite(String compositePath)Retrieves the external composite at the given pathModifiableModelAwareCompositegetExternalComposite(String compositePath, boolean createNew)Retrieves the external composite at the given pathModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath)Retrieves the external repeater at the given pathModifiableModelAwareRepeatergetExternalRepeater(String repeaterPath, boolean createNew)Retrieves the external repeater at the given pathModifiableModelAwareCompositegetLocalComposite(String compositePath)Retrieves the local composite at the given pathModifiableModelAwareCompositegetLocalComposite(String compositePath, boolean createNew)Retrieves the local composite at the given pathModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath)Retrieves the local repeater at the given pathModifiableModelAwareRepeatergetLocalRepeater(String repeaterPath, boolean createNew)Retrieves the local repeater at the given pathOptional<? extends ModifiableModelAwareDataHolder>getParentDataHolder()Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootModifiableModelAwareRepeatergetRepeater(String repeaterPath)Retrieves the repeater at the given pathModifiableModelAwareRepeatergetRepeater(String repeaterPath, boolean createNew)Retrieves the repeater at the given pathModifiableModelAwareDataHoldergetRootDataHolder()Retrieves 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 pathvoidsetComments(String dataName, List<DataComment> comments)Set the comments of the data with the given namevoidsetExternalValue(String dataPath, Object externalValue)Sets the external value of the data at the given pathvoidsetLocalValue(String dataPath, Object localValue)Sets the local value of the data at the given pathvoidsetStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status)Set the status of the data at the given pathvoidsetValue(String dataPath, Object value)Sets the value of the data at the given 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(ViewItemContainer viewItemContainer, Map<String,Object> values)Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, SynchronizationContext context)Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
-
-
-
-
Method Detail
-
getComposite
ModifiableModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
ModifiableModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
ModifiableModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUndefinedItemPathException- if the given composite path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
ModifiableModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyUndefinedItemPathException- if the given repeater path is not defined by the modelBadItemTypeException- if the stored value at the given path is not a repeaterBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
ModifiableModelAwareComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
UndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a composite
-
getLocalComposite
ModifiableModelAwareComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the local composite at the given path- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
ModifiableModelAwareComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the external composite at the given path- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
ModifiableModelAwareRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the repeater at the given path- Parameters:
repeaterPath- path of the repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
ModifiableModelAwareRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the local repeater at the given path- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
ModifiableModelAwareRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Retrieves the external repeater at the given path- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
synchronizeValues
<T extends SynchronizationResult> T synchronizeValues(Map<String,Object> values) throws UndefinedItemPathException, BadItemTypeException
Synchronizes 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, BadItemTypeException
Synchronizes 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(ViewItemContainer viewItemContainer, Map<String,Object> values) throws UndefinedItemPathException, BadItemTypeException
Synchronizes the given values with the current ones- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemContainer- TheViewItemContainercontaining 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(ViewItemContainer viewItemContainer, Map<String,Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeException
Synchronizes the given values with the currentModifiableModelAwareDataHolder's ones- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemContainer- TheViewItemContainercontaining 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
-
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:
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
ModifiableModelAwareDataHolder 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
-
-