Class ItemArchive

java.lang.Object
org.dspace.app.itemupdate.ItemArchive

public class ItemArchive extends Object
Encapsulates the Item in the context of the DSpace Archive Format
  • Field Details

    • DUBLIN_CORE_XML

      public static final String DUBLIN_CORE_XML
      See Also:
    • transformer

      protected Transformer transformer
    • dtomList

      protected List<org.dspace.app.itemupdate.DtoMetadata> dtomList
    • undoDtomList

      protected List<org.dspace.app.itemupdate.DtoMetadata> undoDtomList
    • undoAddContents

      protected List<UUID> undoAddContents
    • item

      protected Item item
    • dir

      protected File dir
    • dirname

      protected String dirname
    • handleService

      protected HandleService handleService
    • itemService

      protected ItemService itemService
  • Constructor Details

    • ItemArchive

      protected ItemArchive()
  • Method Details

    • create

      public static ItemArchive create(Context context, File dir, String itemField) throws Exception
      factory method Minimal requirements for dublin_core.xml for this application is the presence of dc.identifier.uri which must contain the handle for the item
      Parameters:
      context - - The DSpace context
      dir - - The directory File in the source archive
      itemField - - The metadata field in which the Item identifier is located if null, the default is the handle in the dc.identifier.uri field
      Returns:
      ItemArchive object
      Throws:
      Exception - if error
    • getTransformer

      protected Transformer getTransformer() throws TransformerConfigurationException
      Getter for Transformer
      Returns:
      Transformer
      Throws:
      TransformerConfigurationException - if config error
    • getItem

      public Item getItem()
      Getter for the DSpace item referenced in the archive
      Returns:
      DSpace item
    • getDirectory

      public File getDirectory()
      Getter for directory in archive on disk
      Returns:
      directory in archive
    • getDirectoryName

      public String getDirectoryName()
      Getter for directory name in archive
      Returns:
      directory name in archive
    • addUndoMetadataField

      public void addUndoMetadataField(org.dspace.app.itemupdate.DtoMetadata dtom)
      Add metadata field to undo list
      Parameters:
      dtom - DtoMetadata (represents metadata field)
    • getMetadataFields

      public List<org.dspace.app.itemupdate.DtoMetadata> getMetadataFields()
      Getter for list of metadata fields
      Returns:
      list of metadata fields
    • addUndoDeleteContents

      public void addUndoDeleteContents(UUID bitstreamId)
      Add bitstream id to delete contents file
      Parameters:
      bitstreamId - bitstream ID
    • writeUndo

      write undo directory and files to Disk in archive format
      Parameters:
      undoDir - - the root directory of the undo archive
      Throws:
      IOException - if IO error
      ParserConfigurationException - if config error
      TransformerConfigurationException - if transformer config error
      TransformerException - if transformer error
      FileNotFoundException - if file not found