Package org.dspace.content.service
Interface MetadataSchemaService
-
- All Known Implementing Classes:
MetadataSchemaServiceImpl
public interface MetadataSchemaServiceService interface class for the MetadataSchema object. The implementation of this class is responsible for all business logic calls for the MetadataSchema object and is autowired by spring- Author:
- kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MetadataSchemacreate(Context context, String name, String namespace)Creates a new metadata schema in the database, using the name and namespace.voiddelete(Context context, MetadataSchema metadataSchema)Delete the metadata schema.MetadataSchemafind(Context context, int id)Get the schema corresponding with this numeric ID.MetadataSchemafind(Context context, String shortName)Get the schema corresponding with this short name.List<MetadataSchema>findAll(Context context)Return all metadata schemas.MetadataSchemafindByNamespace(Context context, String namespace)Get the schema object corresponding to this namespace URI.voidupdate(Context context, MetadataSchema metadataSchema)Update the metadata schema in the database.
-
-
-
Method Detail
-
create
MetadataSchema create(Context context, String name, String namespace) throws SQLException, AuthorizeException, NonUniqueMetadataException
Creates a new metadata schema in the database, using the name and namespace.- Parameters:
context- DSpace context objectname- namenamespace- namespace- Returns:
- new MetadataSchema
- Throws:
SQLException- if database errorAuthorizeException- if authorization errorNonUniqueMetadataException- if an existing field with an identical element and qualifier is already present
-
findByNamespace
MetadataSchema findByNamespace(Context context, String namespace) throws SQLException
Get the schema object corresponding to this namespace URI.- Parameters:
context- DSpace contextnamespace- namespace URI to match- Returns:
- metadata schema object or null if none found.
- Throws:
SQLException- if database error
-
update
void update(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException, NonUniqueMetadataException
Update the metadata schema in the database.- Parameters:
context- DSpace contextmetadataSchema- metadata schema- Throws:
SQLException- if database errorAuthorizeException- if authorization errorNonUniqueMetadataException- if an existing field with an identical element and qualifier is already present
-
delete
void delete(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException
Delete the metadata schema.- Parameters:
context- DSpace contextmetadataSchema- metadata schema- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
findAll
List<MetadataSchema> findAll(Context context) throws SQLException
Return all metadata schemas.- Parameters:
context- DSpace context- Returns:
- array of metadata schemas
- Throws:
SQLException- if database error
-
find
MetadataSchema find(Context context, int id) throws SQLException
Get the schema corresponding with this 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 schema ID- Returns:
- the metadata schema object
- Throws:
SQLException- if database error
-
find
MetadataSchema find(Context context, String shortName) throws SQLException
Get the schema corresponding with this short name.- Parameters:
context- context, in case we need to read it in from DBshortName- the short name for the schema- Returns:
- the metadata schema object
- Throws:
SQLException- if database error
-
-