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.UseJCRRepositoryDatainsteadJCR 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 private static Pattern__metadataNamePatternDeprecated.private boolean_lockAlreadyCheckedDeprecated.private Node_nodeDeprecated.private AmetysObjectResolver_resolverDeprecated.static StringMETADATA_COMMENTS_SUFFIXDeprecated.Comments metadata suffixstatic StringMETADATA_PREFIXDeprecated.Prefix for jcr properties and nodes namesstatic StringMULTILINGUAL_STRING_METADATA_NODETYPEDeprecated.The JCR nodetype of multilingual metadata.static StringOBJECT_COLLECTION_METADATA_NODETYPEDeprecated.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 private void_checkLock()Deprecated.protected void_checkMetadataName(String metadataName)Deprecated.Check if the metadata name is valid.private void_copyDataFolder(ModifiableFolder srcDataFolder, ModifiableFolder targetDataFolder)Deprecated.private void_copyFile(ModifiableFile srcFile, ModifiableFolder targetDataFolder)Deprecated.private boolean_getBoolean(String metadataName, Boolean defaultValue, boolean failIfNotExist)Deprecated.private boolean[]_getBooleanArray(String metadataName, boolean[] defaultValues, boolean failIfNotExist)Deprecated.private Date_getDate(String metadataName, Date defaultValue, boolean failIfNotExist)Deprecated.private Date[]_getDateArray(String metadataName, Date[] defaultValues, boolean failIfNotExist)Deprecated.private double_getDouble(String metadataName, Double defaultValue, boolean failIfNotExist)Deprecated.private double[]_getDoubleArray(String metadataName, double[] defaultValues, boolean failIfNotExist)Deprecated.private long_getLong(String metadataName, Long defaultValue, boolean failIfNotExist)Deprecated.private long[]_getLongArray(String metadataName, long[] defaultValues, boolean failIfNotExist)Deprecated.protected static Pattern_getMetadataNamePattern()Deprecated.Get the metadata name pattern to test validity.private String_getString(String metadataName, String defaultValue, boolean failIfNotExist)Deprecated.private String_getString(String metadataName, Locale locale, String defaultValue, boolean failIfNotExist)Deprecated.private String[]_getStringArray(String metadataName, String[] defaultValues, boolean failIfNotExist)Deprecated.private UserIdentity_getUser(String metadataName, UserIdentity defaultValue, boolean failIfNotExist)Deprecated.private UserIdentity[]_getUserArray(String metadataName, UserIdentity[] defaultValues, boolean failIfNotExist)Deprecated.voidaddComment(String metadataName, String text, String author, Date date)Deprecated.Add a metadata comment.voidcopyTo(ModifiableCompositeMetadata metadata)Deprecated.Copy the currentCompositeMetadatato the given composite metadata.voiddeleteComment(String metadataName, int index)Deprecated.Delete a metadata comment.voideditComment(String metadataName, int index, String text, String author, Date date)Deprecated.Edit the text of a metadata comment.ModifiableBinaryMetadatagetBinaryMetadata(String metadataName)Deprecated.Returns the named metadata's value asBinaryMetadata.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.ModifiableBinaryMetadatagetBinaryMetadata(String metadataName, boolean createNew)Deprecated.Returns the named metadata's value asBinaryMetadata.
If the metadata does not exist and createNew isfalse, anUnknownMetadataExceptionis thrown.booleangetBoolean(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, anUnknownMetadataExceptionis thrown.booleangetBoolean(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 metadataModifiableCompositeMetadatagetCompositeMetadata(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 anUnknownMetadataExceptionis thrown.ModifiableCompositeMetadatagetCompositeMetadata(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, anUnknownMetadataExceptionis thrown.DategetDate(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, anUnknownMetadataExceptionis thrown.DategetDate(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.doublegetDouble(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, anUnknownMetadataExceptionis thrown.doublegetDouble(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.StringgetLocalizedString(String metadataName, Locale locale)Deprecated.Returns the named metadata's value of a multilingual metadata as String.StringgetLocalizedString(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.longgetLong(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, anUnknownMetadataExceptionis thrown.longgetLong(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.MultilingualStringgetMultilingualString(String metadataName)Deprecated.Returns the named metadata's values of a multilingual metadata.NodegetNode()Deprecated.Retrieves the underlying node.ModifiableTraversableAmetysObjectgetObjectCollection(String metadataName)Deprecated.Returns an object collection metadata as aTraversableAmetysObject
.ModifiableTraversableAmetysObjectgetObjectCollection(String metadataName, boolean createNew)Deprecated.Returns an object collection metadata as aTraversableAmetysObject
.ModifiableRichTextgetRichText(String metadataName)Deprecated.Returns the named metadata's value asRichText.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.ModifiableRichTextgetRichText(String metadataName, boolean createNew)Deprecated.Returns the named metadata's value asRichText.
If the metadata does not exist and createNew isfalse, anUnknownMetadataExceptionis thrown.StringgetString(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, anUnknownMetadataExceptionis thrown.StringgetString(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.MetadataTypegetType(String metadataName)Deprecated.Returns the type of the given metadata.UserIdentitygetUser(String metadataName)Deprecated.Returns the named metadata's value asUserIdentity.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.UserIdentitygetUser(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 asUserIdentityarray.UserIdentity[]getUserArray(String metadataName, UserIdentity[] defaultValues)Deprecated.Returns the named metadata's value asUserIdentityarray.
If the metadata does not exist, the default values are returned.booleanhasComment(String metadataName, int index)Deprecated.Indicates if a metadata has a commentbooleanhasComments(String metadataName)Deprecated.Indicates if a metadata has any commentsbooleanhasMetadata(String metadataName)Deprecated.Tests if a metadata with a given name exists.booleanisMultiple(String metadataName)Deprecated.Test if the given metadata is multiple.voidremoveMetadata(String metadataName)Deprecated.Removes the given metadata.voidrename(String newName)Deprecated.Rename the current metadatavoidsetMetadata(String metadataName, boolean value)Deprecated.Set a boolean metadata.voidsetMetadata(String metadataName, boolean[] values)Deprecated.Set a multi-valued boolean metadata.voidsetMetadata(String metadataName, double value)Deprecated.Set a double metadata.voidsetMetadata(String metadataName, double[] values)Deprecated.Set a multi-valued double metadata.voidsetMetadata(String metadataName, long value)Deprecated.Set a long metadata.voidsetMetadata(String metadataName, long[] values)Deprecated.Set a multi-valued long metadata.voidsetMetadata(String metadataName, String value)Deprecated.Set a string metadata.voidsetMetadata(String metadataName, String[] value)Deprecated.Set a multi-valued string metadata.voidsetMetadata(String metadataName, String value, Locale locale)Deprecated.Set a multilingual string metadata.voidsetMetadata(String metadataName, Date value)Deprecated.Set a date metadata.voidsetMetadata(String metadataName, Date[] values)Deprecated.Set a multi-valued date metadata.voidsetMetadata(String metadataName, UserIdentity value)Deprecated.Set aUserIdentitymetadata.voidsetMetadata(String metadataName, UserIdentity[] values)Deprecated.Set a multi-valuedUserIdentitymetadata.voidsetMetadata(String metadataName, MultilingualString value)Deprecated.Set aMultilingualStringmetadata.
-
-
-
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
-
__metadataNamePattern
private static Pattern __metadataNamePattern
Deprecated.
-
_lockAlreadyChecked
private boolean _lockAlreadyChecked
Deprecated.
-
_resolver
private AmetysObjectResolver _resolver
Deprecated.
-
-
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:CompositeMetadataTests if a metadata with a given name exists.- Specified by:
hasMetadatain interfaceCompositeMetadata- Parameters:
metadataName- the metadataName to test.- Returns:
trueif the given metadata exists,falseotherwise.- Throws:
AmetysRepositoryException- if an error occurs.
-
rename
public void rename(String newName) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadataRename the current metadata- Specified by:
renamein 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:ModifiableCompositeMetadataRemoves the given metadata.- Specified by:
removeMetadatain 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:CompositeMetadataCopy the currentCompositeMetadatato the given composite metadata.- Specified by:
copyToin interfaceCompositeMetadata- Parameters:
metadata- The parent composite metadata. Can not be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
_copyDataFolder
private void _copyDataFolder(ModifiableFolder srcDataFolder, ModifiableFolder targetDataFolder)
Deprecated.
-
_copyFile
private void _copyFile(ModifiableFile srcFile, ModifiableFolder targetDataFolder)
Deprecated.
-
getType
public CompositeMetadata.MetadataType getType(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the type of the given metadata.- Specified by:
getTypein 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:CompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown.- Specified by:
getStringin 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:CompositeMetadataReturns 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:
getStringin 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.
-
_getString
private String _getString(String metadataName, String defaultValue, boolean failIfNotExist)
Deprecated.
-
getStringArray
public String[] getStringArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value as String array.- Specified by:
getStringArrayin 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:CompositeMetadataReturns the named metadata's value as String array.
If the metadata does not exist, the default values are returned.- Specified by:
getStringArrayin interfaceCompositeMetadata- Parameters:
metadataName- metadata name.defaultValues- the default values.- Returns:
- metadata value as String array or the default values if metadata is not set.
-
_getStringArray
private String[] _getStringArray(String metadataName, String[] defaultValues, boolean failIfNotExist)
Deprecated.
-
getLocalizedString
public String getLocalizedString(String metadataName, Locale locale) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value of a multilingual metadata as String.- Specified by:
getLocalizedStringin 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:CompositeMetadataReturns the named metadata's value of a multilingual metadata as String.
If the metadata does not exist, the default value is returned.- Specified by:
getLocalizedStringin 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:CompositeMetadataReturns the named metadata's values of a multilingual metadata.- Specified by:
getMultilingualStringin interfaceCompositeMetadata- Parameters:
metadataName- the metadata name.- Returns:
- the metadata values for all existing locales
- Throws:
AmetysRepositoryException- if an error occurs.
-
_getString
private String _getString(String metadataName, Locale locale, String defaultValue, boolean failIfNotExist)
Deprecated.
-
getBoolean
public boolean getBoolean(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown.- Specified by:
getBooleanin 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:CompositeMetadataReturns 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:
getBooleanin 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.
-
_getBoolean
private boolean _getBoolean(String metadataName, Boolean defaultValue, boolean failIfNotExist)
Deprecated.
-
getBooleanArray
public boolean[] getBooleanArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value as boolean array.- Specified by:
getBooleanArrayin 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:CompositeMetadataReturns the named metadata's value as boolean array.
If the metadata does not exist, the default values are returned.- Specified by:
getBooleanArrayin interfaceCompositeMetadata- Parameters:
metadataName- metadata name.defaultValues- the default values.- Returns:
- metadata value as boolean array or the default values if metadata is not set.
-
_getBooleanArray
private boolean[] _getBooleanArray(String metadataName, boolean[] defaultValues, boolean failIfNotExist)
Deprecated.
-
getDate
public Date getDate(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown.- Specified by:
getDatein 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:CompositeMetadataReturns 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:
getDatein 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.
-
_getDate
private Date _getDate(String metadataName, Date defaultValue, boolean failIfNotExist)
Deprecated.
-
getDateArray
public Date[] getDateArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value as Date array.- Specified by:
getDateArrayin 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:CompositeMetadataReturns the named metadata's value as Date array.
If the metadata does not exist, the default values are returned.- Specified by:
getDateArrayin interfaceCompositeMetadata- Parameters:
metadataName- metadata name.defaultValues- the default values.- Returns:
- metadata value as Date array or the default values if metadata is not set.
-
_getDateArray
private Date[] _getDateArray(String metadataName, Date[] defaultValues, boolean failIfNotExist)
Deprecated.
-
getLong
public long getLong(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown.- Specified by:
getLongin 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:CompositeMetadataReturns 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:
getLongin 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.
-
_getLong
private long _getLong(String metadataName, Long defaultValue, boolean failIfNotExist)
Deprecated.
-
getLongArray
public long[] getLongArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value as long array.- Specified by:
getLongArrayin 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:CompositeMetadataReturns the named metadata's value as long array.
If the metadata does not exist, the default values are returned.- Specified by:
getLongArrayin interfaceCompositeMetadata- Parameters:
metadataName- metadata name.defaultValues- the default values.- Returns:
- metadata value as long array or the default values if metadata is not set.
-
_getLongArray
private long[] _getLongArray(String metadataName, long[] defaultValues, boolean failIfNotExist)
Deprecated.
-
getDouble
public double getDouble(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown.- Specified by:
getDoublein 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:CompositeMetadataReturns 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:
getDoublein 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.
-
_getDouble
private double _getDouble(String metadataName, Double defaultValue, boolean failIfNotExist)
Deprecated.
-
getDoubleArray
public double[] getDoubleArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value as double array.- Specified by:
getDoubleArrayin 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:CompositeMetadataReturns the named metadata's value as double array.
If the metadata does not exist, the default values are returned.- Specified by:
getDoubleArrayin interfaceCompositeMetadata- Parameters:
metadataName- metadata name.defaultValues- the default values.- Returns:
- metadata value as double array or the default values if metadata is not set.
-
_getDoubleArray
private double[] _getDoubleArray(String metadataName, double[] defaultValues, boolean failIfNotExist)
Deprecated.
-
getUser
public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value asUserIdentity.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.- Specified by:
getUserin 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:CompositeMetadataReturns the named metadata's value asUserIdentity.
If the metadata does not exist, the default value is returned.- Specified by:
getUserin 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.
-
_getUser
private UserIdentity _getUser(String metadataName, UserIdentity defaultValue, boolean failIfNotExist) throws AmetysRepositoryException
Deprecated.- Throws:
AmetysRepositoryException
-
getUserArray
public UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns the named metadata's value asUserIdentityarray.- Specified by:
getUserArrayin 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:CompositeMetadataReturns the named metadata's value asUserIdentityarray.
If the metadata does not exist, the default values are returned.- Specified by:
getUserArrayin 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.
-
_getUserArray
private UserIdentity[] _getUserArray(String metadataName, UserIdentity[] defaultValues, boolean failIfNotExist) throws AmetysRepositoryException
Deprecated.- Throws:
AmetysRepositoryException
-
setMetadata
public void setMetadata(String metadataName, String value) throws AmetysRepositoryException
Deprecated.Description copied from interface:ModifiableCompositeMetadataSet a string metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multi-valued string metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multilingual string metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a date metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multi-valued date metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a long metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a double metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multi-valued long metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multi-valued double metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a boolean metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet a multi-valued boolean metadata.- Specified by:
setMetadatain 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:ModifiableCompositeMetadataSet aUserIdentitymetadata.- Specified by:
setMetadatain interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.value- theUserIdentityvalue 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:ModifiableCompositeMetadataSet a multi-valuedUserIdentitymetadata.- Specified by:
setMetadatain interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.values- theUserIdentityarray 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:ModifiableCompositeMetadataSet aMultilingualStringmetadata.- Specified by:
setMetadatain interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.value- theMultilingualStringvalue- Throws:
AmetysRepositoryException- if the metadata cannot be set.
-
getMetadataNames
public String[] getMetadataNames() throws AmetysRepositoryException
Deprecated.Description copied from interface:CompositeMetadataReturns an array containing metadata names.- Specified by:
getMetadataNamesin 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:CompositeMetadataTest if the given metadata is multiple.- Specified by:
isMultiplein interfaceCompositeMetadata- Parameters:
metadataName- the metadata name.- Returns:
trueif the given metadata is multiple,falseotherwise.- 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:CompositeMetadataReturns the named metadata's value asBinaryMetadata.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.- Specified by:
getBinaryMetadatain interfaceCompositeMetadata- Specified by:
getBinaryMetadatain 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:ModifiableCompositeMetadataReturns the named metadata's value asBinaryMetadata.
If the metadata does not exist and createNew isfalse, anUnknownMetadataExceptionis thrown. Otherwise, the metadata is automatically created.- Specified by:
getBinaryMetadatain interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.createNew-trueto create automatically theBinaryMetadatawhen 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:CompositeMetadataReturns the named metadata's value asCompositeMetadata.
If the metadata is multi-valued, one of the value is returned.
If the metadata does not exist anUnknownMetadataExceptionis thrown.- Specified by:
getCompositeMetadatain interfaceCompositeMetadata- Specified by:
getCompositeMetadatain 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:ModifiableCompositeMetadataReturns 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, anUnknownMetadataExceptionis thrown. Otherwise, the metadata is automatically created.- Specified by:
getCompositeMetadatain interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.createNew-trueto create automatically theCompositeMetadatawhen 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:CompositeMetadataReturns the named metadata's value asRichText.
If the metadata does not exist, anUnknownMetadataExceptionis thrown.- Specified by:
getRichTextin interfaceCompositeMetadata- Specified by:
getRichTextin 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:ModifiableCompositeMetadataReturns the named metadata's value asRichText.
If the metadata does not exist and createNew isfalse, anUnknownMetadataExceptionis thrown. Otherwise, the metadata is automatically created.- Specified by:
getRichTextin interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.createNew-trueto create automatically theBinaryMetadatawhen 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:CompositeMetadataReturns an object collection metadata as aTraversableAmetysObject
.- Specified by:
getObjectCollectionin interfaceCompositeMetadata- Specified by:
getObjectCollectionin 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:ModifiableCompositeMetadataReturns an object collection metadata as aTraversableAmetysObject
. If the metadata does not exist and createNew isfalse, anUnknownMetadataExceptionis thrown. Otherwise, the metadata is automatically created.- Specified by:
getObjectCollectionin interfaceModifiableCompositeMetadata- Parameters:
metadataName- the metadata name.createNew-trueto create automatically theCompositeMetadatawhen 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:CommentableCompositeMetadataRetrieves the comments of a metadata- Specified by:
getCommentsin interfaceCommentableCompositeMetadata- Parameters:
metadataName- The metadata name- Returns:
- the list of
MetadataComment
-
hasComments
public boolean hasComments(String metadataName)
Deprecated.Description copied from interface:CommentableCompositeMetadataIndicates if a metadata has any comments- Specified by:
hasCommentsin 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:CommentableCompositeMetadataIndicates if a metadata has a comment- Specified by:
hasCommentin 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:CommentableCompositeMetadataAdd a metadata comment.- Specified by:
addCommentin 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:CommentableCompositeMetadataEdit the text of a metadata comment.- Specified by:
editCommentin 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:CommentableCompositeMetadataDelete a metadata comment.- Specified by:
deleteCommentin interfaceCommentableCompositeMetadata- Parameters:
metadataName- The metadata nameindex- The comment index
-
_checkLock
private void _checkLock() throws RepositoryException
Deprecated.- Throws:
RepositoryException
-
-