public class DnxDocument
extends java.lang.Object
implements java.io.Serializable
DnxDocument defines a layer above org.dom4j.Document for accessing a DNX document
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FORMAT_NAME_VERSION_SEPARATOR |
static java.lang.String |
ID |
static java.lang.String |
KEY |
protected static com.exlibris.core.infra.common.exceptions.logging.ExLogger |
log |
static java.lang.String |
Q1 |
static java.lang.String |
Q2 |
static java.lang.String |
RECORD |
static java.lang.String |
SECTION |
Modifier and Type | Method and Description |
---|---|
void |
addEvent(com.exlibris.repository.persistence.HDeProvenance pEvent) |
void |
addSection(DnxSection section) |
void |
correctForFILE()
Correct the DNX document by
1) Assigning all FILE mandatory sections defined by the profile 2) Correcting all section keys according to the correction routines defined by the profile |
void |
correctForIE()
Correct the DNX document by
1) Assigning all IE mandatory sections defined by the profile 2) Correcting all section keys according to the correction routines defined by the profile |
void |
correctForREP()
Correct the DNX document by
1) Assigning all REP mandatory sections defined by the profile 2) Correcting all section keys according to the correction routines defined by the profile |
DnxSection |
createSection(java.lang.String sectionId)
Creates a new section in the DNX document with the ID provided by sectionId
The operation adds a new section to the underlying org.dom4j.Document and to the arrayList of existing DnxSection objects. |
void |
deleteSection(java.lang.String sectionId) |
DnxSectionRecord |
findRecordInSection(java.lang.String sectionId,
java.lang.String fieldName)
Find a record in a
DnxSection with a given field Value in a given fieldFor example, find a record in the section FileFormat where FileFormat.Type == "JPG" |
DnxDocument |
getDnxDocumentForDigiprovMd()
Generates a new DNX document from to the existing document with sections relevant to the DigiprovMd,
according to the assigned profile.
Note: Updates to the derived document will not affect the original document |
DnxDocument |
getDnxDocumentForRightshMd()
Generates a new DNX document from the existing document with sections relevant to the RightshMd,
according to the assigned profile.
Note: Updates to the derived document will not affect the original document |
DnxDocument |
getDnxDocumentForSourceMd()
Generates a new DNX document from the existing document with sections relevant to the SourceMd,
according to the assigned profile.
Note: Updates to the derived document will not affect the original document |
DnxDocument |
getDnxDocumentForTechMd()
Generates a new DNX document from the existing document with sections relevant to the TechMd,
according to the assigned profile.
Note: Updates to the derived document will not affect the original document |
java.lang.String |
getDnxDocumentVersion() |
org.dom4j.Document |
getDocument() |
java.lang.String |
getDocumentXml() |
void |
getFileFixityByType(java.lang.String fixityType,
java.lang.StringBuffer fixityValue)
Enter values of the given FILEFIXITY.FIXITYTYPE(for example, agent, value, etc.)
|
java.util.List<java.lang.String> |
getFileFixityTypes() |
void |
getFileFormatByType(java.lang.String inFormatName,
java.lang.String inFormatVersion,
java.lang.StringBuffer formatLibraryId,
java.lang.StringBuffer formatName,
java.lang.StringBuffer formatVersion,
java.lang.StringBuffer mimeType) |
java.util.List<java.lang.String> |
getFileFormatTypes() |
void |
getFileValidation(java.lang.StringBuffer agent,
java.lang.StringBuffer status,
java.lang.StringBuffer format,
java.lang.StringBuffer version,
java.lang.StringBuffer sigmatch,
java.lang.StringBuffer mimeType,
java.lang.StringBuffer profile,
java.lang.StringBuffer isValid,
java.lang.StringBuffer isWellFormed) |
java.util.List<Fixity> |
getFixities() |
DNXProfile |
getProfile()
Gets the DNX profile.
Usually the profile is set by the DnxDocumentFactory, with the default dnx_profile.xml file found by the Class Loader. |
java.lang.String |
getRecordSectionKeyValue(java.lang.String sectionId,
java.lang.String sectionKeyId,
java.lang.String recordKeyType) |
DnxSection |
getSectionById(java.lang.String sectionId)
Returns a DNXSection matching the given identifier
|
java.lang.String |
getSectionKeyValue(DNXConstants.SectionKey sectionKey)
Returns the value of the given sectionKey as a string.
|
java.lang.String |
getSectionKeyValue(java.lang.String sectionId,
java.lang.String sectionKeyId)
Returns the value of the given section and section key as a String.
|
java.util.List<DnxSectionRecord> |
getSectionRecordsListById(java.lang.String id) |
java.util.List<DnxSection> |
getSectionsList() |
com.exlibris.digitool.common.dnx.DnxValidator |
getValidator() |
void |
getVsOutcomeByType(java.lang.String outcomeType,
java.lang.StringBuffer agent,
java.lang.StringBuffer result,
java.lang.StringBuffer resultDetails,
java.lang.StringBuffer evaluation,
java.lang.StringBuffer evaluationDetails)
Enter values of the given VSOUTCOME.TYPE(for example, agent, result, etc.)
|
DnxSectionRecord |
getVsOutcomeRecordByType(java.lang.String outcomeType) |
static void |
main(java.lang.String[] args) |
void |
mergeDnxDocument(DnxDocument dnxRecord)
Merges the given DNX document into the current object by cloning each section (together with its records and record keys)
into the current object.
|
void |
mergeDnxDocuments(DnxDocument dnxRecordForTechMd,
DnxDocument dnxRecordForDigiprovMd,
DnxDocument dnxRecordForRightshMd,
DnxDocument dnxRecordForSourceMd)
Merges all three DNX documents into the current one.
|
void |
parseXmlToEventSection(java.lang.String eventRecordXml) |
void |
setDocument(org.dom4j.Document document) |
void |
setDocumentXml(java.lang.String documentXml) |
void |
setFileFixity(java.lang.String fixityAgent,
java.lang.String fixityType,
java.lang.String fixityValue)
Creates/updates the DnxSectionRecord for the given fixityType
in the
DNXConstants.FILEFIXITY sectionOn the first run, CREATIONDATE == CHECKDATE and FIXITYVALUE==CHECKRESULT. |
void |
setFileFormat(java.lang.String formatAgent,
java.lang.String formatLibraryId,
java.lang.String formatName,
java.lang.String formatVersion,
java.lang.String formatMimeType)
Creates/updates the DnxSectionRecord for the given format type
in the
DNXConstants.FILEFORMAT section |
void |
setFileValidation(java.lang.String agent,
java.lang.String status,
java.lang.String format,
java.lang.String version,
java.lang.String sigmatch,
java.lang.String mimeType,
java.lang.String profile,
java.lang.String isValid,
java.lang.String isWellFormed) |
void |
setProfile(DNXProfile profile)
Gets the DNX profile.
Usually, the profile is set by the DnxDocumentFactory, with the default dnx_profile.xml file found by the Class Loader. |
void |
setSectionsList(java.util.List<DnxSection> sectionsList) |
void |
setValidator(com.exlibris.digitool.common.dnx.DnxValidator validator) |
void |
setVsOutcome(java.lang.String type,
java.lang.String agent,
java.lang.String result,
java.lang.String resultDetails,
java.lang.String evaluation,
java.lang.String evaluationDetails)
Creates/updates the DnxSectionRecord for the given VsOutcome
in the
DNXConstants.VSOUTCOME section |
StoredEntityMetaData |
toStoredEntityMetaData()
Returns a
StoredEntityMetaData object with its pid, type, length set and file location. |
java.lang.String |
toString() |
void |
updateRecordSectionKey(java.lang.String sectionId,
java.lang.String keyId,
java.lang.String value) |
void |
updateRecordSectionKey(java.lang.String sectionId,
java.lang.String keyId,
java.lang.String type,
java.lang.String value) |
void |
updateSectionKey(DNXConstants.SectionKey sectionKey,
java.lang.String value)
Updates or creates a section key value.
|
void |
updateSectionKey(java.lang.String sectionId,
java.lang.String keyId,
java.lang.String value)
Updates or creates a section key value.
|
java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> |
validateForFile()
Validates the DNX document as a DNX for PREMIS object of type "FILE" and
the assigned profile.
|
java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> |
validateForIE()
Validates the DNX document as a DNX for PREMIS object of type "IE" and
the assigned profile.
|
java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> |
validateForRep()
Validates the DNX document as a DNX for PREMIS object of type "REP" and
the assigned profile.
|
protected static com.exlibris.core.infra.common.exceptions.logging.ExLogger log
public static java.lang.String ID
public static java.lang.String SECTION
public static java.lang.String RECORD
public static java.lang.String KEY
public static java.lang.String Q1
public static java.lang.String Q2
public static final java.lang.String FORMAT_NAME_VERSION_SEPARATOR
public java.lang.String getDnxDocumentVersion()
public java.util.List<Fixity> getFixities()
public StoredEntityMetaData toStoredEntityMetaData()
StoredEntityMetaData
object with its pid, type, length set and file location.public java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> validateForIE()
public java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> validateForRep()
public java.util.List<com.exlibris.digitool.common.dnx.DnxErrorReport> validateForFile()
public void correctForIE()
public void correctForREP()
public void correctForFILE()
public DnxSection createSection(java.lang.String sectionId)
sectionId
- The identifier of the sectionpublic void deleteSection(java.lang.String sectionId)
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<DnxSection> getSectionsList()
public DnxSection getSectionById(java.lang.String sectionId)
sectionId
- section identifierpublic java.lang.String getSectionKeyValue(DNXConstants.SectionKey sectionKey)
sectionKey
- an object containing the section identifier and key identifier.public java.lang.String getSectionKeyValue(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic java.lang.String getRecordSectionKeyValue(java.lang.String sectionId, java.lang.String sectionKeyId, java.lang.String recordKeyType)
public void updateSectionKey(DNXConstants.SectionKey sectionKey, java.lang.String value)
sectionKey
- an object containing the section identifier and key identifier.value
- The new string value of the key, replacing the old string valuepublic void updateSectionKey(java.lang.String sectionId, java.lang.String keyId, java.lang.String value)
sectionId
- the section identifierkeyId
- the section key identifiervalue
- The new string value of the key, replacing the old string valuepublic void updateRecordSectionKey(java.lang.String sectionId, java.lang.String keyId, java.lang.String type, java.lang.String value)
public void updateRecordSectionKey(java.lang.String sectionId, java.lang.String keyId, java.lang.String value)
public void parseXmlToEventSection(java.lang.String eventRecordXml) throws com.exlibris.digitool.exceptions.DepositProcessingException, java.io.IOException
com.exlibris.digitool.exceptions.DepositProcessingException
java.io.IOException
public void addEvent(com.exlibris.repository.persistence.HDeProvenance pEvent)
pEvent
- public DnxDocument getDnxDocumentForTechMd()
public DnxDocument getDnxDocumentForDigiprovMd()
public DnxDocument getDnxDocumentForRightshMd()
public DnxDocument getDnxDocumentForSourceMd()
public DNXProfile getProfile()
public void setProfile(DNXProfile profile)
profile
- The DNX profile according to which the document should workpublic void mergeDnxDocuments(DnxDocument dnxRecordForTechMd, DnxDocument dnxRecordForDigiprovMd, DnxDocument dnxRecordForRightshMd, DnxDocument dnxRecordForSourceMd)
dnxRecordForTechMd
- Dnx document containing sections relevant for TechMddnxRecordForDigiprovMd
- DNX document containing sections relevant for DigiprovMddnxRecordForRightshMd
- DNX document containing sections relevant for RightshMddnxRecordForSourceMd
- DNX document containing sections relevant for SourceMdpublic void mergeDnxDocument(DnxDocument dnxRecord)
dnxRecord
- The document containing all sections to clone and mergepublic static void main(java.lang.String[] args)
public DnxSectionRecord findRecordInSection(java.lang.String sectionId, java.lang.String fieldName)
DnxSection
with a given field Value in a given fieldpublic void setFileFixity(java.lang.String fixityAgent, java.lang.String fixityType, java.lang.String fixityValue) throws com.exlibris.digitool.exceptions.DigitoolException
DNXConstants.FILEFIXITY
sectionfixityAgent
- the package name and version of the fixityType implementationfixityType
- MD5, SHA1, or CRC32fixityValue
- checksum hash valuecom.exlibris.digitool.exceptions.DigitoolException
public java.util.List<java.lang.String> getFileFixityTypes()
public void getFileFixityByType(java.lang.String fixityType, java.lang.StringBuffer fixityValue)
public void setVsOutcome(java.lang.String type, java.lang.String agent, java.lang.String result, java.lang.String resultDetails, java.lang.String evaluation, java.lang.String evaluationDetails)
DNXConstants.VSOUTCOME
sectionpublic void getVsOutcomeByType(java.lang.String outcomeType, java.lang.StringBuffer agent, java.lang.StringBuffer result, java.lang.StringBuffer resultDetails, java.lang.StringBuffer evaluation, java.lang.StringBuffer evaluationDetails)
public DnxSectionRecord getVsOutcomeRecordByType(java.lang.String outcomeType)
public void getFileValidation(java.lang.StringBuffer agent, java.lang.StringBuffer status, java.lang.StringBuffer format, java.lang.StringBuffer version, java.lang.StringBuffer sigmatch, java.lang.StringBuffer mimeType, java.lang.StringBuffer profile, java.lang.StringBuffer isValid, java.lang.StringBuffer isWellFormed)
public void setFileValidation(java.lang.String agent, java.lang.String status, java.lang.String format, java.lang.String version, java.lang.String sigmatch, java.lang.String mimeType, java.lang.String profile, java.lang.String isValid, java.lang.String isWellFormed)
public void setFileFormat(java.lang.String formatAgent, java.lang.String formatLibraryId, java.lang.String formatName, java.lang.String formatVersion, java.lang.String formatMimeType) throws com.exlibris.digitool.exceptions.DigitoolException
DNXConstants.FILEFORMAT
sectionformatLibraryId
- for example, JHOVEcom.exlibris.digitool.exceptions.DigitoolException
public java.util.List<java.lang.String> getFileFormatTypes()
public void getFileFormatByType(java.lang.String inFormatName, java.lang.String inFormatVersion, java.lang.StringBuffer formatLibraryId, java.lang.StringBuffer formatName, java.lang.StringBuffer formatVersion, java.lang.StringBuffer mimeType)
public void setValidator(com.exlibris.digitool.common.dnx.DnxValidator validator)
public com.exlibris.digitool.common.dnx.DnxValidator getValidator()
public java.util.List<DnxSectionRecord> getSectionRecordsListById(java.lang.String id)
public org.dom4j.Document getDocument()
public void setDocument(org.dom4j.Document document)
public java.lang.String getDocumentXml()
public void setDocumentXml(java.lang.String documentXml)
public void setSectionsList(java.util.List<DnxSection> sectionsList)
public void addSection(DnxSection section)