Package org.mycore.datamodel.metadata
Class MCRDerivate
java.lang.Object
org.mycore.datamodel.metadata.MCRBase
org.mycore.datamodel.metadata.MCRDerivate
This class holds all information of a derivate. For persistence operations
see methods of
MCRMetadataManager
.- Version:
- $Revision$ $Date: 2010-09-30 17:49:21 +0200 (Thu, 30 Sep 2010) $
- Author:
- Jens Kupferschmidt, Thomas Scheffler
-
Field Summary
FieldsFields inherited from class org.mycore.datamodel.metadata.MCRBase
importMode, jdomDocument, MCR_ENCODING, mcrId, mcrSchema, mcrService, mcrVersion, NL, SLASH
-
Constructor Summary
ConstructorsConstructorDescriptionThis is the constructor of the MCRDerivate class.MCRDerivate
(byte[] bytes, boolean valid) MCRDerivate
(URI uri) MCRDerivate
(Document doc) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObject
Creates the JSON representation of this object.This methode create a XML stream for all object data.void
debug()
The method print all informations about this MCRObject.This methode return the instance of the MCRObjectDerivate class.getLabel()
This methode return the label or null if it was not set.int
getOrder()
protected String
Reads all files and urns from the derivate.protected void
setFromJDOM
(Document doc) void
setId
(MCRObjectID id) This method set the object ID.void
This method set the derivate label.void
setOrder
(int order) protected void
setUp()
The given DOM was convert into an internal view of metadata.void
validate()
Validates this MCRDerivate.Methods inherited from class org.mycore.datamodel.metadata.MCRBase
getId, getSchema, getService, getVersion, isImportMode, isValid, setFromURI, setFromXML, setImportMode, setSchema, setVersion, toString
-
Field Details
-
ROOT_NAME
- See Also:
-
MAX_LABEL_LENGTH
public static final int MAX_LABEL_LENGTH- See Also:
-
mcrLabel
-
-
Constructor Details
-
MCRDerivate
This is the constructor of the MCRDerivate class. It make an instance of the parser class and the metadata class.- Throws:
MCRException
- general Exception of MyCoRe
-
MCRDerivate
- Throws:
SAXParseException
-
MCRDerivate
-
MCRDerivate
- Throws:
SAXParseException
IOException
-
-
Method Details
-
getDerivate
This methode return the instance of the MCRObjectDerivate class. If this was not found, null was returned.- Returns:
- the instance of the MCRObjectDerivate class
-
setUp
The given DOM was convert into an internal view of metadata. This are the object ID and the object label, also the blocks structure, flags and metadata.- Overrides:
setUp
in classMCRBase
- Throws:
MCRException
- general Exception of MyCoRe
-
createXML
This methode create a XML stream for all object data.- Overrides:
createXML
in classMCRBase
- Returns:
- a JDOM Document with the XML data of the object as byte array
- Throws:
MCRException
- if the content of this class is not valid
-
getRootTagName
- Specified by:
getRootTagName
in classMCRBase
-
getUrnMap
Reads all files and urns from the derivate.- Returns:
- A
Map
which contains the files as key and the urns as value. If no URN assigned the map will be empty.
-
getLabel
This methode return the label or null if it was not set.- Returns:
- the label as a string
-
debug
public void debug()The method print all informations about this MCRObject. -
validate
Validates this MCRDerivate. This method throws an exception if:- the mcr_id is null
- the XML schema is null or empty
- the service part is null or invalid
- the MCRObjectDerivate is null or invalid
- Overrides:
validate
in classMCRBase
- Throws:
MCRException
- the MCRDerivate is invalid
-
getOwnerID
- Returns:
- the
MCRObjectID
of the owner of the derivate
-
setId
Description copied from class:MCRBase
This method set the object ID. -
setLabel
This method set the derivate label.- Parameters:
label
- - the derivate label
-
getOrder
public int getOrder() -
setOrder
public void setOrder(int order) -
setFromJDOM
- Overrides:
setFromJDOM
in classMCRBase
-
createJSON
public com.google.gson.JsonObject createJSON()Description copied from class:MCRBase
Creates the JSON representation of this object.{ id: "mycore_project_00000001", version: "3.0" }
- Overrides:
createJSON
in classMCRBase
-