org.dspace.app.xmlui.objectmanager
Class ItemAdapter

java.lang.Object
  extended by org.dspace.app.xmlui.objectmanager.AbstractAdapter
      extended by org.dspace.app.xmlui.objectmanager.ItemAdapter

public class ItemAdapter
extends AbstractAdapter

This is an adapter which translate a DSpace item into a METS document following the DSpace METS profile, err well mostly. At least if you use the proper configuration it will be fully complaint with the profile, however this adapter will allow you to configure it to be incorrect. When we are configured to be non-complaint with the profile the MET's profile is changed to reflect the diviation. The DSpace profile states that metadata should be given in MODS format. However you can configure this adapter to use any metadata crosswalk. When that case is detected we change the profile to say that we are divating from the standard profile and it lists what metadata has been added. There are four parts to an item's METS document: descriptive metadata, file section, structural map, and extra sections.

Author:
Scott Phillips

Field Summary
 
Fields inherited from class org.dspace.app.xmlui.objectmanager.AbstractAdapter
contentHandler, contextPath, DIM, DIM_URI, lexicalHandler, METS, METS_DEFINED_TYPES, METS_URI, namespaces, XLINK, XLINK_URI, XSI, XSI_URI
 
Constructor Summary
ItemAdapter(Context context, Item item, java.lang.String contextPath)
          Construct a new ItemAdapter
 
Method Summary
protected  java.util.List<Bundle> findEnabledBundles()
          Checks which Bundles of current item a user has requested.
protected static Bitstream findOriginalBitstream(Item item, Bitstream derived)
          For a bitstream that's a thumbnail or extracted text, find the corresponding bitstream it was derived from, in the ORIGINAL bundle.
protected  java.lang.String getAmdSecID(java.lang.String admSecName, java.lang.String mdType, DSpaceObject dso)
          Return a techMD id for a bitstream.
protected  java.lang.String getFileID(Bitstream bitstream)
          Return a unique id for a bitstream.
protected  java.lang.String getGroupFileID(Bitstream bitstream)
          Return a group id for a bitstream.
 Item getItem()
          Return the item
protected  java.lang.String getMETSID()
          Return the item's handle as the METS ID
protected  java.lang.String getMETSLabel()
          Return a helpfull label that this is a DSpace Item.
protected  java.lang.String getMETSOBJEDIT()
           
protected  java.lang.String getMETSOBJID()
          Return the URL of this item in the interface
protected  java.lang.String getMETSProfile()
          Return the official METS SIP Profile.
protected  void renderAdministrativeSection()
          Render the METS administrative section.
protected  void renderAmdSubSection(java.lang.String amdSecName, java.lang.String mdType, DisseminationCrosswalk crosswalk, DSpaceObject dso)
          Render a sub-section of the administrative metadata section.
protected  void renderDescriptiveSection()
          Render the METS descriptive section.
protected  void renderExtraSections()
          Render any extra METS section.
protected  void renderFileSection()
          Render the METS file section.
protected  void renderStructureMap()
          Render the item's structural map.
 
Methods inherited from class org.dspace.app.xmlui.objectmanager.AbstractAdapter
endElement, getDisseminationCrosswalk, getGenericID, isDefinedMETStype, renderBehavioralSection, renderFile, renderFile, renderHeader, renderMETS, renderStructuralLink, sendCharacters, setAmdTypes, setDigiProvMDTypes, setDmdTypes, setFileGrpTypes, setRightsMDTypes, setSections, setSourceMDTypes, setStructTypes, setTechMDTypes, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemAdapter

public ItemAdapter(Context context,
                   Item item,
                   java.lang.String contextPath)
Construct a new ItemAdapter

Parameters:
item - The DSpace item to adapt.
contextPath - The contextpath for this webapplication.
Method Detail

getItem

public Item getItem()
Return the item


getMETSOBJID

protected java.lang.String getMETSOBJID()
Return the URL of this item in the interface

Specified by:
getMETSOBJID in class AbstractAdapter
Returns:
the URL for this item in the interface

getMETSOBJEDIT

protected java.lang.String getMETSOBJEDIT()
Specified by:
getMETSOBJEDIT in class AbstractAdapter
Returns:
Return the URL for editing this item

getMETSID

protected java.lang.String getMETSID()
Return the item's handle as the METS ID

Specified by:
getMETSID in class AbstractAdapter
Returns:
the METS ID of the mets document.

getMETSProfile

protected java.lang.String getMETSProfile()
                                   throws WingException
Return the official METS SIP Profile.

Specified by:
getMETSProfile in class AbstractAdapter
Returns:
The Profile this METS document conforms too.
Throws:
WingException

getMETSLabel

protected java.lang.String getMETSLabel()
Return a helpfull label that this is a DSpace Item.

Specified by:
getMETSLabel in class AbstractAdapter
Returns:
The label of this METS document.

getFileID

protected java.lang.String getFileID(Bitstream bitstream)
Return a unique id for a bitstream.


getGroupFileID

protected java.lang.String getGroupFileID(Bitstream bitstream)
Return a group id for a bitstream.


getAmdSecID

protected java.lang.String getAmdSecID(java.lang.String admSecName,
                                       java.lang.String mdType,
                                       DSpaceObject dso)
Return a techMD id for a bitstream.


renderDescriptiveSection

protected void renderDescriptiveSection()
                                 throws WingException,
                                        org.xml.sax.SAXException,
                                        CrosswalkException,
                                        java.io.IOException,
                                        java.sql.SQLException
Render the METS descriptive section. This will create a new metadata section for each crosswalk configured. Futher more, a special check has been aded that will add mods descriptive metadata if it is available in DSpace. Example: ... content from the crosswalk ...
Overrides:
renderDescriptiveSection in class AbstractAdapter
Throws:
WingException
org.xml.sax.SAXException
CrosswalkException
java.io.IOException
java.sql.SQLException

renderAdministrativeSection

protected void renderAdministrativeSection()
                                    throws WingException,
                                           org.xml.sax.SAXException,
                                           CrosswalkException,
                                           java.io.IOException,
                                           java.sql.SQLException
Render the METS administrative section. Example: ... content from the crosswalk ...

Overrides:
renderAdministrativeSection in class AbstractAdapter
Throws:
WingException
org.xml.sax.SAXException
CrosswalkException
java.io.IOException
java.sql.SQLException

renderAmdSubSection

protected void renderAmdSubSection(java.lang.String amdSecName,
                                   java.lang.String mdType,
                                   DisseminationCrosswalk crosswalk,
                                   DSpaceObject dso)
                            throws WingException,
                                   org.xml.sax.SAXException,
                                   CrosswalkException,
                                   java.io.IOException,
                                   java.sql.SQLException
Render a sub-section of the administrative metadata section. Valid sub-sections include: techMD, rightsMD, sourceMD, digiprovMD Example: [PREMIS content ... ]

Parameters:
amdSecName - Name of administrative metadata section
mdType - Type of metadata section (e.g. PREMIS)
crosswalk - The DisseminationCrosswalk to use to generate this section
dso - The current DSpace object to use the crosswalk on
Throws:
WingException
org.xml.sax.SAXException
CrosswalkException
java.io.IOException
java.sql.SQLException

renderFileSection

protected void renderFileSection()
                          throws java.sql.SQLException,
                                 org.xml.sax.SAXException
Render the METS file section. This will contain a list of all bitstreams in the item. Each bundle, even those that are not typically displayed will be listed. Example:

Overrides:
renderFileSection in class AbstractAdapter
Throws:
java.sql.SQLException
org.xml.sax.SAXException

renderStructureMap

protected void renderStructureMap()
                           throws java.sql.SQLException,
                                  org.xml.sax.SAXException
Render the item's structural map. This includes a list of content bitstreams, those are bistreams that are typicaly viewable by the end user. Examlpe:
... a div for each content bitstream.

Overrides:
renderStructureMap in class AbstractAdapter
Throws:
java.sql.SQLException
org.xml.sax.SAXException

renderExtraSections

protected void renderExtraSections()
                            throws org.xml.sax.SAXException,
                                   java.sql.SQLException,
                                   java.io.IOException
Render any extra METS section. If the item contains a METS.xml document then all of that document's sections are included in this document's METS document.

Overrides:
renderExtraSections in class AbstractAdapter
Throws:
org.xml.sax.SAXException
java.sql.SQLException
java.io.IOException

findEnabledBundles

protected java.util.List<Bundle> findEnabledBundles()
                                             throws java.sql.SQLException
Checks which Bundles of current item a user has requested. If none specifically requested, then all Bundles are returned.

Returns:
List of enabled bundles
Throws:
java.sql.SQLException

findOriginalBitstream

protected static Bitstream findOriginalBitstream(Item item,
                                                 Bitstream derived)
                                          throws java.sql.SQLException
For a bitstream that's a thumbnail or extracted text, find the corresponding bitstream it was derived from, in the ORIGINAL bundle.

Parameters:
item - the item we're dealing with
derived - the derived bitstream
Returns:
the corresponding original bitstream (or null)
Throws:
java.sql.SQLException


Copyright © 2010 DuraSpace. All Rights Reserved.