Class DefaultModifiableModelAwareDataHolder
- java.lang.Object
-
- org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
-
- org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
-
- All Implemented Interfaces:
DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
public class DefaultModifiableModelAwareDataHolder extends DefaultModelAwareDataHolder implements ModifiableModelAwareDataHolder
Default implementation for modifiable data holder with model
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__TEMP_SUFFIX
protected ModifiableRepositoryData
_modifiableRepositoryData
Repository data to use to store data in the repository-
Fields inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
_itemContainers, _repositoryData
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description DefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers)
Creates a modifiable default model aware data holderDefaultModifiableModelAwareDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer... itemContainers)
Creates a modifiable default model aware data holder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_fillViewItemContainerFromValues(Map<String,Object> values, ViewItemContainer viewItemContainer, Collection<? extends ModelItemContainer> modelItemContainers)
private void
_fillViewItemContainerFromValues(Map<String,Object> values, ViewItemContainer viewItemContainer, ModelItemContainer modelItemContainer)
private ModifiableModelAwareComposite
_getComposite(String compositePath, boolean createNew, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
protected ModifiableModelAwareComposite
_getComposite(String name, CompositeDefinition compositeDefinition)
Retrieves the composite with the given nameprotected ModifiableModelAwareComposite
_getComposite(String name, CompositeDefinition compositeDefinition, boolean createNew)
Retrieves the composite with the given nameprotected Class
_getCompositeClass()
Retrieves the class of the managed compositesprivate ModifiableModelAwareRepeater
_getRepeater(String repeaterPath, boolean createNew, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
protected ModifiableModelAwareRepeater
_getRepeater(String name, RepeaterDefinition repeaterDefinition)
Retrieves the repeater with the given nameprotected ModifiableModelAwareRepeater
_getRepeater(String name, RepeaterDefinition repeaterDefinition, boolean createNew)
Retrieves the repeater with the given nameprotected Class
_getRepeaterClass()
Retrieves the class of the managed repeatersprotected Class
_getRepeaterEntryClass()
Retrieves the class of the managed repeater entriesprivate void
_removeExternalizableMetadataIfExists(String dataName)
private void
_removeValue(String dataPath, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
private void
_removeValueForSynchronize(String dataName, boolean isDataExternalizable)
private void
_setElementValue(ElementDefinition defintion, String dataName, Object value)
private void
_setStatus(String dataPath, CompositeDefinition compositeDefinition)
private void
_setStatus(String dataPath, RepeaterDefinition repeaterDefinition)
private void
_setStatus(String dataPath, ElementDefinition elementDefinition)
private void
_setValue(String dataPath, Object value, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
private void
_setValueForSynchronize(String dataName, Object value, boolean isDataExternalizable)
private boolean
_synchronizeElement(ViewElement viewElement, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)
private boolean
_synchronizeGroup(ModelViewItemGroup modelViewItemGroup, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)
private boolean
_synchronizeValue(String dataName, Object value, ElementType type, boolean isDataExternalizable)
ModifiableModelAwareComposite
getComposite(String compositePath)
Retrieves the composite at the given pathModifiableModelAwareComposite
getComposite(String compositePath, boolean createNew)
Retrieves the composite at the given pathModifiableModelAwareComposite
getExternalComposite(String compositePath)
Retrieves the external composite at the given pathModifiableModelAwareComposite
getExternalComposite(String compositePath, boolean createNew)
Retrieves the external composite at the given pathModifiableModelAwareRepeater
getExternalRepeater(String repeaterPath)
Retrieves the external repeater at the given pathModifiableModelAwareRepeater
getExternalRepeater(String repeaterPath, boolean createNew)
Retrieves the external repeater at the given pathModifiableModelAwareComposite
getLocalComposite(String compositePath)
Retrieves the local composite at the given pathModifiableModelAwareComposite
getLocalComposite(String compositePath, boolean createNew)
Retrieves the local composite at the given pathModifiableModelAwareRepeater
getLocalRepeater(String repeaterPath)
Retrieves the local repeater at the given pathModifiableModelAwareRepeater
getLocalRepeater(String repeaterPath, boolean createNew)
Retrieves the local repeater at the given pathModifiableModelAwareRepeater
getRepeater(String repeaterPath)
Retrieves the repeater at the given pathModifiableModelAwareRepeater
getRepeater(String repeaterPath, boolean createNew)
Retrieves the repeater at the given pathModifiableRepositoryData
getRepositoryData()
Retrieves the repository data used by thisDataHolder
void
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
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
setValue(String dataPath, Object value)
Sets the value of the data at the given pathboolean
synchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external oneboolean
synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel)
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external one-
Methods inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
_hasNonEmptyValue, dataToSAX, dataToSAX, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasExternalValue, hasLocalValue, hasValue
-
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, dataToSAX, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToSAX, dataToSAX, dataToSAX, dataToSAX, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasDefinition, hasExternalValue, hasLocalValue, hasValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder
synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
-
-
-
Field Detail
-
__TEMP_SUFFIX
private static final String __TEMP_SUFFIX
- See Also:
- Constant Field Values
-
_modifiableRepositoryData
protected ModifiableRepositoryData _modifiableRepositoryData
Repository data to use to store data in the repository
-
-
Constructor Detail
-
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.
-
-
Method Detail
-
getComposite
public ModifiableModelAwareComposite 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 interfaceModelAwareDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- 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 ModifiableModelAwareComposite 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 interfaceModelAwareDataHolder
- 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 ModifiableModelAwareComposite 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 interfaceModelAwareDataHolder
- 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 ModifiableModelAwareComposite _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 ModifiableModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceModelAwareDataHolder
- 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 ModifiableModelAwareRepeater 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 interfaceModelAwareDataHolder
- 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 ModifiableModelAwareRepeater 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 interfaceModelAwareDataHolder
- 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 ModifiableModelAwareRepeater _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 ModifiableModelAwareComposite 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 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 ModifiableModelAwareComposite 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 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 ModifiableModelAwareComposite 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 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
private ModifiableModelAwareComposite _getComposite(String compositePath, boolean createNew, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
-
_getComposite
protected ModifiableModelAwareComposite _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 ModifiableModelAwareRepeater 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 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 ModifiableModelAwareRepeater 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 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 ModifiableModelAwareRepeater 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 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
private ModifiableModelAwareRepeater _getRepeater(String repeaterPath, boolean createNew, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
-
_getRepeater
protected ModifiableModelAwareRepeater _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
protected Class _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
protected Class _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
protected Class _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 boolean synchronizeValues(Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Description copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Parameters:
values
- the values to synchronizeexternalizableDataProviderEP
- the extrernalizable data provider extension pointuseDefaultFromModel
-true
to use default values from the model if there is no value in theMap
for an item present in the view- Returns:
true
if some values have changed,false
otherwise- 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 valueIOException
- if an error occurs while synchronizing I/O data
-
_fillViewItemContainerFromValues
private void _fillViewItemContainerFromValues(Map<String,Object> values, ViewItemContainer viewItemContainer, ModelItemContainer modelItemContainer)
-
_fillViewItemContainerFromValues
private void _fillViewItemContainerFromValues(Map<String,Object> values, ViewItemContainer viewItemContainer, Collection<? extends ModelItemContainer> modelItemContainers)
-
synchronizeValues
public boolean synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws UndefinedItemPathException, BadItemTypeException, IOException
Description copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones If the data is externalizable, the synchronized value is the external one- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Parameters:
viewItemContainer
- TheViewItemContainer
containing all items to synchronizevalues
- the values to synchronizeexternalizableDataProviderEP
- the extrernalizable data provider extension pointuseDefaultFromModel
-true
to use default values from the model if there is no value in theMap
for an item present in the view- Returns:
true
if some values have changed,false
otherwise- 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 valueIOException
- if an error occurs while synchronizing I/O data
-
_synchronizeGroup
private boolean _synchronizeGroup(ModelViewItemGroup modelViewItemGroup, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws IOException
- Throws:
IOException
-
_synchronizeElement
private boolean _synchronizeElement(ViewElement viewElement, Map<String,Object> values, ExternalizableDataProviderExtensionPoint externalizableDataProviderEP, boolean useDefaultFromModel) throws IOException
- Throws:
IOException
-
_synchronizeValue
private boolean _synchronizeValue(String dataName, Object value, ElementType type, boolean isDataExternalizable) throws IOException
- Throws:
IOException
-
_setValueForSynchronize
private void _setValueForSynchronize(String dataName, Object value, boolean isDataExternalizable)
-
_removeValueForSynchronize
private void _removeValueForSynchronize(String dataName, boolean isDataExternalizable)
-
_removeExternalizableMetadataIfExists
private void _removeExternalizableMetadataIfExists(String dataName)
-
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
private void _setValue(String dataPath, Object value, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
-
_setElementValue
private void _setElementValue(ElementDefinition defintion, String dataName, Object value)
-
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 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
private void _setStatus(String dataPath, CompositeDefinition compositeDefinition)
-
_setStatus
private void _setStatus(String dataPath, RepeaterDefinition repeaterDefinition)
-
_setStatus
private void _setStatus(String dataPath, ElementDefinition elementDefinition)
-
removeValue
public void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, UnknownDataException, 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 containerUnknownDataException
- if the value at the given data path does not existBadDataPathCardinalityException
- 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, UnknownDataException, 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 containerUnknownDataException
- if the value at the given data path does not existBadDataPathCardinalityException
- 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, UnknownDataException, 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 containerUnknownDataException
- if the value at the given data path does not existBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
_removeValue
private void _removeValue(String dataPath, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException
-
getRepositoryData
public ModifiableRepositoryData 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
-
-