Interface ModifiableModelLessDataHolder
- All Superinterfaces:
DataHolder,ModelLessDataHolder,ModifiableDataHolder
- All Known Subinterfaces:
ModelLessJCRAmetysObject,ModifiableModelLessComposite,ModifiableModelLessDataAwareAmetysObject,ModifiablePage,ModifiableZone,ModifiableZoneItem
- All Known Implementing Classes:
AbstractSitemapElement,AbstractSurveyElement,Activity,CMISRootResourcesCollection,DefaultLink,DefaultModifiableModelLessComposite,DefaultModifiableModelLessDataHolder,DefaultPage,DefaultZone,DefaultZoneItem,JCRProjectMember,JCRResourcesCollection,Project,Sitemap,Survey,SurveyPage,SurveyQuestion
Interface for modifiable data containers without models
-
Method Summary
Modifier and TypeMethodDescriptiongetComposite(String compositePath) Retrieves the composite at the given pathgetComposite(String compositePath, boolean createNew) Retrieves the composite at the given pathOptional<? extends ModifiableModelLessDataHolder>Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootRetrieves theDataHolderthat is the root of the current onevoidremoveValue(String dataPath) Removes the stored value of the data at the given pathvoidSets the value of the data at the given pathvoidSets the value of the data at the given pathbooleansynchronizeValues(Map<String, Object> values) Synchronizes the given values with the current onesMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNamesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToJSON, dataToSAX, dataToSAX, getModelItemTypeExtensionPoint, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
-
Method Details
-
getComposite
ModifiableModelLessComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModelLessDataHolder- 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 emptyBadItemTypeException- if the stored value at the given path is not a compositeBadDataPathCardinalityException- if the value of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
ModifiableModelLessComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, 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:
BadDataPathCardinalityException- if the value 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
-
synchronizeValues
boolean synchronizeValues(Map<String, Object> values) throws UnknownTypeException, NotUniqueTypeExceptionSynchronizes the given values with the current ones- Parameters:
values- the values to synchronize- Returns:
trueif some values have changed,falseotherwise- Throws:
UnknownTypeException- if there is no available type compatible with a given value for this data holder's type extension pointNotUniqueTypeException- if there is more than one available types compatibles with the a value for this data holder's type extension point
-
setValue
void setValue(String dataPath, Object value) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, UnknownDataException, BadDataPathCardinalityException Sets the value of the data at the given path- Parameters:
dataPath- path of the datavalue- the value to set. To empty a value, usesetValue(String, Object, String)with anullvalue- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownTypeException- if there is no available type compatible with the given value for this data holder's type extension pointNotUniqueTypeException- if there is more than one available types compatibles with the given value for this data holder's type extension pointUnknownDataException- if given the data path is composed of an inexisting groupBadDataPathCardinalityException- if the value of a part of the data path is multiple. Only the last part can be multiple
-
setValue
void setValue(String dataPath, Object value, String dataTypeId) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UnknownDataException, 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.dataTypeId- type identifier of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownTypeException- if the given type is not available for this data holder's type extension pointBadItemTypeException- if the given type doesn't match the given value to setUnknownDataException- if the given data path is composed of an inexisting groupBadDataPathCardinalityException- if the value of a part of the data path is multiple. Only the last part can be multiple
-
removeValue
void removeValue(String dataPath) throws IllegalArgumentException, UnknownDataException, BadItemTypeException, BadDataPathCardinalityException Removes the stored value of the data at the given path- Specified by:
removeValuein interfaceModifiableDataHolder- Parameters:
dataPath- path of the data- Throws:
BadDataPathCardinalityException- if the value 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 containerUnknownDataException
-
getParentDataHolder
Optional<? extends ModifiableModelLessDataHolder> 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 interfaceModelLessDataHolder- 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 interfaceModelLessDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Returns:
- the root
DataHolder
-