Class MetadataField
java.lang.Object
org.opencastproject.metadata.dublincore.MetadataField
This is a generic and very abstract view of a certain field/property in a metadata catalog. The main purpose of this
class is to have a generic access to the variety of information stored in metadata catalogs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible types for the metadata field. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetadataField(String inputID, String outputID, String label, boolean readOnly, boolean required, Object value, Boolean translatable, MetadataField.Type type, Map<String, String> collection, String collectionID, Integer order, String namespace, String listprovider, String pattern, String delimiter) Metadata field constructorMetadataField(MetadataField other) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataFieldcreateMetadataField(Map<String, String> configuration) getLabel()getOrder()static SimpleDateFormatgetSimpleDateFormatter(String pattern) getType()getValue()booleanbooleanbooleanvoidsetCollection(Map<String, String> collection) Set the option of a limited list of possible values.voidsetCollectionID(String collectionID) voidsetDelimiter(String delimiter) voidvoidsetIsTranslatable(Boolean translatable) voidsetPattern(String pattern) voidsetReadOnly(boolean readOnly) voidsetType(MetadataField.Type type) voidsetUpdated(boolean updated) voidvoid
-
Field Details
-
CONFIG_COLLECTION_ID_KEY
Keys for the different values in the configuration file- See Also:
-
CONFIG_INPUT_ID_KEY
- See Also:
-
CONFIG_LABEL_KEY
- See Also:
-
CONFIG_LIST_PROVIDER_KEY
- See Also:
-
CONFIG_PROPERTY_PREFIX
- See Also:
-
CONFIG_READ_ONLY_KEY
- See Also:
-
CONFIG_REQUIRED_KEY
- See Also:
-
CONFIG_TYPE_KEY
- See Also:
-
-
Constructor Details
-
MetadataField
Copy constructor- Parameters:
other- Other metadata field
-
MetadataField
public MetadataField(String inputID, String outputID, String label, boolean readOnly, boolean required, Object value, Boolean translatable, MetadataField.Type type, Map<String, String> collection, String collectionID, Integer order, String namespace, String listprovider, String pattern, String delimiter) throws IllegalArgumentExceptionMetadata field constructor- Parameters:
inputID- The identifier of the new metadata fieldlabel- the label of the field. The string displayed next to the field value on the frontend. This is usually be a translation keyreadOnly- Define if the new metadata field can be or not editedrequired- Define if the new metadata field is or not requiredvalue- The metadata field valuetype- The metadata field type @ EventMetadata.Type}collection- If the field has a limited list of possible value, the option should contain this one. Otherwise it should be none. This is also possible to use the collectionId parameter for that.collectionID- The id of the limit list of possible value that should be get through the resource endpoint.listprovider- An optional list provider IDpattern- Pattern for time/date fieldsdelimiter- Delimiter- Throws:
IllegalArgumentException- if the id, label, type parameters is/are null
-
-
Method Details
-
setCollection
Set the option of a limited list of possible values.- Parameters:
collection- The option of a limited list of possible values
-
getCollection
-
getValue
-
isTranslatable
-
isUpdated
public boolean isUpdated() -
setValue
-
setValue
-
setIsTranslatable
-
getSimpleDateFormatter
-
createMetadataField
-
getCollectionID
-
setCollectionID
-
getInputID
-
getLabel
-
getListprovider
-
getNamespace
-
getOrder
-
getOutputID
- Returns:
- The outputID if available, inputID if it is missing.
-
getPattern
-
setPattern
-
getDelimiter
-
setDelimiter
-
setReadOnly
public void setReadOnly(boolean readOnly) -
isReadOnly
public boolean isReadOnly() -
isRequired
public boolean isRequired() -
setUpdated
public void setUpdated(boolean updated) -
getType
-
setType
-
setDifferentValues
public void setDifferentValues() -
hasDifferentValues
-
readOnlyCopy
-