Class JCRCompositeMetadata
- java.lang.Object
-
- org.ametys.plugins.repository.metadata.jcr.JCRCompositeMetadata
-
- All Implemented Interfaces:
CommentableCompositeMetadata
,CompositeMetadata
,ModifiableCompositeMetadata
@Deprecated public class JCRCompositeMetadata extends Object implements ModifiableCompositeMetadata, CommentableCompositeMetadata
Deprecated.UseJCRRepositoryData
insteadJCR implementation of a CompositeMetadata.
This implementation is based on a child node of the Node supporting the actual content.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.plugins.repository.metadata.CompositeMetadata
CompositeMetadata.MetadataType
-
-
Field Summary
Fields Modifier and Type Field Description static String
METADATA_COMMENTS_SUFFIX
Deprecated.Comments metadata suffixstatic String
METADATA_PREFIX
Deprecated.Prefix for jcr properties and nodes namesstatic String
MULTILINGUAL_STRING_METADATA_NODETYPE
Deprecated.The JCR nodetype of multilingual metadata.static String
OBJECT_COLLECTION_METADATA_NODETYPE
Deprecated.The JCR nodetype of object collection metadata.
-
Constructor Summary
Constructors Constructor Description JCRCompositeMetadata(Node metadataNode, AmetysObjectResolver resolver)
Deprecated.Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
_checkMetadataName(String metadataName)
Deprecated.Check if the metadata name is valid.protected static Pattern
_getMetadataNamePattern()
Deprecated.Get the metadata name pattern to test validity.void
addComment(String metadataName, String text, String author, Date date)
Deprecated.Add a metadata comment.void
copyTo(ModifiableCompositeMetadata metadata)
Deprecated.Copy the currentCompositeMetadata
to the given composite metadata.void
deleteComment(String metadataName, int index)
Deprecated.Delete a metadata comment.void
editComment(String metadataName, int index, String text, String author, Date date)
Deprecated.Edit the text of a metadata comment.ModifiableBinaryMetadata
getBinaryMetadata(String metadataName)
Deprecated.Returns the named metadata's value asBinaryMetadata
.
If the metadata does not exist, anUnknownMetadataException
is thrown.ModifiableBinaryMetadata
getBinaryMetadata(String metadataName, boolean createNew)
Deprecated.Returns the named metadata's value asBinaryMetadata
.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown.boolean
getBoolean(String metadataName)
Deprecated.Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.boolean
getBoolean(String metadataName, boolean defaultValue)
Deprecated.Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.boolean[]
getBooleanArray(String metadataName)
Deprecated.Returns the named metadata's value as boolean array.boolean[]
getBooleanArray(String metadataName, boolean[] defaultValues)
Deprecated.Returns the named metadata's value as boolean array.
If the metadata does not exist, the default values are returned.List<MetadataComment>
getComments(String metadataName)
Deprecated.Retrieves the comments of a metadataModifiableCompositeMetadata
getCompositeMetadata(String metadataName)
Deprecated.Returns the named metadata's value asCompositeMetadata
.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist anUnknownMetadataException
is thrown.ModifiableCompositeMetadata
getCompositeMetadata(String metadataName, boolean createNew)
Deprecated.Returns the named metadata's value asCompositeMetadata
.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown.Date
getDate(String metadataName)
Deprecated.Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.Date
getDate(String metadataName, Date defaultValue)
Deprecated.Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.Date[]
getDateArray(String metadataName)
Deprecated.Returns the named metadata's value as Date array.Date[]
getDateArray(String metadataName, Date[] defaultValues)
Deprecated.Returns the named metadata's value as Date array.
If the metadata does not exist, the default values are returned.double
getDouble(String metadataName)
Deprecated.Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.double
getDouble(String metadataName, double defaultValue)
Deprecated.Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.double[]
getDoubleArray(String metadataName)
Deprecated.Returns the named metadata's value as double array.double[]
getDoubleArray(String metadataName, double[] defaultValues)
Deprecated.Returns the named metadata's value as double array.
If the metadata does not exist, the default values are returned.String
getLocalizedString(String metadataName, Locale locale)
Deprecated.Returns the named metadata's value of a multilingual metadata as String.String
getLocalizedString(String metadataName, Locale locale, String defaultValue)
Deprecated.Returns the named metadata's value of a multilingual metadata as String.
If the metadata does not exist, the default value is returned.long
getLong(String metadataName)
Deprecated.Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.long
getLong(String metadataName, long defaultValue)
Deprecated.Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.long[]
getLongArray(String metadataName)
Deprecated.Returns the named metadata's value as long array.long[]
getLongArray(String metadataName, long[] defaultValues)
Deprecated.Returns the named metadata's value as long array.
If the metadata does not exist, the default values are returned.String[]
getMetadataNames()
Deprecated.Returns an array containing metadata names.MultilingualString
getMultilingualString(String metadataName)
Deprecated.Returns the named metadata's values of a multilingual metadata.Node
getNode()
Deprecated.Retrieves the underlying node.ModifiableTraversableAmetysObject
getObjectCollection(String metadataName)
Deprecated.Returns an object collection metadata as aTraversableAmetysObject
.ModifiableTraversableAmetysObject
getObjectCollection(String metadataName, boolean createNew)
Deprecated.Returns an object collection metadata as aTraversableAmetysObject
.ModifiableRichText
getRichText(String metadataName)
Deprecated.Returns the named metadata's value asRichText
.
If the metadata does not exist, anUnknownMetadataException
is thrown.ModifiableRichText
getRichText(String metadataName, boolean createNew)
Deprecated.Returns the named metadata's value asRichText
.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown.String
getString(String metadataName)
Deprecated.Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.String
getString(String metadataName, String defaultValue)
Deprecated.Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.String[]
getStringArray(String metadataName)
Deprecated.Returns the named metadata's value as String array.String[]
getStringArray(String metadataName, String[] defaultValues)
Deprecated.Returns the named metadata's value as String array.
If the metadata does not exist, the default values are returned.CompositeMetadata.MetadataType
getType(String metadataName)
Deprecated.Returns the type of the given metadata.UserIdentity
getUser(String metadataName)
Deprecated.Returns the named metadata's value asUserIdentity
.
If the metadata does not exist, anUnknownMetadataException
is thrown.UserIdentity
getUser(String metadataName, UserIdentity defaultValue)
Deprecated.Returns the named metadata's value asUserIdentity
.
If the metadata does not exist, the default value is returned.UserIdentity[]
getUserArray(String metadataName)
Deprecated.Returns the named metadata's value asUserIdentity
array.UserIdentity[]
getUserArray(String metadataName, UserIdentity[] defaultValues)
Deprecated.Returns the named metadata's value asUserIdentity
array.
If the metadata does not exist, the default values are returned.boolean
hasComment(String metadataName, int index)
Deprecated.Indicates if a metadata has a commentboolean
hasComments(String metadataName)
Deprecated.Indicates if a metadata has any commentsboolean
hasMetadata(String metadataName)
Deprecated.Tests if a metadata with a given name exists.boolean
isMultiple(String metadataName)
Deprecated.Test if the given metadata is multiple.void
removeMetadata(String metadataName)
Deprecated.Removes the given metadata.void
rename(String newName)
Deprecated.Rename the current metadatavoid
setMetadata(String metadataName, boolean value)
Deprecated.Set a boolean metadata.void
setMetadata(String metadataName, boolean[] values)
Deprecated.Set a multi-valued boolean metadata.void
setMetadata(String metadataName, double value)
Deprecated.Set a double metadata.void
setMetadata(String metadataName, double[] values)
Deprecated.Set a multi-valued double metadata.void
setMetadata(String metadataName, long value)
Deprecated.Set a long metadata.void
setMetadata(String metadataName, long[] values)
Deprecated.Set a multi-valued long metadata.void
setMetadata(String metadataName, String value)
Deprecated.Set a string metadata.void
setMetadata(String metadataName, String[] value)
Deprecated.Set a multi-valued string metadata.void
setMetadata(String metadataName, String value, Locale locale)
Deprecated.Set a multilingual string metadata.void
setMetadata(String metadataName, Date value)
Deprecated.Set a date metadata.void
setMetadata(String metadataName, Date[] values)
Deprecated.Set a multi-valued date metadata.void
setMetadata(String metadataName, UserIdentity value)
Deprecated.Set aUserIdentity
metadata.void
setMetadata(String metadataName, UserIdentity[] values)
Deprecated.Set a multi-valuedUserIdentity
metadata.void
setMetadata(String metadataName, MultilingualString value)
Deprecated.Set aMultilingualString
metadata.
-
-
-
Field Detail
-
METADATA_PREFIX
public static final String METADATA_PREFIX
Deprecated.Prefix for jcr properties and nodes names- See Also:
- Constant Field Values
-
METADATA_COMMENTS_SUFFIX
public static final String METADATA_COMMENTS_SUFFIX
Deprecated.Comments metadata suffix- See Also:
- Constant Field Values
-
OBJECT_COLLECTION_METADATA_NODETYPE
public static final String OBJECT_COLLECTION_METADATA_NODETYPE
Deprecated.The JCR nodetype of object collection metadata.- See Also:
- Constant Field Values
-
MULTILINGUAL_STRING_METADATA_NODETYPE
public static final String MULTILINGUAL_STRING_METADATA_NODETYPE
Deprecated.The JCR nodetype of multilingual metadata.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRCompositeMetadata
public JCRCompositeMetadata(Node metadataNode, AmetysObjectResolver resolver)
Deprecated.Constructor- Parameters:
metadataNode
- the Node supporting this composite metadataresolver
- The resolver, used to resolve object collections.
-
-
Method Detail
-
getNode
public Node getNode()
Deprecated.Retrieves the underlying node.- Returns:
- the underlying node.
-
hasMetadata
public boolean hasMetadata(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Tests if a metadata with a given name exists.- Specified by:
hasMetadata
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadataName to test.- Returns:
true
if the given metadata exists,false
otherwise.- Throws:
AmetysRepositoryException
- if an error occurs.
-
rename
public void rename(String newName) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Rename the current metadata- Specified by:
rename
in interfaceModifiableCompositeMetadata
- Parameters:
newName
- the new name- Throws:
AmetysRepositoryException
- if an error occurs.
-
removeMetadata
public void removeMetadata(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Removes the given metadata.- Specified by:
removeMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- metadata name.- Throws:
UnknownMetadataException
- if the metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
copyTo
public void copyTo(ModifiableCompositeMetadata metadata) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Copy the currentCompositeMetadata
to the given composite metadata.- Specified by:
copyTo
in interfaceCompositeMetadata
- Parameters:
metadata
- The parent composite metadata. Can not be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getType
public CompositeMetadata.MetadataType getType(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the type of the given metadata.- Specified by:
getType
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- the type of the given metadata.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getString
public String getString(String metadataName)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getString
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as String.
-
getString
public String getString(String metadataName, String defaultValue)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.- Specified by:
getString
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as String or the default value if metadata is not set.
-
getStringArray
public String[] getStringArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as String array.- Specified by:
getStringArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- metadata value as String array.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getStringArray
public String[] getStringArray(String metadataName, String[] defaultValues)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as String array.
If the metadata does not exist, the default values are returned.- Specified by:
getStringArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.defaultValues
- the default values.- Returns:
- metadata value as String array or the default values if metadata is not set.
-
getLocalizedString
public String getLocalizedString(String metadataName, Locale locale) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value of a multilingual metadata as String.- Specified by:
getLocalizedString
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.locale
- the locale of value to retrieve- Returns:
- the metadata value as String
- Throws:
UnknownMetadataException
- if the named metadata does not exist for the given locale.AmetysRepositoryException
- if an error occurs.
-
getLocalizedString
public String getLocalizedString(String metadataName, Locale locale, String defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value of a multilingual metadata as String.
If the metadata does not exist, the default value is returned.- Specified by:
getLocalizedString
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.locale
- the locale of value to retrievedefaultValue
- the default value.- Returns:
- the metadata value as String or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getMultilingualString
public MultilingualString getMultilingualString(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's values of a multilingual metadata.- Specified by:
getMultilingualString
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata values for all existing locales
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getBoolean
public boolean getBoolean(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getBoolean
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as boolean.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getBoolean
public boolean getBoolean(String metadataName, boolean defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.- Specified by:
getBoolean
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as boolean or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getBooleanArray
public boolean[] getBooleanArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as boolean array.- Specified by:
getBooleanArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- metadata value as boolean array.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getBooleanArray
public boolean[] getBooleanArray(String metadataName, boolean[] defaultValues)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as boolean array.
If the metadata does not exist, the default values are returned.- Specified by:
getBooleanArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.defaultValues
- the default values.- Returns:
- metadata value as boolean array or the default values if metadata is not set.
-
getDate
public Date getDate(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getDate
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as Date.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getDate
public Date getDate(String metadataName, Date defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.- Specified by:
getDate
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as Date or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDateArray
public Date[] getDateArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as Date array.- Specified by:
getDateArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- metadata value as Date array.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getDateArray
public Date[] getDateArray(String metadataName, Date[] defaultValues)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as Date array.
If the metadata does not exist, the default values are returned.- Specified by:
getDateArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.defaultValues
- the default values.- Returns:
- metadata value as Date array or the default values if metadata is not set.
-
getLong
public long getLong(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getLong
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as long.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getLong
public long getLong(String metadataName, long defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.- Specified by:
getLong
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as long or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLongArray
public long[] getLongArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as long array.- Specified by:
getLongArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- metadata value as long array.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getLongArray
public long[] getLongArray(String metadataName, long[] defaultValues)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as long array.
If the metadata does not exist, the default values are returned.- Specified by:
getLongArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.defaultValues
- the default values.- Returns:
- metadata value as long array or the default values if metadata is not set.
-
getDouble
public double getDouble(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getDouble
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as double.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getDouble
public double getDouble(String metadataName, double defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist, the default value is returned.- Specified by:
getDouble
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as double or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDoubleArray
public double[] getDoubleArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as double array.- Specified by:
getDoubleArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.- Returns:
- metadata value as double array.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getDoubleArray
public double[] getDoubleArray(String metadataName, double[] defaultValues)
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value as double array.
If the metadata does not exist, the default values are returned.- Specified by:
getDoubleArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- metadata name.defaultValues
- the default values.- Returns:
- metadata value as double array or the default values if metadata is not set.
-
getUser
public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asUserIdentity
.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getUser
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as user identity.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getUser
public UserIdentity getUser(String metadataName, UserIdentity defaultValue) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asUserIdentity
.
If the metadata does not exist, the default value is returned.- Specified by:
getUser
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValue
- the default value.- Returns:
- the metadata value as user identity or the default value if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getUserArray
public UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asUserIdentity
array.- Specified by:
getUserArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- metadata value as user identity array.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getUserArray
public UserIdentity[] getUserArray(String metadataName, UserIdentity[] defaultValues) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asUserIdentity
array.
If the metadata does not exist, the default values are returned.- Specified by:
getUserArray
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.defaultValues
- the default values.- Returns:
- metadata value as user identity array or the default values if metadata is not set.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setMetadata
public void setMetadata(String metadataName, String value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a string metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the String value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, String[] value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valued string metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the String array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, String value, Locale locale) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multilingual string metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the String value of this metadata in the given locale.locale
- The value of locale- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, Date value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a date metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the Date value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, Date[] values) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valued date metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.values
- the Date array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, long value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a long metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the integer value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, double value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a double metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the integer value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, long[] values) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valued long metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.values
- the integer array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, double[] values) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valued double metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.values
- the integer array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, boolean value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a boolean metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- the boolean value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, boolean[] values) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valued boolean metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.values
- the boolean array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, UserIdentity value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set aUserIdentity
metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- theUserIdentity
value of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, UserIdentity[] values) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set a multi-valuedUserIdentity
metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.values
- theUserIdentity
array containing values of this metadata.- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
setMetadata
public void setMetadata(String metadataName, MultilingualString value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Set aMultilingualString
metadata.- Specified by:
setMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.value
- theMultilingualString
value- Throws:
AmetysRepositoryException
- if the metadata cannot be set.
-
getMetadataNames
public String[] getMetadataNames() throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns an array containing metadata names.- Specified by:
getMetadataNames
in interfaceCompositeMetadata
- Returns:
- an array containing metadata names.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
isMultiple
public boolean isMultiple(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Test if the given metadata is multiple.- Specified by:
isMultiple
in interfaceCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
true
if the given metadata is multiple,false
otherwise.- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
_checkMetadataName
protected void _checkMetadataName(String metadataName) throws AmetysRepositoryException
Deprecated.Check if the metadata name is valid.- Parameters:
metadataName
- The metadata name to check.- Throws:
AmetysRepositoryException
- If the metadata name is invalid.
-
_getMetadataNamePattern
protected static Pattern _getMetadataNamePattern()
Deprecated.Get the metadata name pattern to test validity.- Returns:
- The metadata name pattern.
-
getBinaryMetadata
public ModifiableBinaryMetadata getBinaryMetadata(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asBinaryMetadata
.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getBinaryMetadata
in interfaceCompositeMetadata
- Specified by:
getBinaryMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as BinaryMetadata.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getBinaryMetadata
public ModifiableBinaryMetadata getBinaryMetadata(String metadataName, boolean createNew) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Returns the named metadata's value asBinaryMetadata
.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.- Specified by:
getBinaryMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.createNew
-true
to create automatically theBinaryMetadata
when missing.- Returns:
- the metadata value as BinaryMetadata.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getCompositeMetadata
public ModifiableCompositeMetadata getCompositeMetadata(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asCompositeMetadata
.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist anUnknownMetadataException
is thrown.- Specified by:
getCompositeMetadata
in interfaceCompositeMetadata
- Specified by:
getCompositeMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as
CompositeMetadata
. - Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getCompositeMetadata
public ModifiableCompositeMetadata getCompositeMetadata(String metadataName, boolean createNew) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Returns the named metadata's value asCompositeMetadata
.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.- Specified by:
getCompositeMetadata
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.createNew
-true
to create automatically theCompositeMetadata
when missing.- Returns:
- the metadata value as
CompositeMetadata
. - Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getRichText
public ModifiableRichText getRichText(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns the named metadata's value asRichText
.
If the metadata does not exist, anUnknownMetadataException
is thrown.- Specified by:
getRichText
in interfaceCompositeMetadata
- Specified by:
getRichText
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata value as RichText.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getRichText
public ModifiableRichText getRichText(String metadataName, boolean createNew) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Returns the named metadata's value asRichText
.
If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.- Specified by:
getRichText
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.createNew
-true
to create automatically theBinaryMetadata
when missing.- Returns:
- the metadata value as RichText.
- Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getObjectCollection
public ModifiableTraversableAmetysObject getObjectCollection(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadata
Returns an object collection metadata as aTraversableAmetysObject
.- Specified by:
getObjectCollection
in interfaceCompositeMetadata
- Specified by:
getObjectCollection
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.- Returns:
- the metadata as a
TraversableAmetysObject
. - Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getObjectCollection
public ModifiableTraversableAmetysObject getObjectCollection(String metadataName, boolean createNew) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadata
Returns an object collection metadata as aTraversableAmetysObject
. If the metadata does not exist and createNew isfalse
, anUnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.- Specified by:
getObjectCollection
in interfaceModifiableCompositeMetadata
- Parameters:
metadataName
- the metadata name.createNew
-true
to create automatically theCompositeMetadata
when missing.- Returns:
- the metadata as a
TraversableAmetysObject
. - Throws:
UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.
-
getComments
public List<MetadataComment> getComments(String metadataName)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Retrieves the comments of a metadata- Specified by:
getComments
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata name- Returns:
- the list of
MetadataComment
-
hasComments
public boolean hasComments(String metadataName)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Indicates if a metadata has any comments- Specified by:
hasComments
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata name- Returns:
- true if at least one comment exists for this metadata
-
hasComment
public boolean hasComment(String metadataName, int index)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Indicates if a metadata has a comment- Specified by:
hasComment
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata nameindex
- The comment index- Returns:
- true if a comment at this index exists for this metadata
-
addComment
public void addComment(String metadataName, String text, String author, Date date)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Add a metadata comment.- Specified by:
addComment
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata nametext
- The text of the commentauthor
- The comment authordate
- The date of the comment (null to use the current date)
-
editComment
public void editComment(String metadataName, int index, String text, String author, Date date)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Edit the text of a metadata comment.- Specified by:
editComment
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata nameindex
- The comment indextext
- The new text for the commentauthor
- The comment authordate
- The date of the comment (null to use the current date)
-
deleteComment
public void deleteComment(String metadataName, int index)
Deprecated.Description copied from interface:CommentableCompositeMetadata
Delete a metadata comment.- Specified by:
deleteComment
in interfaceCommentableCompositeMetadata
- Parameters:
metadataName
- The metadata nameindex
- The comment index
-
-