Package org.mycore.datamodel.metadata
Class MCRMetaIFS
java.lang.Object
org.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaIFS
- All Implemented Interfaces:
Cloneable
,MCRMetaInterface
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
-
Field Summary
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
datapart, DEFAULT_ATTRIBUTE_INHERITED, DEFAULT_ATTRIBUTE_LANG, DEFAULT_ATTRIBUTE_SEQUENCE, DEFAULT_ATTRIBUTE_TYPE, DEFAULT_ELEMENT_DATAPART, DEFAULT_INHERITED, DEFAULT_LANG_LENGTH, DEFAULT_LANGUAGE, DEFAULT_SEQUENCE, DEFAULT_STRING_LENGTH, DEFAULT_TYPE_LENGTH, inherited, lang, NL, sequence, subtag, type
-
Constructor Summary
ConstructorDescriptionThis is the constructor.MCRMetaIFS
(String subtag, String sourcePath) This is the constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
This method make a clone of this class.com.google.gson.JsonObject
Creates the JSON representation.This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaIFS definition for the given subtag.boolean
getIFSID()
Deprecated.will always return empty StringThe method return the derivate main document name.The method return the derivate source path.void
setFromDOM
(Element element) This method read the XML input stream part from a DOM part for the metadata of the document.void
Deprecated.out of usevoid
setMainDoc
(String mainDoc) This method set the value of derivate main document.void
setSourcePath
(String sourcePath) This method set the value of derivate source path.void
validate()
Validates this MCRMetaIFS.Methods inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
debug, debugDefault, decrementInherited, getInherited, getLang, getSequence, getSubTag, getType, hashCode, incrementInherited, isValid, setInherited, setLang, setSequence, setSubTag, setType
-
Constructor Details
-
MCRMetaIFS
public MCRMetaIFS()This is the constructor.
The language element was set to en . All other data was set to empty. -
MCRMetaIFS
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 subtagsourcePath
- 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
The method return the derivate source path.- Returns:
- the sourcepath
-
getMainDoc
The method return the derivate main document name.- Returns:
- the main document name.
-
getIFSID
Deprecated.will always return empty StringThe method return the derivate IFS ID.- Returns:
- the IFS ID.
-
setSourcePath
This method set the value of derivate source path.- Parameters:
sourcePath
- the derivate source path
-
setMainDoc
This method set the value of derivate main document.- Parameters:
mainDoc
- the derivate main document name
-
setIFSID
Deprecated.out of useThis method set the value of derivate IFS ID.- Parameters:
ifsId
- the derivate IFS ID
-
setFromDOM
This method read the XML input stream part from a DOM part for the metadata of the document.- Specified by:
setFromDOM
in interfaceMCRMetaInterface
- Overrides:
setFromDOM
in classMCRMetaDefault
- Parameters:
element
- a relevant JDOM element for the metadata- Throws:
MCRException
- if the set_sourcepath value is null or empty
-
createXML
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 interfaceMCRMetaInterface
- Overrides:
createXML
in classMCRMetaDefault
- 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 theMCRMetaDefault.createJSON()
method with the following data.{ sourcepath: "...", maindoc: "image.tif", ifsid: "ve3s8a3j00xsfk8z" }
- Specified by:
createJSON
in interfaceMCRMetaInterface
- Overrides:
createJSON
in classMCRMetaDefault
- Returns:
- a GSON object containing the json data of the metadata part
-
validate
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 interfaceMCRMetaInterface
- Overrides:
validate
in classMCRMetaDefault
- Throws:
MCRException
- the MCRMetaIFS is invalid
-
clone
Description copied from interface:MCRMetaInterface
This method make a clone of this class.- Specified by:
clone
in interfaceMCRMetaInterface
- Overrides:
clone
in classMCRMetaDefault
-
equals
- Overrides:
equals
in classMCRMetaDefault
-