Package org.ametys.cms.data
Class ContentValue
- java.lang.Object
-
- org.ametys.cms.data.ContentValue
-
- All Implemented Interfaces:
DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
public class ContentValue extends Object implements ModifiableModelAwareDataHolder
Content wrapper used by attributes of type content- See Also:
AbstractContentElementType
-
-
Field Summary
Fields Modifier and Type Field Description private ModifiableContent
_content
private String
_contentId
private AmetysObjectResolver
_resolver
private Session
_session
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description ContentValue(AmetysObjectResolver resolver, String contentId)
Constructor of the content wrapperContentValue(AmetysObjectResolver resolver, String contentId, Session session)
Constructor of the content wrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale)
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathvoid
dataToSAX(ContentHandler contentHandler, Locale locale)
Generates SAX events for the data in the model of the currentDataHolder
boolean
equals(Object obj)
ModifiableModelAwareComposite
getComposite(String compositePath)
Retrieves the composite at the given pathModifiableModelAwareComposite
getComposite(String compositePath, boolean createNew)
Retrieves the composite at the given pathModifiableContent
getContent()
Retrieves the contentString
getContentId()
Retrieves the content's identifierOptional<ModifiableContent>
getContentIfExists()
Collection<String>
getDataNames()
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataModelItem
getDefinition(String path)
Retrieves the definition of the data 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 path<T> T
getExternalValue(String dataPath)
Retrieves the external value of the data 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 path<T> T
getLocalValue(String dataPath)
Retrieves the local value of the data at the given pathCollection<? extends ModelItemContainer>
getModel()
Retrieves the data holder's modelModifiableModelAwareRepeater
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
ExternalizableDataProvider.ExternalizableDataStatus
getStatus(String dataPath)
Retrieves the status of the externalizable data at the given path<T> T
getValue(String dataPath, boolean allowMultiValuedPathSegments)
Retrieves the value of the data at the given path<T> T
getValue(String dataPath, boolean useDefaultFromModel, T defaultValue)
Retrieves the value of the data at the given path, or the default value The returned value is one of those ones, in the order: The value of the data if exists and is not empty The default value from the model if useDefaultFromModel istrue
and there is a default value defined by the model The given default valueboolean
hasDefinition(String path)
Checks if there is a definition at the given pathboolean
hasExternalValue(String dataPath)
Checks if there is an external value for the data at the given pathint
hashCode()
boolean
hasLocalValue(String dataPath)
Checks if there is a local value for the data at the given pathboolean
hasValue(String dataPath)
Checks if there is a value for the data at the given pathvoid
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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToSAX, dataToSAX, dataToSAX, getType, getValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder
synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
-
-
-
Field Detail
-
_resolver
private AmetysObjectResolver _resolver
-
_contentId
private String _contentId
-
_content
private ModifiableContent _content
-
-
Constructor Detail
-
ContentValue
public ContentValue(AmetysObjectResolver resolver, String contentId)
Constructor of the content wrapper- Parameters:
resolver
- resolver used to get the content from its identifiercontentId
- content identifier
-
ContentValue
public ContentValue(AmetysObjectResolver resolver, String contentId, Session session)
Constructor of the content wrapper- Parameters:
resolver
- resolver used to get the content from its identifiercontentId
- content identifiersession
- the current session. Ifnull
, a new session will be used to retrieve the content
-
-
Method Detail
-
getContentId
public String getContentId()
Retrieves the content's identifier- Returns:
- the content's identifier
-
getContent
public ModifiableContent getContent() throws AmetysRepositoryException, UnknownAmetysObjectException
Retrieves the content- Returns:
- the content
- Throws:
AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if no content exists for the identifier
-
getContentIfExists
public Optional<ModifiableContent> getContentIfExists()
- Returns:
- an
Optional
describing the content
-
hasValue
public boolean hasValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException
Description copied from interface:DataHolder
Checks if there is a value for the data at the given path- Specified by:
hasValue
in interfaceDataHolder
- Specified by:
hasValue
in interfaceModelAwareDataHolder
- Parameters:
dataPath
- path of the data- Returns:
true
if there is value (even empty) for the data,false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasLocalValue
public boolean hasLocalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Checks if there is a local value for the data at the given path- Specified by:
hasLocalValue
in interfaceModelAwareDataHolder
- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is a local value for the data (even empty) and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasExternalValue
public boolean hasExternalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Checks if there is an external value for the data at the given path- Specified by:
hasExternalValue
in interfaceModelAwareDataHolder
- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is an external value for the data (even empty) and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getDataNames
public Collection<String> getDataNames()
Description copied from interface:DataHolder
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNames
in interfaceDataHolder
- Specified by:
getDataNames
in interfaceModelAwareDataHolder
- Returns:
- the names of all data contained by this data holder
-
getValue
public <T> T getValue(String dataPath, boolean allowMultiValuedPathSegments) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the value of the data at the given path- Specified by:
getValue
in interfaceModelAwareDataHolder
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the dataallowMultiValuedPathSegments
-true
to allow multi-valued segments in the path (not necessarily at the last segment),false
otherwise. Iftrue
, if there is no indicated entry for a repeater, the values of all the entries are retrieved Iftrue
and if there are multiple values, all data are retrieved in one array- Returns:
- the value of the data or
null
if managesMutiples isfalse
and there is no non empty value. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - 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 type of the stored valueBadDataPathCardinalityException
- if the managesMultiples boolean isfalse
and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValue
public <T> T getValue(String dataPath, boolean useDefaultFromModel, T defaultValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the value of the data at the given path, or the default value The returned value is one of those ones, in the order:- The value of the data if exists and is not empty
- The default value from the model if useDefaultFromModel is
true
and there is a default value defined by the model - The given default value
- Specified by:
getValue
in interfaceModelAwareDataHolder
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the datauseDefaultFromModel
- true to use the default value from the model, false to use the given default valuedefaultValue
- default value used if value is null and useDefaultFromModel is false, or if there is no default value on model- Returns:
- the value of the data at the given path
- 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 type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalValue
public <T> T getLocalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the local value of the data at the given path- Specified by:
getLocalValue
in interfaceModelAwareDataHolder
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the externalizable data- Returns:
- the local value of the data or
null
if not exists or is empty. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - 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 type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalValue
public <T> T getExternalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the external value of the data at the given path- Specified by:
getExternalValue
in interfaceModelAwareDataHolder
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the externalizable data- Returns:
- the external value of the data or
null
if not exists or is empty. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - 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 type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getStatus
public ExternalizableDataProvider.ExternalizableDataStatus getStatus(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadDataPathCardinalityException
Description copied from interface:ModelAwareDataHolder
Retrieves the status of the externalizable data at the given path- Specified by:
getStatus
in interfaceModelAwareDataHolder
- Parameters:
dataPath
- path of the externalizable data- Returns:
- the status of the externalizable data at the given path
- Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- 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
-
getModel
public Collection<? extends ModelItemContainer> getModel()
Description copied from interface:ModelAwareDataHolder
Retrieves the data holder's model- Specified by:
getModel
in interfaceModelAwareDataHolder
- Returns:
- the data holder's model
-
getDefinition
public ModelItem getDefinition(String path) throws IllegalArgumentException, UndefinedItemPathException
Description copied from interface:ModelAwareDataHolder
Retrieves the definition of the data at the given path- Specified by:
getDefinition
in interfaceModelAwareDataHolder
- Parameters:
path
- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
- the definition of the data
- Throws:
IllegalArgumentException
- if the given path is null or emptyUndefinedItemPathException
- if the given path is not defined by the model
-
hasDefinition
public boolean hasDefinition(String path) throws IllegalArgumentException
Description copied from interface:ModelAwareDataHolder
Checks if there is a definition at the given path- Specified by:
hasDefinition
in interfaceModelAwareDataHolder
- Parameters:
path
- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
true
if there is definition at the given path,false
otherwise- Throws:
IllegalArgumentException
- if the given path is null or empty
-
getComposite
public ModifiableModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
Description copied from interface:DataHolder
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
- 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
- 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
- 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
-
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
- 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
- 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
- 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
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale) throws SAXException, IOException
Description copied from interface:DataHolder
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Specified by:
dataToSAX
in interfaceDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAXlocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O API
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, Locale locale) throws SAXException, IOException, BadItemTypeException
Description copied from interface:ModelAwareDataHolder
Generates SAX events for the data in the model of the currentDataHolder
- Specified by:
dataToSAX
in interfaceModelAwareDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventslocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O APIBadItemTypeException
- if the saxed value's type does not matches the stored data
-
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
-
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
-
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
-
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
-
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
-
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
-
removeValue
public void removeValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, 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 modelUnknownDataException
- 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
-
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
- Returns:
- the repository data used by this
DataHolder
-
-