|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.metadata.MCRBase
org.mycore.datamodel.metadata.MCRObject
public final class MCRObject
This class implements all methode for handling one metadata object. Methodes of this class can read the XML metadata by using a XML parser, manipulate the data in the abstract persistence data store and return the XML stream to the user application. Additionally, this class provides the public user interface for the linking of MCRObjects against other MCRObjects with metadata inheritance.
| Field Summary |
|---|
| Fields inherited from class org.mycore.datamodel.metadata.MCRBase |
|---|
importMode, jdom_document, LOGGER, MAX_LABEL_LENGTH, mcr_conf, mcr_encoding, mcr_id, mcr_label, mcr_schema, mcr_service, mcr_version, NL, SLASH |
| Constructor Summary | |
|---|---|
MCRObject()
This is the constructor of the MCRObject class. |
|
| Method Summary | |
|---|---|
void |
addDerivateInDatastore(String id,
MCRMetaLinkID link)
The methode add a derivate MCRMetaLinkID to the structure part and update the object with the ID in the data store. |
void |
createInDatastore()
The methode create the object in the data store. |
Document |
createXML()
This methode create a XML stream for all object data. |
void |
debug()
The method print all informations about this MCRObject. |
void |
deleteFromDatastore(String id)
The methode delete the object for the given ID from the data store. |
static boolean |
existInDatastore(MCRObjectID id)
The methode return true if the object is in the data store, else return false. |
static boolean |
existInDatastore(String id)
The methode return true if the object is in the data store, else return false. |
MCRObjectMetadata |
getMetadata()
This method returns the instance of the MCRObjectMetadata class. |
MCRMetaElement |
getMetadataElement(String tag)
This methode return the object metadata element selected by tag. |
MCRObjectStructure |
getStructure()
This methode return the instance of the MCRObjectStructure class. |
void |
receiveFromDatastore(MCRObjectID id)
The methode receive the object for the given MCRObjectID and stored it in this MCRObject. |
void |
receiveFromDatastore(String id)
The methode receive the object for the given MCRObjectID and stored it in this MCRObject. |
Document |
receiveJDOMFromDatastore(MCRObjectID id)
The methode receive the object for the given MCRObjectID and returned it as JDOM Document. |
Document |
receiveJDOMFromDatastore(String id)
The methode receive the object for the given MCRObjectID and returned it as JDOM Document. |
static byte[] |
receiveXMLFromDatastore(MCRObjectID id)
The methode receive the object for the given MCRObjectID and returned it as XML stream. |
static byte[] |
receiveXMLFromDatastore(String id)
The methode receive the object for the given MCRObjectID and returned it as XML stream. |
void |
removeDerivateInDatastore(String id,
String der_id)
The methode remove a derivate MCRMetaLinkID from the structure part and update the object with the ID in the data store. |
void |
repairPersitenceDatastore(MCRObjectID id)
The method updates the search index with the data from the XLM store. |
void |
repairPersitenceDatastore(String id)
The method updates the search index with the data from the XLM store. |
void |
setFromJDOM(Document doc)
This methode gets a JDOM-Document to build up the MyCoRe-Object. |
void |
setFromURI(URI uri)
This method read the XML input stream from an URI to build up the MyCoRe-Object. |
void |
setFromXML(byte[] xml,
boolean valid)
This method read the XML input stream from a byte array to build up the MyCoRe-Object. |
boolean |
setMetadataElement(MCRMetaElement obj,
String tag)
This methode set the object metadata part named by a tag. |
void |
setStructure(MCRObjectStructure structure)
This methode set the object MCRObjectStructure. |
void |
updateInDatastore()
The methode update the object in the data store. |
void |
updateThisInDatastore()
The method updates this object in the persistence layer. |
| Methods inherited from class org.mycore.datamodel.metadata.MCRBase |
|---|
getId, getLabel, getSchema, getService, getVersion, isImportMode, isValid, setId, setImportMode, setLabel, setSchema, setService, setVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MCRObject()
throws MCRException,
MCRConfigurationException
MCRException - general Exception of MyCoRe
MCRConfigurationException - a special exception for configuartion data| Method Detail |
|---|
public final MCRMetaElement getMetadataElement(String tag)
public final MCRObjectMetadata getMetadata()
public final MCRObjectStructure getStructure()
public final void setFromURI(URI uri)
throws MCRException
setFromURI in class MCRBaseuri - an URI
MCRException - general Exception of MyCoRe
public final void setFromXML(byte[] xml,
boolean valid)
throws MCRException
setFromXML in class MCRBasexml - a XML string
MCRException - general Exception of MyCoRe
public final void setFromJDOM(Document doc)
throws MCRException
doc - an JDOM Object
MCRException - general Exception of MyCoRe
public final boolean setMetadataElement(MCRMetaElement obj,
String tag)
obj - the class object of a metadata parttag - the tag of a metadata part
public final void setStructure(MCRObjectStructure structure)
structure - the object MCRObjectStructure part
public final Document createXML()
throws MCRException
createXML in class MCRBaseMCRException - if the content of this class is not valid
public final void createInDatastore()
throws MCRPersistenceException,
MCRActiveLinkException
createInDatastore in class MCRBaseMCRPersistenceException - if a persistence problem is occured
MCRActiveLinkException
public final void addDerivateInDatastore(String id,
MCRMetaLinkID link)
throws MCRPersistenceException
id - the object IDlink - a link to a derivate as MCRMetaLinkID
MCRPersistenceException - if a persistence problem is occured
public final void removeDerivateInDatastore(String id,
String der_id)
throws MCRPersistenceException
id - the object IDder_id - the derivate ID
MCRPersistenceException - if a persistence problem is occured
public final void deleteFromDatastore(String id)
throws MCRPersistenceException,
MCRActiveLinkException
deleteFromDatastore in class MCRBaseid - the object ID
MCRPersistenceException - if a persistence problem is occured
MCRActiveLinkException
public static final boolean existInDatastore(String id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public static final boolean existInDatastore(MCRObjectID id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public final void receiveFromDatastore(String id)
throws MCRPersistenceException
receiveFromDatastore in class MCRBaseid - the object ID
MCRPersistenceException - if a persistence problem is occured
public final void receiveFromDatastore(MCRObjectID id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public static final byte[] receiveXMLFromDatastore(String id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public static final byte[] receiveXMLFromDatastore(MCRObjectID id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public final Document receiveJDOMFromDatastore(String id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public final Document receiveJDOMFromDatastore(MCRObjectID id)
throws MCRPersistenceException
id - the object ID
MCRPersistenceException - if a persistence problem is occured
public final void updateInDatastore()
throws MCRPersistenceException,
MCRActiveLinkException
updateInDatastore in class MCRBaseMCRPersistenceException - if a persistence problem is occured
MCRActiveLinkException - if object is created (no real update) and references to it's
id already exist
public final void updateThisInDatastore()
throws MCRPersistenceException
MCRPersistenceException
public final void repairPersitenceDatastore(String id)
throws MCRPersistenceException
repairPersitenceDatastore in class MCRBaseid - the MCRObjectID as string
MCRPersistenceException
public final void repairPersitenceDatastore(MCRObjectID id)
throws MCRPersistenceException
repairPersitenceDatastore in class MCRBaseid - the MCRObjectID
MCRPersistenceExceptionpublic final void debug()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||