Package org.dspace.content.service
Interface MetadataValueService
-
- All Known Implementing Classes:
MetadataValueServiceImpl
public interface MetadataValueServiceService interface class for the MetadataValue object. The implementation of this class is responsible for all business logic calls for the MetadataValue object and is autowired by spring- Author:
- kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountTotal(Context context)MetadataValuecreate(Context context, DSpaceObject dso, MetadataField metadataField)Creates a new metadata value.voiddelete(Context context, MetadataValue metadataValue)Delete the metadata field.voiddeleteByMetadataField(Context context, MetadataField metadataField)MetadataValuefind(Context context, int valueId)Retrieves the metadata value from the database.List<MetadataValue>findByField(Context context, MetadataField metadataField)Retrieves the metadata values for a given field from the database.Iterator<MetadataValue>findByFieldAndValue(Context context, MetadataField metadataField, String value)Retrieves matching MetadataValues for a given field and value.Iterator<MetadataValue>findByValueLike(Context context, String value)MetadataValuegetMinimum(Context context, int metadataFieldId)Get the minimum value of a given metadata field across all objects.voidupdate(Context context, MetadataValue metadataValue)Update the metadata value in the database.voidupdate(Context context, MetadataValue metadataValue, boolean modifyParentObject)
-
-
-
Method Detail
-
create
MetadataValue create(Context context, DSpaceObject dso, MetadataField metadataField) throws SQLException
Creates a new metadata value.- Parameters:
context- DSpace context objectdso- DSpaceObjectmetadataField- metadata field- Returns:
- new MetadataValue
- Throws:
SQLException- if database error
-
find
MetadataValue find(Context context, int valueId) throws IOException, SQLException
Retrieves the metadata value from the database.- Parameters:
context- dspace contextvalueId- database key id of value- Returns:
- recalled metadata value
- Throws:
IOException- if IO errorSQLException- if database error
-
findByField
List<MetadataValue> findByField(Context context, MetadataField metadataField) throws IOException, SQLException
Retrieves the metadata values for a given field from the database.- Parameters:
context- dspace contextmetadataField- metadata field whose values to look for- Returns:
- a collection of metadata values
- Throws:
IOException- if IO errorSQLException- if database error
-
findByFieldAndValue
Iterator<MetadataValue> findByFieldAndValue(Context context, MetadataField metadataField, String value) throws SQLException
Retrieves matching MetadataValues for a given field and value.- Parameters:
context- dspace contextmetadataField- The field that must matchvalue- The value that must match- Returns:
- the matching MetadataValues
- Throws:
SQLException- if database error
-
update
void update(Context context, MetadataValue metadataValue) throws SQLException
Update the metadata value in the database.- Parameters:
context- dspace contextmetadataValue- metadata value- Throws:
SQLException- if database error
-
update
void update(Context context, MetadataValue metadataValue, boolean modifyParentObject) throws SQLException, AuthorizeException
- Throws:
SQLExceptionAuthorizeException
-
delete
void delete(Context context, MetadataValue metadataValue) throws SQLException
Delete the metadata field.- Parameters:
context- dspace contextmetadataValue- metadata value- Throws:
SQLException- if database error
-
findByValueLike
Iterator<MetadataValue> findByValueLike(Context context, String value) throws SQLException
- Throws:
SQLException
-
deleteByMetadataField
void deleteByMetadataField(Context context, MetadataField metadataField) throws SQLException
- Throws:
SQLException
-
getMinimum
MetadataValue getMinimum(Context context, int metadataFieldId) throws SQLException
Get the minimum value of a given metadata field across all objects.- Parameters:
context- dspace contextmetadataFieldId- unique identifier of the interesting field.- Returns:
- the minimum value of the metadata field
- Throws:
SQLException- if database error
-
countTotal
int countTotal(Context context) throws SQLException
- Throws:
SQLException
-
-