JCRRepositoryData
instead@Deprecated public class JCRCompositeMetadata extends Object implements ModifiableCompositeMetadata, CommentableCompositeMetadata
CompositeMetadata.MetadataType
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__metadataNamePattern
Deprecated.
|
private boolean |
_lockAlreadyChecked
Deprecated.
|
private Node |
_node
Deprecated.
|
private AmetysObjectResolver |
_resolver
Deprecated.
|
static String |
METADATA_COMMENTS_SUFFIX
Deprecated.
Comments metadata suffix
|
static String |
METADATA_PREFIX
Deprecated.
Prefix for jcr properties and nodes names
|
static 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 and Description |
---|
JCRCompositeMetadata(Node metadataNode,
AmetysObjectResolver resolver)
Deprecated.
Constructor
|
Modifier and Type | Method and 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,
Locale locale,
String defaultValue,
boolean failIfNotExist)
Deprecated.
|
private String |
_getString(String metadataName,
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.
|
void |
addComment(String metadataName,
String text,
String author,
Date date)
Deprecated.
Add a metadata comment.
|
void |
copyTo(ModifiableCompositeMetadata metadata)
Deprecated.
Copy the current
CompositeMetadata 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 as
BinaryMetadata .If the metadata does not exist, an UnknownMetadataException is thrown. |
ModifiableBinaryMetadata |
getBinaryMetadata(String metadataName,
boolean createNew)
Deprecated.
Returns the named metadata's value as
BinaryMetadata .If the metadata does not exist and createNew is false , an UnknownMetadataException 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, an UnknownMetadataException 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 metadata
|
ModifiableCompositeMetadata |
getCompositeMetadata(String metadataName)
Deprecated.
Returns the named metadata's value as
CompositeMetadata .If the metadata is multi-valued, one of the value is returned. If the metadata does not exist an UnknownMetadataException is thrown. |
ModifiableCompositeMetadata |
getCompositeMetadata(String metadataName,
boolean createNew)
Deprecated.
Returns the named metadata's value as
CompositeMetadata .If the metadata is multi-valued, one of the value is returned. If the metadata does not exist and createNew is false , an UnknownMetadataException 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, an UnknownMetadataException 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, an UnknownMetadataException 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, an UnknownMetadataException 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 a
TraversableAmetysObject . |
ModifiableTraversableAmetysObject |
getObjectCollection(String metadataName,
boolean createNew)
Deprecated.
Returns an object collection metadata as a
TraversableAmetysObject . |
ModifiableRichText |
getRichText(String metadataName)
Deprecated.
Returns the named metadata's value as
RichText .If the metadata does not exist, an UnknownMetadataException is thrown. |
ModifiableRichText |
getRichText(String metadataName,
boolean createNew)
Deprecated.
Returns the named metadata's value as
RichText .If the metadata does not exist and createNew is false , an UnknownMetadataException 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, an UnknownMetadataException 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 as
UserIdentity .If the metadata does not exist, an UnknownMetadataException is thrown. |
UserIdentity |
getUser(String metadataName,
UserIdentity defaultValue)
Deprecated.
Returns the named metadata's value as
UserIdentity .If the metadata does not exist, the default value is returned. |
UserIdentity[] |
getUserArray(String metadataName)
Deprecated.
Returns the named metadata's value as
UserIdentity array. |
UserIdentity[] |
getUserArray(String metadataName,
UserIdentity[] defaultValues)
Deprecated.
Returns the named metadata's value as
UserIdentity 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 comment
|
boolean |
hasComments(String metadataName)
Deprecated.
Indicates if a metadata has any comments
|
boolean |
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 metadata
|
void |
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,
Date value)
Deprecated.
Set a date metadata.
|
void |
setMetadata(String metadataName,
Date[] values)
Deprecated.
Set a multi-valued date 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,
MultilingualString value)
Deprecated.
Set a
MultilingualString 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,
UserIdentity value)
Deprecated.
Set a
UserIdentity metadata. |
void |
setMetadata(String metadataName,
UserIdentity[] values)
Deprecated.
Set a multi-valued
UserIdentity metadata. |
public static final String METADATA_PREFIX
public static final String METADATA_COMMENTS_SUFFIX
public static final String OBJECT_COLLECTION_METADATA_NODETYPE
public static final String MULTILINGUAL_STRING_METADATA_NODETYPE
private static Pattern __metadataNamePattern
private boolean _lockAlreadyChecked
private AmetysObjectResolver _resolver
public JCRCompositeMetadata(Node metadataNode, AmetysObjectResolver resolver)
metadataNode
- the Node supporting this composite metadataresolver
- The resolver, used to resolve object collections.public Node getNode()
public boolean hasMetadata(String metadataName) throws AmetysRepositoryException
CompositeMetadata
hasMetadata
in interface CompositeMetadata
metadataName
- the metadataName to test.true
if the given metadata exists, false
otherwise.AmetysRepositoryException
- if an error occurs.public void rename(String newName) throws AmetysRepositoryException
ModifiableCompositeMetadata
rename
in interface ModifiableCompositeMetadata
newName
- the new nameAmetysRepositoryException
- if an error occurs.public void removeMetadata(String metadataName) throws AmetysRepositoryException
ModifiableCompositeMetadata
removeMetadata
in interface ModifiableCompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the metadata does not exist.AmetysRepositoryException
- if an error occurs.public void copyTo(ModifiableCompositeMetadata metadata) throws AmetysRepositoryException
CompositeMetadata
CompositeMetadata
to the given composite metadata.copyTo
in interface CompositeMetadata
metadata
- The parent composite metadata. Can not be null.AmetysRepositoryException
- if an error occurs.private void _copyDataFolder(ModifiableFolder srcDataFolder, ModifiableFolder targetDataFolder)
private void _copyFile(ModifiableFile srcFile, ModifiableFolder targetDataFolder)
public CompositeMetadata.MetadataType getType(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getType
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public String getString(String metadataName)
CompositeMetadata
UnknownMetadataException
is thrown.getString
in interface CompositeMetadata
metadataName
- the metadata name.public String getString(String metadataName, String defaultValue)
CompositeMetadata
getString
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.private String _getString(String metadataName, String defaultValue, boolean failIfNotExist)
public String[] getStringArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getStringArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public String[] getStringArray(String metadataName, String[] defaultValues)
CompositeMetadata
getStringArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.private String[] _getStringArray(String metadataName, String[] defaultValues, boolean failIfNotExist)
public String getLocalizedString(String metadataName, Locale locale) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getLocalizedString
in interface CompositeMetadata
metadataName
- the metadata name.locale
- the locale of value to retrieveUnknownMetadataException
- if the named metadata does not exist for the given locale.AmetysRepositoryException
- if an error occurs.public String getLocalizedString(String metadataName, Locale locale, String defaultValue) throws AmetysRepositoryException
CompositeMetadata
getLocalizedString
in interface CompositeMetadata
metadataName
- the metadata name.locale
- the locale of value to retrievedefaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public MultilingualString getMultilingualString(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getMultilingualString
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.private String _getString(String metadataName, Locale locale, String defaultValue, boolean failIfNotExist)
public boolean getBoolean(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getBoolean
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean getBoolean(String metadataName, boolean defaultValue) throws AmetysRepositoryException
CompositeMetadata
getBoolean
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.private boolean _getBoolean(String metadataName, Boolean defaultValue, boolean failIfNotExist)
public boolean[] getBooleanArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getBooleanArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean[] getBooleanArray(String metadataName, boolean[] defaultValues)
CompositeMetadata
getBooleanArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.private boolean[] _getBooleanArray(String metadataName, boolean[] defaultValues, boolean failIfNotExist)
public Date getDate(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getDate
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public Date getDate(String metadataName, Date defaultValue) throws AmetysRepositoryException
CompositeMetadata
getDate
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.private Date _getDate(String metadataName, Date defaultValue, boolean failIfNotExist)
public Date[] getDateArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getDateArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public Date[] getDateArray(String metadataName, Date[] defaultValues)
CompositeMetadata
getDateArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.private Date[] _getDateArray(String metadataName, Date[] defaultValues, boolean failIfNotExist)
public long getLong(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getLong
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public long getLong(String metadataName, long defaultValue) throws AmetysRepositoryException
CompositeMetadata
getLong
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.private long _getLong(String metadataName, Long defaultValue, boolean failIfNotExist)
public long[] getLongArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getLongArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public long[] getLongArray(String metadataName, long[] defaultValues)
CompositeMetadata
getLongArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.private long[] _getLongArray(String metadataName, long[] defaultValues, boolean failIfNotExist)
public double getDouble(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getDouble
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public double getDouble(String metadataName, double defaultValue) throws AmetysRepositoryException
CompositeMetadata
getDouble
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.private double _getDouble(String metadataName, Double defaultValue, boolean failIfNotExist)
public double[] getDoubleArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getDoubleArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public double[] getDoubleArray(String metadataName, double[] defaultValues)
CompositeMetadata
getDoubleArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.private double[] _getDoubleArray(String metadataName, double[] defaultValues, boolean failIfNotExist)
public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
.UnknownMetadataException
is thrown.getUser
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.public UserIdentity getUser(String metadataName, UserIdentity defaultValue) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
.getUser
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.private UserIdentity _getUser(String metadataName, UserIdentity defaultValue, boolean failIfNotExist) throws AmetysRepositoryException
AmetysRepositoryException
public UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
array.getUserArray
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.public UserIdentity[] getUserArray(String metadataName, UserIdentity[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
array.getUserArray
in interface CompositeMetadata
metadataName
- the metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.private UserIdentity[] _getUserArray(String metadataName, UserIdentity[] defaultValues, boolean failIfNotExist) throws AmetysRepositoryException
AmetysRepositoryException
public void setMetadata(String metadataName, String value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the String value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, String[] value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the String array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, String value, Locale locale) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the String value of this metadata in the given locale.locale
- The value of localeAmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, Date value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the Date value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, Date[] values) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.values
- the Date array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, long value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the integer value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, double value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the integer value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, long[] values) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.values
- the integer array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, double[] values) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.values
- the integer array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, boolean value) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the boolean value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, boolean[] values) throws AmetysRepositoryException
ModifiableCompositeMetadata
setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.values
- the boolean array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, UserIdentity value) throws AmetysRepositoryException
ModifiableCompositeMetadata
UserIdentity
metadata.setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the UserIdentity
value of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, UserIdentity[] values) throws AmetysRepositoryException
ModifiableCompositeMetadata
UserIdentity
metadata.setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.values
- the UserIdentity
array containing values of this metadata.AmetysRepositoryException
- if the metadata cannot be set.public void setMetadata(String metadataName, MultilingualString value) throws AmetysRepositoryException
ModifiableCompositeMetadata
MultilingualString
metadata.setMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.value
- the MultilingualString
valueAmetysRepositoryException
- if the metadata cannot be set.public String[] getMetadataNames() throws AmetysRepositoryException
CompositeMetadata
getMetadataNames
in interface CompositeMetadata
AmetysRepositoryException
- if an error occurs.public boolean isMultiple(String metadataName) throws AmetysRepositoryException
CompositeMetadata
isMultiple
in interface CompositeMetadata
metadataName
- the metadata name.true
if the given metadata is multiple,
false
otherwise.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.protected void _checkMetadataName(String metadataName) throws AmetysRepositoryException
metadataName
- The metadata name to check.AmetysRepositoryException
- If the metadata name is invalid.protected static Pattern _getMetadataNamePattern()
public ModifiableBinaryMetadata getBinaryMetadata(String metadataName) throws AmetysRepositoryException
CompositeMetadata
BinaryMetadata
.UnknownMetadataException
is thrown.getBinaryMetadata
in interface CompositeMetadata
getBinaryMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableBinaryMetadata getBinaryMetadata(String metadataName, boolean createNew) throws AmetysRepositoryException
ModifiableCompositeMetadata
BinaryMetadata
.false
, an UnknownMetadataException
is thrown.
Otherwise, the metadata is automatically created.getBinaryMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.createNew
- true
to create automatically the BinaryMetadata
when missing.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableCompositeMetadata getCompositeMetadata(String metadataName) throws AmetysRepositoryException
CompositeMetadata
CompositeMetadata
.UnknownMetadataException
is thrown.getCompositeMetadata
in interface CompositeMetadata
getCompositeMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.CompositeMetadata
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableCompositeMetadata getCompositeMetadata(String metadataName, boolean createNew) throws AmetysRepositoryException
ModifiableCompositeMetadata
CompositeMetadata
.false
, an UnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.getCompositeMetadata
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.createNew
- true
to create automatically the CompositeMetadata
when missing.CompositeMetadata
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableRichText getRichText(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
RichText
.UnknownMetadataException
is thrown.getRichText
in interface CompositeMetadata
getRichText
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableRichText getRichText(String metadataName, boolean createNew) throws UnknownMetadataException, AmetysRepositoryException
ModifiableCompositeMetadata
RichText
.false
, an UnknownMetadataException
is thrown.
Otherwise, the metadata is automatically created.getRichText
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.createNew
- true
to create automatically the BinaryMetadata
when missing.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableTraversableAmetysObject getObjectCollection(String metadataName) throws AmetysRepositoryException
CompositeMetadata
TraversableAmetysObject
getObjectCollection
in interface CompositeMetadata
getObjectCollection
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.TraversableAmetysObject
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public ModifiableTraversableAmetysObject getObjectCollection(String metadataName, boolean createNew) throws AmetysRepositoryException
ModifiableCompositeMetadata
TraversableAmetysObject
false
, an UnknownMetadataException
is thrown. Otherwise, the metadata is automatically created.getObjectCollection
in interface ModifiableCompositeMetadata
metadataName
- the metadata name.createNew
- true
to create automatically the CompositeMetadata
when missing.TraversableAmetysObject
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public List<MetadataComment> getComments(String metadataName)
CommentableCompositeMetadata
getComments
in interface CommentableCompositeMetadata
metadataName
- The metadata nameMetadataComment
public boolean hasComments(String metadataName)
CommentableCompositeMetadata
hasComments
in interface CommentableCompositeMetadata
metadataName
- The metadata namepublic boolean hasComment(String metadataName, int index)
CommentableCompositeMetadata
hasComment
in interface CommentableCompositeMetadata
metadataName
- The metadata nameindex
- The comment indexpublic void addComment(String metadataName, String text, String author, Date date)
CommentableCompositeMetadata
addComment
in interface CommentableCompositeMetadata
metadataName
- The metadata nametext
- The text of the commentauthor
- The comment authordate
- The date of the comment (null to use the current date)public void editComment(String metadataName, int index, String text, String author, Date date)
CommentableCompositeMetadata
editComment
in interface CommentableCompositeMetadata
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)public void deleteComment(String metadataName, int index)
CommentableCompositeMetadata
deleteComment
in interface CommentableCompositeMetadata
metadataName
- The metadata nameindex
- The comment indexprivate void _checkLock() throws RepositoryException
RepositoryException