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, String contextPath)
          Construct a new ItemAdapter
 
Method Summary
protected  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  String getAmdSecID(String admSecName, String mdType, DSpaceObject dso)
          Return a techMD id for a bitstream.
protected  String getFileID(Bitstream bitstream)
          Return a unique id for a bitstream.
protected  String getGroupFileID(Bitstream bitstream)
          Return a group id for a bitstream.
 Item getItem()
          Return the item
protected  String getMETSID()
          Return the item's handle as the METS ID
protected  String getMETSLabel()
          Return a helpfull label that this is a DSpace Item.
protected  String getMETSOBJEDIT()
           
protected  String getMETSOBJID()
          Return the URL of this item in the interface
protected  String getMETSProfile()
          Return the official METS SIP Profile.
protected  void renderAdministrativeSection()
          Render the METS administrative section.
protected  void renderAmdSubSection(String amdSecName, 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,
                   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 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 String getMETSOBJEDIT()
Specified by:
getMETSOBJEDIT in class AbstractAdapter
Returns:
Return the URL for editing this item

getMETSID

protected 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 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 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 String getFileID(Bitstream bitstream)
Return a unique id for a bitstream.


getGroupFileID

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


getAmdSecID

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


renderDescriptiveSection

protected void renderDescriptiveSection()
                                 throws WingException,
                                        SAXException,
                                        CrosswalkException,
                                        IOException,
                                        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
SAXException
CrosswalkException
IOException
SQLException

renderAdministrativeSection

protected void renderAdministrativeSection()
                                    throws WingException,
                                           SAXException,
                                           CrosswalkException,
                                           IOException,
                                           SQLException
Render the METS administrative section. Example: ... content from the crosswalk ...

Overrides:
renderAdministrativeSection in class AbstractAdapter
Throws:
WingException
SAXException
CrosswalkException
IOException
SQLException

renderAmdSubSection

protected void renderAmdSubSection(String amdSecName,
                                   String mdType,
                                   DisseminationCrosswalk crosswalk,
                                   DSpaceObject dso)
                            throws WingException,
                                   SAXException,
                                   CrosswalkException,
                                   IOException,
                                   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
SAXException
CrosswalkException
IOException
SQLException

renderFileSection

protected void renderFileSection()
                          throws SQLException,
                                 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:
SQLException
SAXException

renderStructureMap

protected void renderStructureMap()
                           throws SQLException,
                                  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:
SQLException
SAXException

renderExtraSections

protected void renderExtraSections()
                            throws SAXException,
                                   SQLException,
                                   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:
SAXException
SQLException
IOException

findEnabledBundles

protected List<Bundle> findEnabledBundles()
                                   throws 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:
SQLException

findOriginalBitstream

protected static Bitstream findOriginalBitstream(Item item,
                                                 Bitstream derived)
                                          throws 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:
SQLException


Copyright © 2012 DuraSpace. All Rights Reserved.