Package org.ametys.cms.data.holder.impl
Class DefaultModifiableModelAwareDataHolder
java.lang.Object
org.ametys.cms.data.holder.impl.DefaultModelAwareDataHolder
org.ametys.cms.data.holder.impl.DefaultModifiableModelAwareDataHolder
- All Implemented Interfaces:
IndexableDataHolder
,ModifiableIndexableDataHolder
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
- Direct Known Subclasses:
ModifiableContentDataHolder
public class DefaultModifiableModelAwareDataHolder
extends DefaultModelAwareDataHolder
implements ModifiableIndexableDataHolder
Default implementation for modifiable data holder with model
-
Field Summary
Modifier and TypeFieldDescriptionprotected Optional<? extends ModifiableIndexableDataHolder>
Parent of the currentDataHolder
protected ModifiableRepositoryData
Repository data to use to store data in the repositoryprotected ModifiableIndexableDataHolder
RootDataHolder
Fields inherited from class org.ametys.cms.data.holder.impl.DefaultModelAwareDataHolder
_itemContainers, _parent, _repositoryData, _root
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Constructor Summary
ConstructorDescriptionDefaultModifiableModelAwareDataHolder
(ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable default model aware data holderDefaultModifiableModelAwareDataHolder
(ModifiableRepositoryData repositoryData, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable default model aware data holderDefaultModifiableModelAwareDataHolder
(ModifiableRepositoryData repositoryData, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root, ModelItemContainer... itemContainers) Creates a modifiable default model aware data holderDefaultModifiableModelAwareDataHolder
(ModifiableRepositoryData repositoryData, ModelItemContainer... itemContainers) Creates a modifiable default model aware data holder -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_checkModifiableDefinition
(String dataPath, String errorMsg) Check definition for data path, for modification methodsprotected <T extends SynchronizationResult>
TCreates an instance ofSynchronizationResult
protected <T extends SynchronizationContext>
TCreates an instance ofSynchronizationContext
protected ModifiableIndexableComposite
_getComposite
(String name, CompositeDefinition compositeDefinition) Retrieves the composite with the given nameprotected ModifiableIndexableComposite
_getComposite
(String name, CompositeDefinition compositeDefinition, boolean createNew) Retrieves the composite with the given nameprotected Class
Retrieves the class of the managed compositesprotected ModifiableIndexableRepeater
_getRepeater
(String name, RepeaterDefinition repeaterDefinition) Retrieves the repeater with the given nameprotected ModifiableIndexableRepeater
_getRepeater
(String name, RepeaterDefinition repeaterDefinition, boolean createNew) Retrieves the repeater with the given nameprotected Class
Retrieves the class of the managed repeatersprotected Class
Retrieves the class of the managed repeater entriesprotected void
_removeValue
(String dataPath, ValueContext context) Removes the stored value of the data at the given pathprotected <T extends SynchronizationResult>
T_removeValueForSynchronize
(String dataName, ValueContext context) Removes the stored value of the data with the given nameprotected void
_setValue
(String dataPath, Object value, ValueContext context) Sets the value of the data at the given pathprotected <T extends SynchronizationResult>
T_setValueForSynchronize
(String dataName, SynchronizableValue value, ValueContext context) Sets the value of the data with the given nameprotected boolean
_updateStatusForSynchronize
(String dataName, SynchronizableValue value, ValueContext context, boolean forceStatus, boolean doValuesContainData) Updates the status of the data with the given namegetComposite
(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 ModifiableIndexableDataHolder>
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 the repository data used by thisDataHolder
Retrieves 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
(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 onesMethods inherited from class org.ametys.cms.data.holder.impl.DefaultModelAwareDataHolder
_checkDefinition, _checkDefinition, _getFinalDataName, _getPropertysAmetysObject, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
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, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty, isMultiple
-
Field Details
-
_modifiableRepositoryData
Repository data to use to store data in the repository -
_modifiableParent
Parent of the currentDataHolder
-
_modifiableRoot
RootDataHolder
-
-
Constructor Details
-
DefaultModifiableModelAwareDataHolder
public DefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer... itemContainers) Creates a modifiable default model aware data holder- Parameters:
repositoryData
- the repository data to useitemContainers
- the model containers to use to get information about definitions. Must match the given repository data. A repository data can have several item containers. For example, a content can have several content types.
-
DefaultModifiableModelAwareDataHolder
public DefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable default model aware data holder- Parameters:
repositoryData
- the repository data to useitemContainers
- the model containers to use to get information about definitions. Must match the given repository data. A repository data can have several item containers. For example, a content can have several content types.
-
DefaultModifiableModelAwareDataHolder
public DefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root, ModelItemContainer... itemContainers) Creates a modifiable default model aware data holder- Parameters:
repositoryData
- the repository data to useparent
- the parent of the createdDataHolder
, empty if the createdDataHolder
is the rootDataHolder
root
- the rootDataHolder
itemContainers
- the model containers to use to get information about definitions. Must match the given repository data. A repository data can have several item containers. For example, a content can have several content types.
-
DefaultModifiableModelAwareDataHolder
public DefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable default model aware data holder- Parameters:
repositoryData
- the repository data to useparent
- the parent of the createdDataHolder
, empty if the createdDataHolder
is the rootDataHolder
root
- the rootDataHolder
itemContainers
- the model containers to use to get information about definitions. Must match the given repository data. A repository data can have several item containers. For example, a content can have several content types.
-
-
Method Details
-
getComposite
public ModifiableIndexableComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataHolder
- Specified by:
getComposite
in interfaceIndexableDataHolder
- Specified by:
getComposite
in interfaceModelAwareDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelAwareDataHolder
- Overrides:
getComposite
in classDefaultModelAwareDataHolder
- 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
public ModifiableIndexableComposite 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 interfaceIndexableDataHolder
- Specified by:
getLocalComposite
in interfaceModelAwareDataHolder
- Specified by:
getLocalComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getLocalComposite
in interfaceModifiableModelAwareDataHolder
- Overrides:
getLocalComposite
in classDefaultModelAwareDataHolder
- 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
public ModifiableIndexableComposite 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 interfaceIndexableDataHolder
- Specified by:
getExternalComposite
in interfaceModelAwareDataHolder
- Specified by:
getExternalComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getExternalComposite
in interfaceModifiableModelAwareDataHolder
- Overrides:
getExternalComposite
in classDefaultModelAwareDataHolder
- 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
-
_getComposite
protected ModifiableIndexableComposite _getComposite(String name, CompositeDefinition compositeDefinition) throws BadItemTypeException Description copied from class:DefaultModelAwareDataHolder
Retrieves the composite with the given name- Overrides:
_getComposite
in classDefaultModelAwareDataHolder
- Parameters:
name
- name of the composite to retrievecompositeDefinition
- the definition of the composite to retrieve- Returns:
- the composite
- Throws:
BadItemTypeException
- if the value stored in the repository with the given name is not a composite
-
getRepeater
public ModifiableIndexableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceIndexableDataHolder
- Specified by:
getRepeater
in interfaceModelAwareDataHolder
- Specified by:
getRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getRepeater
in interfaceModifiableModelAwareDataHolder
- Overrides:
getRepeater
in classDefaultModelAwareDataHolder
- 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
public ModifiableIndexableRepeater 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 interfaceIndexableDataHolder
- Specified by:
getLocalRepeater
in interfaceModelAwareDataHolder
- Specified by:
getLocalRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getLocalRepeater
in interfaceModifiableModelAwareDataHolder
- Overrides:
getLocalRepeater
in classDefaultModelAwareDataHolder
- 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
public ModifiableIndexableRepeater 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 interfaceIndexableDataHolder
- Specified by:
getExternalRepeater
in interfaceModelAwareDataHolder
- Specified by:
getExternalRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getExternalRepeater
in interfaceModifiableModelAwareDataHolder
- Overrides:
getExternalRepeater
in classDefaultModelAwareDataHolder
- 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
-
_getRepeater
protected ModifiableIndexableRepeater _getRepeater(String name, RepeaterDefinition repeaterDefinition) throws BadItemTypeException Description copied from class:DefaultModelAwareDataHolder
Retrieves the repeater with the given name- Overrides:
_getRepeater
in classDefaultModelAwareDataHolder
- Parameters:
name
- name of the repeater to retrieverepeaterDefinition
- the definition of the repeater to retrieve- Returns:
- the repeater
- Throws:
BadItemTypeException
- if the value stored in the repository with the given name is not a repeater
-
getComposite
public ModifiableIndexableComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelAwareDataHolder
- 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 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
public ModifiableIndexableComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the local composite at the given path- Specified by:
getLocalComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getLocalComposite
in interfaceModifiableModelAwareDataHolder
- 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 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
public ModifiableIndexableComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the external composite at the given path- Specified by:
getExternalComposite
in interfaceModifiableIndexableDataHolder
- Specified by:
getExternalComposite
in interfaceModifiableModelAwareDataHolder
- 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 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
-
_getComposite
protected ModifiableIndexableComposite _getComposite(String name, CompositeDefinition compositeDefinition, boolean createNew) throws BadItemTypeException Retrieves the composite with the given name- Parameters:
name
- name of the composite to retrievecompositeDefinition
- the definition of the composite to retrievecreateNew
-true
to create the repeater if it does not exist,false
otherwise- Returns:
- the composite
- Throws:
BadItemTypeException
- if the value stored in the repository with the given name is not a composite
-
getRepeater
public ModifiableIndexableRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getRepeater
in interfaceModifiableModelAwareDataHolder
- 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 emptyUndefinedItemPathException
- if the given composite 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
public ModifiableIndexableRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the local repeater at the given path- Specified by:
getLocalRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getLocalRepeater
in interfaceModifiableModelAwareDataHolder
- 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 emptyUndefinedItemPathException
- if the given composite 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
public ModifiableIndexableRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Retrieves the external repeater at the given path- Specified by:
getExternalRepeater
in interfaceModifiableIndexableDataHolder
- Specified by:
getExternalRepeater
in interfaceModifiableModelAwareDataHolder
- 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 emptyUndefinedItemPathException
- if the given composite 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
-
_getRepeater
protected ModifiableIndexableRepeater _getRepeater(String name, RepeaterDefinition repeaterDefinition, boolean createNew) throws BadItemTypeException Retrieves the repeater with the given name- Parameters:
name
- name of the repeater to retrieverepeaterDefinition
- the definition of the repeater to retrievecreateNew
-true
to create the repeater if it does not exist,false
otherwise- Returns:
- the repeater
- Throws:
BadItemTypeException
- if the value stored in the repository with the given name is not a repeater
-
_getRepeaterEntryClass
Description copied from class:DefaultModelAwareDataHolder
Retrieves the class of the managed repeater entries- Overrides:
_getRepeaterEntryClass
in classDefaultModelAwareDataHolder
- Returns:
- the class of the managed repeater entries
-
_getRepeaterClass
Description copied from class:DefaultModelAwareDataHolder
Retrieves the class of the managed repeaters- Overrides:
_getRepeaterClass
in classDefaultModelAwareDataHolder
- Returns:
- the class of the managed repeaters
-
_getCompositeClass
Description copied from class:DefaultModelAwareDataHolder
Retrieves the class of the managed composites- Overrides:
_getCompositeClass
in classDefaultModelAwareDataHolder
- Returns:
- the class of the managed composites
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values) throws UndefinedItemPathException, BadItemTypeExceptionDescription copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the current ones- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- 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
public <T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeExceptionDescription copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the current ones- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- 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
public <T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, Map<String, Object> values) throws UndefinedItemPathException, BadItemTypeExceptionDescription copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the current ones- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
viewItemContainer
- TheViewItemContainer
containing 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
public <T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, Map<String, Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeExceptionDescription copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
viewItemContainer
- TheViewItemContainer
containing 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
-
_updateStatusForSynchronize
protected boolean _updateStatusForSynchronize(String dataName, SynchronizableValue value, ValueContext context, boolean forceStatus, boolean doValuesContainData) Updates the status of the data with the given name- Parameters:
dataName
- name of the datavalue
- the valuecontext
- context of the dataforceStatus
-true
to force the status if it is not present,false
otherwisedoValuesContainData
-true
if the values contain the data,false
otherwise- Returns:
true
if the status has changed,false
otherwise
-
_setValueForSynchronize
protected <T extends SynchronizationResult> T _setValueForSynchronize(String dataName, SynchronizableValue value, ValueContext context) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Sets the value of the data with the given name- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
dataName
- name of the datavalue
- the value to set. Givenull
to empty the value.context
- context of the data to set- Returns:
- the
SynchronizationResult
- 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
-
_removeValueForSynchronize
protected <T extends SynchronizationResult> T _removeValueForSynchronize(String dataName, ValueContext context) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException Removes the stored value of the data with the given name- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
dataName
- name of the datacontext
- context of the data to remove- Returns:
- the
SynchronizationResult
- Throws:
IllegalArgumentException
- if the given data path is null or emptyUnknownDataException
- if the value at the given data path does not existBadItemTypeException
- 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
-
setValue
public void setValue(String dataPath, Object value) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelAwareDataHolder
- 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
public void setLocalValue(String dataPath, Object localValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Sets the local value of the data at the given path- Specified by:
setLocalValue
in interfaceModifiableModelAwareDataHolder
- 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
public void setExternalValue(String dataPath, Object externalValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Sets the external value of the data at the given path- Specified by:
setExternalValue
in interfaceModifiableModelAwareDataHolder
- 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
-
_setValue
protected void _setValue(String dataPath, Object value, ValueContext context) 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.context
- context of the data to set- 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
public void setStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Set the status of the data at the given path- Specified by:
setStatus
in interfaceModifiableModelAwareDataHolder
- 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
public void setComments(String dataName, List<DataComment> comments) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:ModifiableModelAwareDataHolder
Set the comments of the data with the given name- Specified by:
setComments
in interfaceModifiableModelAwareDataHolder
- 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
public void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Removes the stored value of the data at the given path- Specified by:
removeValue
in interfaceModifiableDataHolder
- Specified by:
removeValue
in interfaceModifiableModelAwareDataHolder
- Parameters:
dataPath
- path of the 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
-
removeLocalValue
public void removeLocalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Removes the local value of the data at the given path- Specified by:
removeLocalValue
in interfaceModifiableModelAwareDataHolder
- 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
public void removeExternalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Removes the external value of the data at the given path- Specified by:
removeExternalValue
in interfaceModifiableModelAwareDataHolder
- 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
-
_removeValue
protected void _removeValue(String dataPath, ValueContext context) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Removes the stored value of the data at the given path- Parameters:
dataPath
- path of the datacontext
- context of the data to remove- 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
-
removeExternalizableMetadataIfExists
public void removeExternalizableMetadataIfExists(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolder
Removes the stored metadata (status and alternative value) for externalizable (or ex-externalizable) data- Specified by:
removeExternalizableMetadataIfExists
in interfaceModifiableModelAwareDataHolder
- 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
-
_createSynchronizationContextInstance
Creates an instance ofSynchronizationContext
- Type Parameters:
T
- the type of theSynchronizationContext
- Returns:
- the created
SynchronizationContext
-
_createSetValueResultInstance
Creates an instance ofSynchronizationResult
- Type Parameters:
T
- the type of theSynchronizationResult
- Returns:
- the created instance of
SynchronizationResult
-
getRepositoryData
Description copied from interface:DataHolder
Retrieves the repository data used by thisDataHolder
- Specified by:
getRepositoryData
in interfaceDataHolder
- Specified by:
getRepositoryData
in interfaceModifiableDataHolder
- Overrides:
getRepositoryData
in classDefaultModelAwareDataHolder
- 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 interfaceDataHolder
- Specified by:
getParentDataHolder
in interfaceIndexableDataHolder
- Specified by:
getParentDataHolder
in interfaceModelAwareDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableIndexableDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableModelAwareDataHolder
- Overrides:
getParentDataHolder
in classDefaultModelAwareDataHolder
- 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 interfaceIndexableDataHolder
- Specified by:
getRootDataHolder
in interfaceModelAwareDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableIndexableDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableModelAwareDataHolder
- Overrides:
getRootDataHolder
in classDefaultModelAwareDataHolder
- Returns:
- the root
DataHolder
-
_checkModifiableDefinition
Check definition for data path, for modification methods- Parameters:
dataPath
- the data patherrorMsg
- the error message to throw
-