Class MCRObjectDerivate

java.lang.Object
org.mycore.datamodel.metadata.MCRObjectDerivate

public class MCRObjectDerivate extends Object
This class implements all methode for handling one derivate data.
Version:
$Revision$ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06. Feb 2008) $
Author:
Jens Kupferschmidt
  • Constructor Details

    • MCRObjectDerivate

      public MCRObjectDerivate(MCRObjectID derivateID)
      This is the constructor of the MCRObjectDerivate class. All data are set to null.
    • MCRObjectDerivate

      public MCRObjectDerivate(MCRObjectID derivateID, Element derivate)
  • Method Details

    • getMetaLink

      public MCRMetaLinkID getMetaLink()
      returns link to the MCRObject.
      Returns:
      a metadata link as MCRMetaLinkID
    • setLinkMeta

      public final void setLinkMeta(MCRMetaLinkID link)
      This method set the metadata link
      Parameters:
      link - the MCRMetaLinkID object
    • getExternalSize

      public final int getExternalSize()
      This method return the size of the external array.
    • getExternal

      public final MCRMetaLink getExternal(int index) throws IndexOutOfBoundsException
      This method get a single link from the external list as a MCRMetaLink.
      Returns:
      a external link as MCRMetaLink
      Throws:
      IndexOutOfBoundsException - throw this exception, if the index is false
    • getTitleSize

      public final int getTitleSize()
      This method return the size of the title array.
    • getTitle

      public final MCRMetaLangText getTitle(int index) throws IndexOutOfBoundsException
      This method get a single text from the titles list as a MCRMetaLangText.
      Returns:
      a title text as MCRMetaLangText
      Throws:
      IndexOutOfBoundsException - throw this exception, if the index is false
    • getInternals

      public final MCRMetaIFS getInternals()
      This method get a single data from the internal list as a MCRMetaIFS.
      Returns:
      a internal data as MCRMetaIFS
    • getOrCreateFileMetadata

      public MCRFileMetadata getOrCreateFileMetadata(MCRPath file, String urn)
      Parameters:
      file - the file to add
      urn - the urn of the file, if already known, if not provide null
      Throws:
      NullPointerException - if first argument is null
    • getOrCreateFileMetadata

      public MCRFileMetadata getOrCreateFileMetadata(MCRPath file, String urn, String handle)
    • getOrCreateFileMetadata

      public final MCRFileMetadata getOrCreateFileMetadata(String path)
    • getOrCreateFileMetadata

      public MCRFileMetadata getOrCreateFileMetadata(MCRPath file)
    • getFileMetadata

      public List<MCRFileMetadata> getFileMetadata()
    • removeFileMetadata

      public void removeFileMetadata()
      Removes file metadata (urn information) from the MCRObjectDerivate
    • deleteFileMetaData

      public boolean deleteFileMetaData(String path)
      Deletes file metadata of file idendified by absolute path.
      Parameters:
      path - absolute path of this node starting with a '/'
      Returns:
      true if metadata was deleted and false if file has no metadata.
    • setInternals

      public final void setInternals(MCRMetaIFS ifs)
      This method set the metadata internals (the IFS data)
      Parameters:
      ifs - the MCRMetaIFS object
    • createXML

      public final Element createXML() throws MCRException
      This methode create a XML stream for all derivate data.
      Returns:
      a JDOM Element with the XML data of the structure data part
      Throws:
      MCRException - if the content of this class is not valid
    • isValid

      public final boolean isValid()
      This method check the validation of the content of this class. The method returns true if
      • the linkmeta exist and the XLink type of linkmeta is not "arc"
      • no information in the external AND internal tags
      Returns:
      a boolean value
    • validate

      public void validate() throws MCRException
      Validates this MCRObjectDerivate. This method throws an exception if:
      • the linkmeta is null
      • the linkmeta xlink:type is not 'locator'
      • the internals and the externals are empty
      Throws:
      MCRException - the MCRObjectDerivate is invalid
    • setURN

      public void setURN(String urn)
    • getURN

      public String getURN()
    • getClassifications

      public ArrayList<MCRMetaClassification> getClassifications()
    • getTitles

      public ArrayList<MCRMetaLangText> getTitles()