Class MCRMetaIFS

java.lang.Object
org.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaIFS
All Implemented Interfaces:
Cloneable, MCRMetaInterface

public final class MCRMetaIFS extends MCRMetaDefault
This class implements all method for handling the IFS metadata. The MCRMetaIFS class present all informations to store and retrieve derivates to the IFS.

<tag class="MCRMetaIFS" >
<subtag sourcepath="..." maindoc="..." ifsid="..." />
</tag>

Version:
$Revision$ $Date$
Author:
Jens Kupferschmidt
  • Constructor Details

    • MCRMetaIFS

      public MCRMetaIFS()
      This is the constructor.
      The language element was set to en . All other data was set to empty.
    • MCRMetaIFS

      public MCRMetaIFS(String subtag, String sourcePath) throws MCRException
      This is the constructor.
      The language element was set to en . The subtag element was set to the value of subtag. If the value of subtag is null or empty an exception was throwed. The type element was set empty. The sourcepath must be NOT null or empty.
      Parameters:
      subtag - the name of the subtag
      sourcePath - the sourcepath attribute
      Throws:
      MCRException - if the subtag value, the set_classid value or the set_categid are null, empty, too long or not a MCRObjectID
  • Method Details

    • getSourcePath

      public String getSourcePath()
      The method return the derivate source path.
      Returns:
      the sourcepath
    • getMainDoc

      public String getMainDoc()
      The method return the derivate main document name.
      Returns:
      the main document name.
    • getIFSID

      @Deprecated public String getIFSID()
      Deprecated.
      will always return empty String
      The method return the derivate IFS ID.
      Returns:
      the IFS ID.
    • setSourcePath

      public void setSourcePath(String sourcePath)
      This method set the value of derivate source path.
      Parameters:
      sourcePath - the derivate source path
    • setMainDoc

      public void setMainDoc(String mainDoc)
      This method set the value of derivate main document.
      Parameters:
      mainDoc - the derivate main document name
    • setIFSID

      @Deprecated public void setIFSID(String ifsId)
      Deprecated.
      out of use
      This method set the value of derivate IFS ID.
      Parameters:
      ifsId - the derivate IFS ID
    • setFromDOM

      public void setFromDOM(Element element) throws MCRException
      This method read the XML input stream part from a DOM part for the metadata of the document.
      Specified by:
      setFromDOM in interface MCRMetaInterface
      Overrides:
      setFromDOM in class MCRMetaDefault
      Parameters:
      element - a relevant JDOM element for the metadata
      Throws:
      MCRException - if the set_sourcepath value is null or empty
    • createXML

      public Element createXML() throws MCRException
      This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaIFS definition for the given subtag.
      Specified by:
      createXML in interface MCRMetaInterface
      Overrides:
      createXML in class MCRMetaDefault
      Returns:
      a JDOM Element with the XML MCRClassification part
      Throws:
      MCRException - if the content of this class is not valid
    • createJSON

      public com.google.gson.JsonObject createJSON()
      Creates the JSON representation. Extends the MCRMetaDefault.createJSON() method with the following data.
         {
           sourcepath: "...",
           maindoc: "image.tif",
           ifsid: "ve3s8a3j00xsfk8z"
         }
       
      Specified by:
      createJSON in interface MCRMetaInterface
      Overrides:
      createJSON in class MCRMetaDefault
      Returns:
      a GSON object containing the json data of the metadata part
    • validate

      public void validate() throws MCRException
      Validates this MCRMetaIFS. This method throws an exception if:
      • the subtag is not null or empty
      • the lang value was supported
      • the inherited value is lower than zero
      • the trimmed sourcepath is null empty
      Specified by:
      validate in interface MCRMetaInterface
      Overrides:
      validate in class MCRMetaDefault
      Throws:
      MCRException - the MCRMetaIFS is invalid
    • clone

      public MCRMetaIFS clone()
      Description copied from interface: MCRMetaInterface
      This method make a clone of this class.
      Specified by:
      clone in interface MCRMetaInterface
      Overrides:
      clone in class MCRMetaDefault
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class MCRMetaDefault