public abstract class AbstractAdapter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ContentHandler |
contentHandler
The SAX handlers for content and lexical events.
|
protected String |
contextPath
The contextPath of this web application, used for generating URLs.
|
static org.dspace.app.xmlui.wing.Namespace |
DIM |
static String |
DIM_URI |
protected LexicalHandler |
lexicalHandler |
static org.dspace.app.xmlui.wing.Namespace |
METS |
static String[] |
METS_DEFINED_TYPES
The METS defined types of Metadata, if a format is not listed here
then it should use the string "OTHER" and provide additional
attributes describing the metadata type
|
static String |
METS_URI
Namespace declaration for METS & XLINK
|
protected org.xml.sax.helpers.NamespaceSupport |
namespaces |
static org.dspace.app.xmlui.wing.Namespace |
XLINK |
static String |
XLINK_URI |
static org.dspace.app.xmlui.wing.Namespace |
XSI |
static String |
XSI_URI |
| Constructor and Description |
|---|
AbstractAdapter(String contextPath)
Construct a new adapter, implementers must call this method so
the appropriate internal values are ensured to be set correctly.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
endElement(org.dspace.app.xmlui.wing.Namespace namespace,
String name)
Send the SAX events to end this element.
|
org.dspace.content.crosswalk.DisseminationCrosswalk |
getDisseminationCrosswalk(String crosswalkName)
Return a dissemination crosswalk for the given name.
|
protected String |
getGenericID(String prefix)
Generate a unique METS id.
|
protected abstract String |
getMETSID() |
protected abstract String |
getMETSLabel() |
protected abstract String |
getMETSOBJEDIT() |
protected abstract String |
getMETSOBJID() |
protected abstract String |
getMETSProfile() |
boolean |
isDefinedMETStype(String metadataType)
Determine if the provided metadata type is a standard METS
defined type.
|
protected void |
renderAdministrativeSection() |
protected void |
renderBehavioralSection() |
protected void |
renderDescriptiveSection() |
protected void |
renderExtraSections() |
protected void |
renderFile(Item item,
Bitstream bitstream,
String fileID,
String groupID)
Generate a METS file element for a given bitstream.
|
protected void |
renderFile(Item item,
Bitstream bitstream,
String fileID,
String groupID,
String admID)
Generate a METS file element for a given bitstream.
|
protected void |
renderFileSection() |
protected void |
renderHeader()
Each of the METS sections
|
void |
renderMETS(ContentHandler contentHandler,
LexicalHandler lexicalHandler)
Render the complete METS document.
|
protected void |
renderStructuralLink() |
protected void |
renderStructureMap() |
protected void |
sendCharacters(String characters)
Send the SAX event for these plain characters, not wrapped in any
elements.
|
void |
setAmdTypes(String amdSec,
String mdTypes)
Store information about what will be rendered in the METS administrative
metadata section.
|
void |
setDigiProvMDTypes(String digiprovMDTypes)
A comma-separated list of METS digital provenance metadata
formats to render.
|
void |
setDmdTypes(String dmdTypes)
A comma-separated list of METS descriptive metadata formats to
render.
|
void |
setFileGrpTypes(String fileGrpTypes)
A comma-separated list of METS fileGrps to render.
|
void |
setRightsMDTypes(String rightsMDTypes)
A comma-separated list of METS intellectual property rights metadata
formats to render.
|
void |
setSections(String sections)
A comma-separated list of METS sections to render.
|
void |
setSourceMDTypes(String sourceMDTypes)
A comma-separated list of METS source metadata
formats to render.
|
void |
setStructTypes(String structTypes)
A comma-separated list of METS structural types to render.
|
void |
setTechMDTypes(String techMDTypes)
A comma-separated list of METS technical metadata formats to
render.
|
protected void |
startElement(org.dspace.app.xmlui.wing.Namespace namespace,
String name,
org.dspace.app.xmlui.wing.AttributeMap... attributes)
Send the SAX events to start this element.
|
public static final String METS_URI
public static final org.dspace.app.xmlui.wing.Namespace METS
public static final String XLINK_URI
public static final org.dspace.app.xmlui.wing.Namespace XLINK
public static final String XSI_URI
public static final org.dspace.app.xmlui.wing.Namespace XSI
public static final String DIM_URI
public static final org.dspace.app.xmlui.wing.Namespace DIM
protected String contextPath
protected ContentHandler contentHandler
protected LexicalHandler lexicalHandler
protected org.xml.sax.helpers.NamespaceSupport namespaces
public static final String[] METS_DEFINED_TYPES
public AbstractAdapter(String contextPath)
contextPath - The contextPath of this web application.public final void setSections(String sections)
sections - Comma separated list of METS sections.public final void setDmdTypes(String dmdTypes)
dmdTypes - Comma separated list of METS metadata types.public final void setAmdTypes(String amdSec, String mdTypes)
amdSec - Section of mdTypes - Comma-separated list of METS metadata types.public final void setTechMDTypes(String techMDTypes)
techMDTypes - Comma-separated list of METS metadata types.public final void setRightsMDTypes(String rightsMDTypes)
rightsMDTypes - Comma-separated list of METS metadata types.public final void setSourceMDTypes(String sourceMDTypes)
sourceMDTypes - Comma-separated list of METS metadata types.public final void setDigiProvMDTypes(String digiprovMDTypes)
digiprovMDTypes - Comma-separated list of METS metadata types.public final void setFileGrpTypes(String fileGrpTypes)
fileGrpTypes - Comma-separated list of METS file groups.public final void setStructTypes(String structTypes)
structTypes - Comma-separated list of METS structure types.protected abstract String getMETSOBJID() throws org.dspace.app.xmlui.wing.WingException
org.dspace.app.xmlui.wing.WingExceptionprotected abstract String getMETSOBJEDIT()
protected abstract String getMETSID() throws org.dspace.app.xmlui.wing.WingException
org.dspace.app.xmlui.wing.WingExceptionprotected abstract String getMETSProfile() throws org.dspace.app.xmlui.wing.WingException
org.dspace.app.xmlui.wing.WingExceptionprotected abstract String getMETSLabel() throws org.dspace.app.xmlui.wing.WingException
org.dspace.app.xmlui.wing.WingExceptionpublic void renderMETS(ContentHandler contentHandler, LexicalHandler lexicalHandler) throws org.dspace.app.xmlui.wing.WingException, SAXException, org.dspace.content.crosswalk.CrosswalkException, IOException, SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderHeader()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderDescriptiveSection()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderAdministrativeSection()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderFileSection()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderStructureMap()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderStructuralLink()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderBehavioralSection()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
SQLException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionSQLExceptionprotected void renderExtraSections()
throws org.dspace.app.xmlui.wing.WingException,
SAXException,
org.dspace.content.crosswalk.CrosswalkException,
SQLException,
IOException
org.dspace.app.xmlui.wing.WingExceptionSAXExceptionorg.dspace.content.crosswalk.CrosswalkExceptionSQLExceptionIOExceptionprotected final void renderFile(Item item, Bitstream bitstream, String fileID, String groupID) throws SAXException
item - If the bitstream is associated with an item provide the item
otherwise leave null.bitstream - The bitstream to build a file element for.fileID - The unique file id for this file.groupID - The group id for this file, if it is derived from another file
then they should share the same groupID.SAXExceptionprotected final void renderFile(Item item, Bitstream bitstream, String fileID, String groupID, String admID) throws SAXException
item - If the bitstream is associated with an item, provide the item,
otherwise leave null.bitstream - The bitstream to build a file element for.fileID - The unique file id for this file.groupID - The group id for this file, if it is derived from another file
then they should share the same groupID.admID - The IDs of the administrative metadata sections which pertain
to this fileSAXExceptionprotected final String getGenericID(String prefix)
prefix - Prefix to prepend to the id for readability.public final org.dspace.content.crosswalk.DisseminationCrosswalk getDisseminationCrosswalk(String crosswalkName) throws org.dspace.app.xmlui.wing.WingException
crosswalkName - org.dspace.app.xmlui.wing.WingExceptionpublic final boolean isDefinedMETStype(String metadataType)
metadataType - type nameprotected final void startElement(org.dspace.app.xmlui.wing.Namespace namespace,
String name,
org.dspace.app.xmlui.wing.AttributeMap... attributes)
throws SAXException
namespace - (Required) The namespace of this element.name - (Required) The local name of this element.attributes - (May be null) Attributes for this elementSAXExceptionprotected final void sendCharacters(String characters) throws SAXException
characters - (May be null) Characters to send.SAXExceptionprotected final void endElement(org.dspace.app.xmlui.wing.Namespace namespace,
String name)
throws SAXException
namespace - (Required) The namespace of this element.name - (Required) The local name of this element.SAXExceptionCopyright © 2016 DuraSpace. All rights reserved.