Interface ModifiableModelLessDataAwareAmetysObject
- All Superinterfaces:
AmetysObject
,DataAwareAmetysObject
,DataHolder
,ModelLessDataAwareAmetysObject
,ModelLessDataHolder
,ModifiableAmetysObject
,ModifiableDataHolder
,ModifiableModelLessDataHolder
- All Known Subinterfaces:
ModelLessJCRAmetysObject
,ModifiablePage
,ModifiableZone
,ModifiableZoneItem
- All Known Implementing Classes:
AbstractSitemapElement
,AbstractSurveyElement
,Activity
,CMISRootResourcesCollection
,DefaultLink
,DefaultPage
,DefaultZone
,DefaultZoneItem
,JCRProjectMember
,JCRResourcesCollection
,Project
,Sitemap
,Survey
,SurveyPage
,SurveyQuestion
public interface ModifiableModelLessDataAwareAmetysObject
extends ModifiableModelLessDataHolder, ModelLessDataAwareAmetysObject, ModifiableAmetysObject
Model less
AmetysObject
that can handle modifiable data.-
Method Summary
Modifier and TypeMethodDescriptiondefault ModifiableModelLessComposite
getComposite
(String compositePath) Retrieves the composite at the given pathdefault ModifiableModelLessComposite
getComposite
(String compositePath, boolean createNew) Retrieves the composite at the given pathReturns theDataHolder
of thisAmetysObject
.default Optional<? extends ModifiableModelLessDataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootdefault ModifiableRepositoryData
Retrieves the repository data used by thisDataHolder
default ModifiableModelLessDataHolder
Retrieves theDataHolder
that is the root of the current onedefault void
removeValue
(String dataPath) Removes the stored value of the data at the given pathdefault void
Sets the value of the data at the given pathdefault void
Sets the value of the data at the given pathdefault boolean
synchronizeValues
(Map<String, Object> values) Synchronizes the given values with the current onesMethods 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, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToJSON, dataToSAX, getModelItemTypeExtensionPoint, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValueOrEmpty, isMultiple
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Method Details
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getComposite
default ModifiableModelLessComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:DataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataAwareAmetysObject
- Specified by:
getComposite
in interfaceDataHolder
- Specified by:
getComposite
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getComposite
in interfaceModelLessDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelLessDataHolder
- 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 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
default ModifiableModelLessComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelLessDataHolder
- 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 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
-
synchronizeValues
default boolean synchronizeValues(Map<String, Object> values) throws UnknownTypeException, NotUniqueTypeExceptionDescription copied from interface:ModifiableModelLessDataHolder
Synchronizes the given values with the current ones- Specified by:
synchronizeValues
in interfaceModifiableModelLessDataHolder
- Parameters:
values
- the values to synchronize- Returns:
true
if some values have changed,false
otherwise- 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
default void setValue(String dataPath, Object value) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, UnknownDataException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelLessDataHolder
- Parameters:
dataPath
- path of the datavalue
- the value to set. To empty a value, useModifiableModelLessDataHolder.setValue(String, Object, String)
with anull
value- 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
default void setValue(String dataPath, Object value, String dataType) throws IllegalArgumentException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelLessDataHolder
- Parameters:
dataPath
- path of the datavalue
- the value to set. Givenull
to empty the value.dataType
- type identifier of the data- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadItemTypeException
- 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
default void removeValue(String dataPath) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Removes the stored value of the data at the given path- Specified by:
removeValue
in interfaceModifiableDataHolder
- Specified by:
removeValue
in interfaceModifiableModelLessDataHolder
- 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 containerBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multipleUnknownTypeException
-
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
-
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 interfaceDataAwareAmetysObject
- Specified by:
getParentDataHolder
in interfaceDataHolder
- Specified by:
getParentDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getParentDataHolder
in interfaceModelLessDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableModelLessDataHolder
- 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 interfaceDataAwareAmetysObject
- Specified by:
getRootDataHolder
in interfaceDataHolder
- Specified by:
getRootDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getRootDataHolder
in interfaceModelLessDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableModelLessDataHolder
- Returns:
- the root
DataHolder
-