public class JCRCompositeMetadata extends Object implements ModifiableCompositeMetadata, CommentableCompositeMetadata
CompositeMetadata.MetadataType| Modifier and Type | Field and Description |
|---|---|
private static Pattern |
__metadataNamePattern |
private boolean |
_lockAlreadyChecked |
private Node |
_node |
private AmetysObjectResolver |
_resolver |
static String |
METADATA_COMMENTS_SUFFIX
Comments metadata suffix
|
static String |
METADATA_PREFIX
Prefix for jcr properties and nodes names
|
static String |
MULTILINGUAL_STRING_METADATA_NODETYPE
The JCR nodetype of multilingual metadata.
|
static String |
OBJECT_COLLECTION_METADATA_NODETYPE
The JCR nodetype of object collection metadata.
|
| Constructor and Description |
|---|
JCRCompositeMetadata(Node metadataNode,
AmetysObjectResolver resolver)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
private void |
_checkLock() |
protected void |
_checkMetadataName(String metadataName)
Check if the metadata name is valid.
|
private void |
_copyDataFolder(ModifiableFolder srcDataFolder,
ModifiableFolder targetDataFolder) |
private void |
_copyFile(ModifiableFile srcFile,
ModifiableFolder targetDataFolder) |
private boolean |
_getBoolean(String metadataName,
Boolean defaultValue,
boolean failIfNotExist) |
private boolean[] |
_getBooleanArray(String metadataName,
boolean[] defaultValues,
boolean failIfNotExist) |
private Date |
_getDate(String metadataName,
Date defaultValue,
boolean failIfNotExist) |
private Date[] |
_getDateArray(String metadataName,
Date[] defaultValues,
boolean failIfNotExist) |
private double |
_getDouble(String metadataName,
Double defaultValue,
boolean failIfNotExist) |
private double[] |
_getDoubleArray(String metadataName,
double[] defaultValues,
boolean failIfNotExist) |
private long |
_getLong(String metadataName,
Long defaultValue,
boolean failIfNotExist) |
private long[] |
_getLongArray(String metadataName,
long[] defaultValues,
boolean failIfNotExist) |
protected static Pattern |
_getMetadataNamePattern()
Get the metadata name pattern to test validity.
|
private String |
_getString(String metadataName,
Locale locale,
String defaultValue,
boolean failIfNotExist) |
private String |
_getString(String metadataName,
String defaultValue,
boolean failIfNotExist) |
private String[] |
_getStringArray(String metadataName,
String[] defaultValues,
boolean failIfNotExist) |
private UserIdentity |
_getUser(String metadataName,
UserIdentity defaultValue,
boolean failIfNotExist) |
private UserIdentity[] |
_getUserArray(String metadataName,
UserIdentity[] defaultValues,
boolean failIfNotExist) |
void |
addComment(String metadataName,
String text,
String author,
Date date)
Add a metadata comment.
|
void |
copyTo(ModifiableCompositeMetadata metadata)
Copy the current
CompositeMetadata to the given composite metadata. |
void |
deleteComment(String metadataName,
int index)
Delete a metadata comment.
|
void |
editComment(String metadataName,
int index,
String text,
String author,
Date date)
Edit the text of a metadata comment.
|
ModifiableBinaryMetadata |
getBinaryMetadata(String metadataName)
Returns the named metadata's value as
BinaryMetadata.If the metadata does not exist, an UnknownMetadataException is thrown. |
ModifiableBinaryMetadata |
getBinaryMetadata(String metadataName,
boolean createNew)
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)
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)
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)
Returns the named metadata's value as boolean array.
|
boolean[] |
getBooleanArray(String metadataName,
boolean[] defaultValues)
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)
Retrieves the comments of a metadata
|
ModifiableCompositeMetadata |
getCompositeMetadata(String metadataName)
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)
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)
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)
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)
Returns the named metadata's value as Date array.
|
Date[] |
getDateArray(String metadataName,
Date[] defaultValues)
Returns the named metadata's value as Date array.
If the metadata does not exist, the default values are returned. |
double |
getDouble(String metadataName)
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)
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)
Returns the named metadata's value as double array.
|
double[] |
getDoubleArray(String metadataName,
double[] defaultValues)
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)
Returns the named metadata's value of a multilingual metadata as String.
|
String |
getLocalizedString(String metadataName,
Locale locale,
String defaultValue)
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)
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)
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)
Returns the named metadata's value as long array.
|
long[] |
getLongArray(String metadataName,
long[] defaultValues)
Returns the named metadata's value as long array.
If the metadata does not exist, the default values are returned. |
String[] |
getMetadataNames()
Returns an array containing metadata names.
|
MultilingualString |
getMultilingualString(String metadataName)
Returns the named metadata's values of a multilingual metadata.
|
Node |
getNode()
Retrieves the underlying node.
|
ModifiableTraversableAmetysObject |
getObjectCollection(String metadataName)
Returns an object collection metadata as a
TraversableAmetysObject. |
ModifiableTraversableAmetysObject |
getObjectCollection(String metadataName,
boolean createNew)
Returns an object collection metadata as a
TraversableAmetysObject. |
ModifiableRichText |
getRichText(String metadataName)
Returns the named metadata's value as
RichText.If the metadata does not exist, an UnknownMetadataException is thrown. |
ModifiableRichText |
getRichText(String metadataName,
boolean createNew)
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)
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)
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)
Returns the named metadata's value as String array.
|
String[] |
getStringArray(String metadataName,
String[] defaultValues)
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)
Returns the type of the given metadata.
|
UserIdentity |
getUser(String metadataName)
Returns the named metadata's value as
UserIdentity.If the metadata does not exist, an UnknownMetadataException is thrown. |
UserIdentity |
getUser(String metadataName,
UserIdentity defaultValue)
Returns the named metadata's value as
UserIdentity.If the metadata does not exist, the default value is returned. |
UserIdentity[] |
getUserArray(String metadataName)
Returns the named metadata's value as
UserIdentity array. |
UserIdentity[] |
getUserArray(String metadataName,
UserIdentity[] defaultValues)
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)
Indicates if a metadata has a comment
|
boolean |
hasComments(String metadataName)
Indicates if a metadata has any comments
|
boolean |
hasMetadata(String metadataName)
Tests if a metadata with a given name exists.
|
boolean |
isMultiple(String metadataName)
Test if the given metadata is multiple.
|
void |
removeMetadata(String metadataName)
Removes the given metadata.
|
void |
rename(String newName)
Rename the current metadata
|
void |
setMetadata(String metadataName,
boolean value)
Set a boolean metadata.
|
void |
setMetadata(String metadataName,
boolean[] values)
Set a multi-valued boolean metadata.
|
void |
setMetadata(String metadataName,
Date value)
Set a date metadata.
|
void |
setMetadata(String metadataName,
Date[] values)
Set a multi-valued date metadata.
|
void |
setMetadata(String metadataName,
double value)
Set a double metadata.
|
void |
setMetadata(String metadataName,
double[] values)
Set a multi-valued double metadata.
|
void |
setMetadata(String metadataName,
long value)
Set a long metadata.
|
void |
setMetadata(String metadataName,
long[] values)
Set a multi-valued long metadata.
|
void |
setMetadata(String metadataName,
MultilingualString value)
Set a
MultilingualString metadata. |
void |
setMetadata(String metadataName,
String value)
Set a string metadata.
|
void |
setMetadata(String metadataName,
String[] value)
Set a multi-valued string metadata.
|
void |
setMetadata(String metadataName,
String value,
Locale locale)
Set a multilingual string metadata.
|
void |
setMetadata(String metadataName,
UserIdentity value)
Set a
UserIdentity metadata. |
void |
setMetadata(String metadataName,
UserIdentity[] values)
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 boolean hasMetadata(String metadataName) throws AmetysRepositoryException
CompositeMetadatahasMetadata in interface CompositeMetadatametadataName - the metadataName to test.true if the given metadata exists, false otherwise.AmetysRepositoryException - if an error occurs.public void rename(String newName) throws AmetysRepositoryException
ModifiableCompositeMetadatarename in interface ModifiableCompositeMetadatanewName - the new nameAmetysRepositoryException - if an error occurs.public void removeMetadata(String metadataName) throws AmetysRepositoryException
ModifiableCompositeMetadataremoveMetadata in interface ModifiableCompositeMetadatametadataName - metadata name.UnknownMetadataException - if the metadata does not exist.AmetysRepositoryException - if an error occurs.public void copyTo(ModifiableCompositeMetadata metadata) throws AmetysRepositoryException
CompositeMetadataCompositeMetadata to the given composite metadata.copyTo in interface CompositeMetadatametadata - 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
CompositeMetadatagetType in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public String getString(String metadataName)
CompositeMetadataUnknownMetadataException is thrown.getString in interface CompositeMetadatametadataName - the metadata name.public String getString(String metadataName, String defaultValue)
CompositeMetadatagetString in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.private String _getString(String metadataName, String defaultValue, boolean failIfNotExist)
public String[] getStringArray(String metadataName) throws AmetysRepositoryException
CompositeMetadatagetStringArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public String[] getStringArray(String metadataName, String[] defaultValues)
CompositeMetadatagetStringArray in interface CompositeMetadatametadataName - 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
CompositeMetadatagetLocalizedString in interface CompositeMetadatametadataName - 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
CompositeMetadatagetLocalizedString in interface CompositeMetadatametadataName - 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
CompositeMetadatagetMultilingualString in interface CompositeMetadatametadataName - 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
CompositeMetadataUnknownMetadataException is thrown.getBoolean in interface CompositeMetadatametadataName - 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
CompositeMetadatagetBoolean in interface CompositeMetadatametadataName - 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
CompositeMetadatagetBooleanArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public boolean[] getBooleanArray(String metadataName, boolean[] defaultValues)
CompositeMetadatagetBooleanArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.private boolean[] _getBooleanArray(String metadataName, boolean[] defaultValues, boolean failIfNotExist)
public Date getDate(String metadataName) throws AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getDate in interface CompositeMetadatametadataName - 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
CompositeMetadatagetDate in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public Date[] getDateArray(String metadataName) throws AmetysRepositoryException
CompositeMetadatagetDateArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public Date[] getDateArray(String metadataName, Date[] defaultValues)
CompositeMetadatagetDateArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.private Date[] _getDateArray(String metadataName, Date[] defaultValues, boolean failIfNotExist)
public long getLong(String metadataName) throws AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getLong in interface CompositeMetadatametadataName - 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
CompositeMetadatagetLong in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public long[] getLongArray(String metadataName) throws AmetysRepositoryException
CompositeMetadatagetLongArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public long[] getLongArray(String metadataName, long[] defaultValues)
CompositeMetadatagetLongArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.private long[] _getLongArray(String metadataName, long[] defaultValues, boolean failIfNotExist)
public double getDouble(String metadataName) throws AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getDouble in interface CompositeMetadatametadataName - 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
CompositeMetadatagetDouble in interface CompositeMetadatametadataName - 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
CompositeMetadatagetDoubleArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public double[] getDoubleArray(String metadataName, double[] defaultValues)
CompositeMetadatagetDoubleArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.private double[] _getDoubleArray(String metadataName, double[] defaultValues, boolean failIfNotExist)
public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
CompositeMetadataUserIdentity.UnknownMetadataException is thrown.getUser in interface CompositeMetadatametadataName - the metadata name.AmetysRepositoryException - if an error occurs.public UserIdentity getUser(String metadataName, UserIdentity defaultValue) throws AmetysRepositoryException
CompositeMetadataUserIdentity.getUser in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.private UserIdentity _getUser(String metadataName, UserIdentity defaultValue, boolean failIfNotExist) throws AmetysRepositoryException
AmetysRepositoryExceptionpublic UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
CompositeMetadataUserIdentity array.getUserArray in interface CompositeMetadatametadataName - the metadata name.AmetysRepositoryException - if an error occurs.public UserIdentity[] getUserArray(String metadataName, UserIdentity[] defaultValues) throws AmetysRepositoryException
CompositeMetadataUserIdentity array.getUserArray in interface CompositeMetadatametadataName - the metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.private UserIdentity[] _getUserArray(String metadataName, UserIdentity[] defaultValues, boolean failIfNotExist) throws AmetysRepositoryException
AmetysRepositoryExceptionpublic void setMetadata(String metadataName, String value) throws AmetysRepositoryException
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadatasetMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataUserIdentity metadata.setMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataUserIdentity metadata.setMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataMultilingualString metadata.setMetadata in interface ModifiableCompositeMetadatametadataName - the metadata name.value - the MultilingualString valueAmetysRepositoryException - if the metadata cannot be set.public String[] getMetadataNames() throws AmetysRepositoryException
CompositeMetadatagetMetadataNames in interface CompositeMetadataAmetysRepositoryException - if an error occurs.public boolean isMultiple(String metadataName) throws AmetysRepositoryException
CompositeMetadataisMultiple in interface CompositeMetadatametadataName - 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
CompositeMetadataBinaryMetadata.UnknownMetadataException is thrown.getBinaryMetadata in interface CompositeMetadatagetBinaryMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataBinaryMetadata.false, an UnknownMetadataException is thrown.
Otherwise, the metadata is automatically created.getBinaryMetadata in interface ModifiableCompositeMetadatametadataName - 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
CompositeMetadataCompositeMetadata.UnknownMetadataException is thrown.getCompositeMetadata in interface CompositeMetadatagetCompositeMetadata in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataCompositeMetadata.false, an UnknownMetadataException is thrown. Otherwise, the metadata is automatically created.getCompositeMetadata in interface ModifiableCompositeMetadatametadataName - 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
CompositeMetadataRichText.UnknownMetadataException is thrown.getRichText in interface CompositeMetadatagetRichText in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataRichText.false, an UnknownMetadataException is thrown.
Otherwise, the metadata is automatically created.getRichText in interface ModifiableCompositeMetadatametadataName - 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
CompositeMetadataTraversableAmetysObjectgetObjectCollection in interface CompositeMetadatagetObjectCollection in interface ModifiableCompositeMetadatametadataName - 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
ModifiableCompositeMetadataTraversableAmetysObjectfalse, an UnknownMetadataException is thrown. Otherwise, the metadata is automatically created.getObjectCollection in interface ModifiableCompositeMetadatametadataName - 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)
CommentableCompositeMetadatagetComments in interface CommentableCompositeMetadatametadataName - The metadata nameMetadataCommentpublic boolean hasComments(String metadataName)
CommentableCompositeMetadatahasComments in interface CommentableCompositeMetadatametadataName - The metadata namepublic boolean hasComment(String metadataName, int index)
CommentableCompositeMetadatahasComment in interface CommentableCompositeMetadatametadataName - The metadata nameindex - The comment indexpublic void addComment(String metadataName, String text, String author, Date date)
CommentableCompositeMetadataaddComment in interface CommentableCompositeMetadatametadataName - 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)
CommentableCompositeMetadataeditComment in interface CommentableCompositeMetadatametadataName - 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)
CommentableCompositeMetadatadeleteComment in interface CommentableCompositeMetadatametadataName - The metadata nameindex - The comment indexprivate void _checkLock() throws RepositoryException
RepositoryException