public class MetadataSchema
extends java.lang.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 java.lang.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,
java.lang.String namespace,
java.lang.String name)
Object constructor.
|
MetadataSchema(java.lang.String namespace,
java.lang.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(java.lang.Object obj) |
static MetadataSchema |
find(Context context,
int id)
Get the schema corresponding with this numeric ID.
|
static MetadataSchema |
find(Context context,
java.lang.String shortName)
Get the schema corresponding with this short name.
|
static MetadataSchema[] |
findAll(Context context)
Return all metadata schemas.
|
static MetadataSchema |
findByNamespace(Context context,
java.lang.String namespace)
Get the schema object corresponding to this namespace URI.
|
java.lang.String |
getName()
Get the schema name.
|
java.lang.String |
getNamespace()
Get the schema namespace.
|
int |
getSchemaID()
Get the schema record key number.
|
int |
hashCode() |
void |
setName(java.lang.String name)
Set the schema name.
|
void |
setNamespace(java.lang.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 java.lang.String DC_SCHEMA
public MetadataSchema()
public MetadataSchema(int schemaID,
java.lang.String namespace,
java.lang.String name)
schemaID - database key ID numbernamespace - XML namespace URIname - short name of schemapublic MetadataSchema(java.lang.String namespace,
java.lang.String name)
namespace - XML namespace URIname - short name of schemapublic MetadataSchema(TableRow row)
row - table row object from which to populate this schema.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getNamespace()
public void setNamespace(java.lang.String namespace)
namespace - XML namespace URIpublic java.lang.String getName()
public void setName(java.lang.String name)
name - short name of schemapublic int getSchemaID()
public void create(Context context) throws java.sql.SQLException, AuthorizeException, NonUniqueMetadataException
context - DSpace context objectjava.sql.SQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionpublic static MetadataSchema findByNamespace(Context context, java.lang.String namespace) throws java.sql.SQLException
context - DSpace contextnamespace - namespace URI to matchjava.sql.SQLExceptionpublic void update(Context context) throws java.sql.SQLException, AuthorizeException, NonUniqueMetadataException
context - DSpace contextjava.sql.SQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionpublic void delete(Context context) throws java.sql.SQLException, AuthorizeException
context - DSpace contextjava.sql.SQLExceptionAuthorizeExceptionpublic static MetadataSchema[] findAll(Context context) throws java.sql.SQLException
context - DSpace contextjava.sql.SQLExceptionpublic static MetadataSchema find(Context context, int id) throws java.sql.SQLException
context - context, in case we need to read it in from DBid - the schema IDjava.sql.SQLExceptionpublic static MetadataSchema find(Context context, java.lang.String shortName) throws java.sql.SQLException
context - context, in case we need to read it in from DBshortName - the short name for the schemajava.sql.SQLExceptionCopyright © 2013 DuraSpace. All Rights Reserved.