public class MetadataSchemaServiceImpl extends Object implements MetadataSchemaService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected MetadataSchemaDAO |
metadataSchemaDAO |
| Modifier | Constructor and Description |
|---|---|
protected |
MetadataSchemaServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
MetadataSchema |
create(Context context,
String name,
String namespace)
Creates a new metadata schema in the database, using the name and namespace.
|
void |
delete(Context context,
MetadataSchema metadataSchema)
Delete the metadata schema.
|
MetadataSchema |
find(Context context,
int id)
Get the schema corresponding with this numeric ID.
|
MetadataSchema |
find(Context context,
String shortName)
Get the schema corresponding with this short name.
|
List<MetadataSchema> |
findAll(Context context)
Return all metadata schemas.
|
MetadataSchema |
findByNamespace(Context context,
String namespace)
Get the schema object corresponding to this namespace URI.
|
protected boolean |
uniqueNamespace(Context context,
int metadataSchemaId,
String namespace)
Return true if and only if the passed name appears within the allowed
number of times in the current schema.
|
protected boolean |
uniqueShortName(Context context,
int metadataSchemaId,
String name)
Return true if and only if the passed name is unique.
|
void |
update(Context context,
MetadataSchema metadataSchema)
Update the metadata schema in the database.
|
@Autowired(required=true) protected AuthorizeService authorizeService
@Autowired(required=true) protected MetadataSchemaDAO metadataSchemaDAO
public MetadataSchema create(Context context, String name, String namespace) throws SQLException, AuthorizeException, NonUniqueMetadataException
MetadataSchemaServicecreate in interface MetadataSchemaServicecontext - DSpace context objectname - namenamespace - namespaceSQLException - if database errorAuthorizeException - if authorization errorNonUniqueMetadataExceptionpublic MetadataSchema findByNamespace(Context context, String namespace) throws SQLException
MetadataSchemaServicefindByNamespace in interface MetadataSchemaServicecontext - DSpace contextnamespace - namespace URI to matchSQLException - if database errorpublic void update(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException, NonUniqueMetadataException
MetadataSchemaServiceupdate in interface MetadataSchemaServicecontext - DSpace contextmetadataSchema - metadata schemaSQLException - if database errorAuthorizeException - if authorization errorNonUniqueMetadataExceptionpublic void delete(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException
MetadataSchemaServicedelete in interface MetadataSchemaServicecontext - DSpace contextmetadataSchema - metadata schemaSQLException - if database errorAuthorizeException - if authorization errorpublic List<MetadataSchema> findAll(Context context) throws SQLException
MetadataSchemaServicefindAll in interface MetadataSchemaServicecontext - DSpace contextSQLException - if database errorpublic MetadataSchema find(Context context, int id) throws SQLException
MetadataSchemaServicefind in interface MetadataSchemaServicecontext - context, in case we need to read it in from DBid - the schema IDSQLException - if database errorpublic MetadataSchema find(Context context, String shortName) throws SQLException
MetadataSchemaServicefind in interface MetadataSchemaServicecontext - context, in case we need to read it in from DBshortName - the short name for the schemaSQLException - if database errorprotected boolean uniqueNamespace(Context context, int metadataSchemaId, String namespace) throws SQLException
context - DSpace contextmetadataSchemaId - metadata schema idnamespace - namespace URI to matchSQLException - if database errorprotected boolean uniqueShortName(Context context, int metadataSchemaId, String name) throws SQLException
context - DSpace contextmetadataSchemaId - metadata schema idname - short name of schemaSQLException - if database errorCopyright © 2022 LYRASIS. All rights reserved.