Package org.dspace.content.service
Interface MetadataFieldService
- All Known Implementing Classes:
MetadataFieldServiceImpl
public interface MetadataFieldService
Service interface class for the MetadataField object.
The implementation of this class is responsible for all business logic calls for the MetadataField object and is
autowired by spring
- Author:
- kevinvandevelde at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptioncreate(Context context, MetadataSchema metadataSchema, String element, String qualifier, String scopeNote) Creates a new metadata field.voiddelete(Context context, MetadataField metadataField) Delete the metadata field.Find the field corresponding to the given numeric ID.Retrieve all metadata field types from the registryfindAllInSchema(Context context, MetadataSchema metadataSchema) Return all metadata fields that are found in a given schema.findByElement(Context context, String metadataSchemaName, String element, String qualifier) findByElement(Context context, MetadataSchema metadataSchema, String element, String qualifier) Retrieves the metadata field from the database.findByString(Context context, String mdString, char separator) Separates an mdString in schema, element and qualifier parts, separated by a given separator And returns it's matching metadataField if foundfindFieldsByElementNameUnqualified(Context context, String metadataSchema, String element) voidupdate(Context context, MetadataField metadataField) Update the metadata field in the database.
-
Method Details
-
create
MetadataField create(Context context, MetadataSchema metadataSchema, String element, String qualifier, String scopeNote) throws AuthorizeException, SQLException, NonUniqueMetadataException Creates a new metadata field.- Parameters:
context- DSpace context objectmetadataSchema- schemascopeNote- scope noteelement- elementqualifier- qualifier- Returns:
- new MetadataField
- Throws:
AuthorizeException- if authorization errorSQLException- if database errorNonUniqueMetadataException- if an existing field with an identical element and qualifier is already present
-
find
Find the field corresponding to the given numeric ID. The ID is a database key internal to DSpace.- Parameters:
context- context, in case we need to read it in from DBid- the metadata field ID- Returns:
- the metadata field object
- Throws:
SQLException- if database error
-
findByElement
MetadataField findByElement(Context context, MetadataSchema metadataSchema, String element, String qualifier) throws SQLException Retrieves the metadata field from the database.- Parameters:
context- dspace contextmetadataSchema- schemaelement- element namequalifier- qualifier (may be ANY or null)- Returns:
- recalled metadata field
- Throws:
SQLException- if database error
-
findByElement
MetadataField findByElement(Context context, String metadataSchemaName, String element, String qualifier) throws SQLException - Throws:
SQLException
-
findByString
Separates an mdString in schema, element and qualifier parts, separated by a given separator And returns it's matching metadataField if found- Parameters:
context- dspace contextmdString- String being separated to find corresponding mdField (ex dc.contributor)separator- Separator being used to separate the mdString- Returns:
- Corresponding MetadataField if found
- Throws:
SQLException
-
findFieldsByElementNameUnqualified
List<MetadataField> findFieldsByElementNameUnqualified(Context context, String metadataSchema, String element) throws SQLException - Throws:
SQLException
-
findAll
Retrieve all metadata field types from the registry- Parameters:
context- dspace context- Returns:
- an array of all the Dublin Core types
- Throws:
SQLException- if database error
-
findAllInSchema
List<MetadataField> findAllInSchema(Context context, MetadataSchema metadataSchema) throws SQLException Return all metadata fields that are found in a given schema.- Parameters:
context- dspace contextmetadataSchema- the metadata schema for which we want all our metadata fields- Returns:
- array of metadata fields
- Throws:
SQLException- if database error
-
update
void update(Context context, MetadataField metadataField) throws SQLException, AuthorizeException, NonUniqueMetadataException, IOException Update the metadata field in the database.- Parameters:
context- dspace contextmetadataField- metadata field- Throws:
SQLException- if database errorAuthorizeException- if authorization errorNonUniqueMetadataException- if an existing field with an identical element and qualifier is already presentIOException- if IO error
-
delete
Delete the metadata field.- Parameters:
context- dspace contextmetadataField- metadata field- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-