public class MetadataSchema extends Object
The schema object exposes a name which can later be used to generate
namespace prefixes in RDF or XML, e.g. the core DSpace Dublin Core schema
would have a name of 'dc'.
MetadataValue,
MetadataField| Modifier and Type | Field and Description |
|---|---|
static String |
DC_SCHEMA
Short Name of built-in Dublin Core schema.
|
static int |
DC_SCHEMA_ID
Numeric Identifier of built-in Dublin Core schema.
|
| Constructor and Description |
|---|
MetadataSchema()
Default constructor.
|
MetadataSchema(int schemaID,
String namespace,
String name)
Object constructor.
|
MetadataSchema(String namespace,
String name)
Immutable object constructor for creating a new schema.
|
MetadataSchema(TableRow row)
Constructor for loading the metadata schema from the database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create(Context context)
Creates a new metadata schema in the database, out of this object.
|
void |
delete(Context context)
Delete the metadata schema.
|
boolean |
equals(Object obj) |
static MetadataSchema |
find(Context context,
int id)
Get the schema corresponding with this numeric ID.
|
static MetadataSchema |
find(Context context,
String shortName)
Get the schema corresponding with this short name.
|
static MetadataSchema[] |
findAll(Context context)
Return all metadata schemas.
|
static MetadataSchema |
findByNamespace(Context context,
String namespace)
Get the schema object corresponding to this namespace URI.
|
String |
getName()
Get the schema name.
|
String |
getNamespace()
Get the schema namespace.
|
int |
getSchemaID()
Get the schema record key number.
|
int |
hashCode() |
void |
setName(String name)
Set the schema name.
|
void |
setNamespace(String namespace)
Set the schema namespace.
|
void |
update(Context context)
Update the metadata schema in the database.
|
public static final int DC_SCHEMA_ID
public static final String DC_SCHEMA
public MetadataSchema()
public MetadataSchema(int schemaID,
String namespace,
String name)
schemaID - database key ID numbernamespace - XML namespace URIname - short name of schemapublic MetadataSchema(String namespace, String name)
namespace - XML namespace URIname - short name of schemapublic MetadataSchema(TableRow row)
row - table row object from which to populate this schema.public String getNamespace()
public void setNamespace(String namespace)
namespace - XML namespace URIpublic String getName()
public void setName(String name)
name - short name of schemapublic int getSchemaID()
public void create(Context context) throws SQLException, AuthorizeException, NonUniqueMetadataException
context - DSpace context objectSQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionpublic static MetadataSchema findByNamespace(Context context, String namespace) throws SQLException
context - DSpace contextnamespace - namespace URI to matchSQLExceptionpublic void update(Context context) throws SQLException, AuthorizeException, NonUniqueMetadataException
context - DSpace contextSQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionpublic void delete(Context context) throws SQLException, AuthorizeException
context - DSpace contextSQLExceptionAuthorizeExceptionpublic static MetadataSchema[] findAll(Context context) throws SQLException
context - DSpace contextSQLExceptionpublic static MetadataSchema find(Context context, int id) throws SQLException
context - context, in case we need to read it in from DBid - the schema IDSQLExceptionpublic static MetadataSchema find(Context context, String shortName) throws SQLException
context - context, in case we need to read it in from DBshortName - the short name for the schemaSQLExceptionCopyright © 2013 DuraSpace. All Rights Reserved.