org.dspace.administer
Class DCType

java.lang.Object
  extended by org.dspace.administer.DCType

Deprecated.

public class DCType
extends Object

Class representing a particular Dublin Core metadata type, with various utility methods. In general, only used for manipulating the registry of Dublin Core types in the system, so most users will not need this.

The DCType implementation has been deprecated, please use MetadataManager, MetadataSchema and MetadataField instead. For backward compatibility the this implementation has been updated to transparently call the new classes.

Version:
$Revision: 3733 $
Author:
Robert Tansley, Martin Hald

Constructor Summary
DCType(Context context)
          Deprecated.  
DCType(Context context, MetadataField field)
          Deprecated.  
 
Method Summary
static DCType create(Context context)
          Deprecated.  
 void delete()
          Deprecated.  
static DCType find(Context context, int id)
          Deprecated.  
static DCType[] findAll(Context context)
          Deprecated.  
static DCType findByElement(Context context, String element, String qualifier)
          Deprecated.  
 String getElement()
          Deprecated. Get the DC element
 int getID()
          Deprecated. Get the internal identifier of this metadata field
 String getQualifier()
          Deprecated. Get the DC qualifier, if any.
 String getScopeNote()
          Deprecated. Get the scope note - information about the DC type and its use
static String[] quickFind(Context context, int id)
          Deprecated.  
 void setElement(String s)
          Deprecated. Set the DC element
 void setQualifier(String s)
          Deprecated. Set the DC qualifier
 void setScopeNote(String s)
          Deprecated. Set the scope note
 void update()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DCType

public DCType(Context context,
              MetadataField field)
Deprecated. 

Create a DCType from an existing metadata field.

Parameters:
context -
field -

DCType

public DCType(Context context)
Deprecated. 

Default constructor.

Parameters:
context -
Method Detail

quickFind

public static String[] quickFind(Context context,
                                 int id)
                          throws SQLException
Deprecated. 

Utility method for quick access to an element and qualifier given the type ID.

Parameters:
context - context, in case DC types need to be read in from DB
id - the DC type ID
Returns:
a two-String array, string 0 is the element, string 1 is the qualifier
Throws:
SQLException

find

public static DCType find(Context context,
                          int id)
                   throws SQLException
Deprecated. 

Get a metadata field from the database.

Parameters:
context - DSpace context object
id - ID of the dublin core type
Returns:
the metadata field, or null if the ID is invalid.
Throws:
SQLException

findByElement

public static DCType findByElement(Context context,
                                   String element,
                                   String qualifier)
                            throws SQLException,
                                   AuthorizeException
Deprecated. 

Find a given Dublin Core type. Returns null if the Dublin Core type doesn't exist.

Parameters:
context - the DSpace context to use
element - the element to find
qualifier - the qualifier, or null to find an unqualified type
Returns:
the Dublin Core type, or null if there isn't a corresponding type in the registry
Throws:
AuthorizeException
SQLException

findAll

public static DCType[] findAll(Context context)
                        throws SQLException
Deprecated. 

Retrieve all Dublin Core types from the registry

Returns:
an array of all the Dublin Core types
Throws:
SQLException

create

public static DCType create(Context context)
                     throws SQLException,
                            AuthorizeException,
                            IOException,
                            NonUniqueMetadataException
Deprecated. 

Create a new Dublin Core type

Parameters:
context - DSpace context object
Returns:
the newly created DCType
Throws:
NonUniqueMetadataException
IOException
SQLException
AuthorizeException

delete

public void delete()
            throws SQLException,
                   AuthorizeException
Deprecated. 

Delete this DC type. This won't work if there are any DC values in the database of this type - they need to be updated first. An SQLException (referential integrity violation) will be thrown in this case.

Throws:
SQLException
AuthorizeException

getID

public int getID()
Deprecated. 
Get the internal identifier of this metadata field

Returns:
the internal identifier

getElement

public String getElement()
Deprecated. 
Get the DC element

Returns:
the element

setElement

public void setElement(String s)
Deprecated. 
Set the DC element

Parameters:
s - the new element

getQualifier

public String getQualifier()
Deprecated. 
Get the DC qualifier, if any.

Returns:
the DC qualifier, or null if this is an unqualified element

setQualifier

public void setQualifier(String s)
Deprecated. 
Set the DC qualifier

Parameters:
s - the DC qualifier, or null if this is an unqualified element

getScopeNote

public String getScopeNote()
Deprecated. 
Get the scope note - information about the DC type and its use

Returns:
the scope note

setScopeNote

public void setScopeNote(String s)
Deprecated. 
Set the scope note

Parameters:
s - the new scope note

update

public void update()
            throws SQLException,
                   AuthorizeException,
                   NonUniqueMetadataException,
                   IOException
Deprecated. 

Update the dublin core registry

Throws:
IOException
NonUniqueMetadataException
SQLException
AuthorizeException


Copyright © 2010 DuraSpace. All Rights Reserved.