public class DcsDataRecord
extends java.lang.Object
implements java.io.Serializable
NOTE: the Document attribute should be implemented as a org.dlese.dpc.schemedit.DocMap
!!
Constructor and Description |
---|
DcsDataRecord(java.io.File dcsDataFile,
MetaDataFramework framework,
CollectionConfig collectionConfig,
DcsDataManager dcsDataManager)
Constructor for DcsDataRecord.
|
Modifier and Type | Method and Description |
---|---|
void |
clearNdrInfo()
Clear the ndrInfo element
|
void |
clearSyncErrors()
Clear any errors associated with External repositories, such as the NDR.
|
boolean |
delete()
Delete this record by removing it from the cache, destroying the contents,
and deleting the source file from disk.
|
void |
deleteStatusEntry(java.lang.String changeDate)
Remove specified status entry from the status entry list
|
protected void |
destroy()
This method is called at the conclusion of processing and may be used for
tear-down.
|
void |
flushToDisk()
Write record to disk and then remove it from cashe so any xml processing
(such as contracting ampersands) is picked up next time record is needed.
|
java.lang.String |
getChangeDate()
Gets the changeDate attribute of the most recent StatusEntry.
|
java.util.Date |
getChangeDateDate()
Gets the lastChangeDate (last status update) as a Date.
|
java.lang.String |
getCollection()
Gets the collection attribute of the DcsDataRecord object
|
StatusEntry |
getCurrentEntry()
Gets the current StatusEntry attribute of the DcsDataRecord object
|
java.lang.String |
getDocType()
Gets the docType attribute of the DcsDataRecord, which is 'dcs_data'
|
org.dom4j.Document |
getDocument()
Gets Editable (localized and ampersand-expanded) Document for this record.
|
java.util.List |
getEntryList()
Returns List of managed suggestions records.
|
MetaDataFramework |
getFramework()
Gets the metadata framework of this DcsDataRecord
|
java.lang.String |
getHasSyncError()
Returns "true" if there are any sync errors (errors occuring when writing to
an external repository, such as the NDR).
|
java.lang.String |
getId()
Gets the id attribute of the DcsDataRecord object
|
java.lang.String |
getIsValid()
Gets the isValid attribute of the DcsDataRecord object
|
boolean |
getIsValidityUnknown()
Returns true
|
java.lang.String |
getLastEditor()
Gets the lastEditor attribute of the DcsDataRecord object, reflecting
the last time the metadata was changed.
|
java.lang.String |
getLastSyncDate()
Gets the lastSyncDate attribute of the DcsDataRecord object
|
java.util.Date |
getLastSyncDateDate()
Gets the lastSyncDateDate attribute of the DcsDataRecord object
|
java.lang.String |
getLastTouchDate()
Gets the lastTouchDate attribute of the DcsDataRecord object, reflecting
the last time the metadata was changed.
|
java.util.Date |
getLastTouchDateDate()
Gets the lastTouchDateDate attribute of the DcsDataRecord object
|
java.lang.String |
getMetadataProviderHandle()
Gets the ndrHandle attribute of the DcsDataRecord object
|
java.lang.String |
getNdrHandle()
Gets the ndrHandle attribute of the DcsDataRecord object
|
org.dom4j.Element |
getNdrInfo()
Gets the ndrInfo attribute of the DcsDataRecord object
|
java.lang.String |
getNdrNormalizedStatus() |
java.lang.String |
getNdrSyncError()
Gets the ndrHandle attribute of the DcsDataRecord object
|
java.lang.String |
getNsdlItemId()
Gets the nsdlItemId attribute of the DcsDataRecord object
|
java.lang.String |
getPriorStatus()
Gets the priorStatus attribute of the DcsDataRecord object
|
java.lang.String |
getSetSpec()
Gets the setSpec attribute of the DcsDataRecord object (used to cache the
setSpec of collections written to the NDR.
|
java.io.File |
getSource()
Gets the source attribute of the DcsDataRecord object
|
java.lang.String |
getStatus()
Gets the status attribute of the most recent StatusEntry.
|
StatusEntry |
getStatusEntry(java.lang.String changeDate)
Gets the statusEntry corresponding to provided changeDate
|
java.lang.String |
getStatusLabel()
Gets the readable representation of this record's status.
|
java.lang.String |
getStatusLabel(java.lang.String value) |
java.lang.String |
getStatusNote()
Gets the statusNote attribute of the most recent StatusEntry.
|
java.lang.String |
getValidationReport()
Gets the validationReport attribute of the DcsDataRecord object
|
org.dom4j.Element |
getValidationReportElement()
Gets the validationReportElement attribute of the DcsDataRecord object
|
boolean |
hasSyncError()
Returns true if this DcsDataRecord has a sync error
|
boolean |
isFinalStatus()
Returns true if this record has "Final" status.
|
boolean |
isFinalStatus(java.lang.String value) |
boolean |
isValid()
Gets the valid attribute of the DcsDataRecord object
|
protected void |
normalizeStatus()
Ensure that 1) records having a status LABEL equal to the configured final
status label also have the correct status VALUE, and 2) records having a final
status refer to the correct collection.
|
void |
replaceStatusEntry(java.lang.String changeDate,
StatusEntry statusEntry)
Removes statusEntry corresponding to provided changeDate, and then adds new statusEntry
|
void |
setCollectionConfig(CollectionConfig collectionConfig) |
static void |
setDebug(boolean bol)
Sets the debug attribute of the DcsDataRecord class
|
void |
setId(java.lang.String id)
Sets the id attribute of the DcsDataRecord object
|
void |
setLastEditor(java.lang.String userName)
Sets the lastEditor attribute of the DcsDataRecord object
|
void |
setLastSyncDate(java.util.Date date)
Sets the lastSyncDate attribute of the DcsDataRecord object
|
void |
setLastSyncDate(java.lang.String dateString)
Sets the lastSyncDate attribute of the DcsDataRecord object
|
void |
setLastTouchDate(java.lang.String dateString)
Sets the lastTouchDate attribute of the DcsDataRecord object
|
void |
setMetadataProviderHandle(java.lang.String mdpHandle)
Sets the ndrHandle attribute of the DcsDataRecord object
|
void |
setNdrHandle(java.lang.String ndrHandle)
Sets the ndrHandle attribute of the DcsDataRecord object
|
void |
setNdrSyncError(java.lang.String ndrSyncError)
Sets the ndrSyncError attribute of the DcsDataRecord object
|
void |
setNsdlItemId(java.lang.String itemId)
Sets the nsdlItemId attribute of the DcsDataRecord object
|
void |
setSetSpec(java.lang.String setSpec)
Sets the setSpec attribute of the DcsDataRecord object
|
void |
setSource(java.io.File source)
Sets the source attribute of the DcsDataRecord object
|
void |
setValidationReport(java.lang.String report)
Sets the validationReport attribute of the DcsDataRecord object
|
void |
updateStatus(StatusEntry statusEntry)
Update this record's status with the provided StatusEntry object.
|
void |
updateStatus(StatusEntry statusEntry,
boolean retainChangeDate)
Update this record's status with the provided StatusEntry object and notify
event Listeners of change.
|
void |
updateStatus(java.lang.String status,
java.lang.String statusNote,
java.lang.String editor)
Change the current status of this record.
|
public DcsDataRecord(java.io.File dcsDataFile, MetaDataFramework framework, CollectionConfig collectionConfig, DcsDataManager dcsDataManager)
dcsDataFile
- file on disk containing xml sourceframework
- this record's frameworkcollectionConfig
- this record's collectiondcsDataManager
- manager for all dcsDataRecordspublic java.lang.String getCollection()
public void setCollectionConfig(CollectionConfig collectionConfig)
public boolean isFinalStatus()
This method returns true if the status value has the pattern "_|-final-{*}-|_" and as a side effect calls "normalize" to ensure that the collection key part of the status value refers to the correct collection.
public boolean isFinalStatus(java.lang.String value)
public java.lang.String getStatusLabel()
public java.lang.String getStatusLabel(java.lang.String value)
protected void normalizeStatus()
public void updateStatus(java.lang.String status, java.lang.String statusNote, java.lang.String editor) throws java.lang.Exception
status
- new status for this recordstatusNote
- new status noteeditor
- user performing status updatejava.lang.Exception
- if status cannot be updatedpublic void updateStatus(StatusEntry statusEntry) throws java.lang.Exception
statusEntry
- new statusEntryjava.lang.Exception
- if unable to updatepublic void updateStatus(StatusEntry statusEntry, boolean retainChangeDate) throws java.lang.Exception
statusEntry
- new statusEntryretainChangeDate
- if true, change date is not alteredjava.lang.Exception
- if unable to updatepublic StatusEntry getCurrentEntry()
public java.util.List getEntryList()
public StatusEntry getStatusEntry(java.lang.String changeDate)
changeDate
- key used to locate existing status entrypublic void replaceStatusEntry(java.lang.String changeDate, StatusEntry statusEntry) throws java.lang.Exception
changeDate
- key used to locate existing status entrystatusEntry
- new status entry to be added to recordjava.lang.Exception
- if unable to add status entry (no exception thrown if entry to delete does not exist)public void deleteStatusEntry(java.lang.String changeDate) throws java.lang.Exception
changeDate
- key used to specify existing status entryjava.lang.Exception
- NOT YET DOCUMENTEDpublic MetaDataFramework getFramework()
public org.dom4j.Document getDocument() throws java.lang.Exception
First tries to read from cache, then tries to read from disk, then creates new record.
java.lang.Exception
- Description of the Exceptionpublic java.io.File getSource()
public void setSource(java.io.File source)
source
- The new source valuepublic java.lang.String getIsValid()
public boolean isValid()
public boolean getIsValidityUnknown()
public org.dom4j.Element getValidationReportElement()
public void setValidationReport(java.lang.String report)
report
- The new validationReport valuepublic java.lang.String getValidationReport()
public java.lang.String getLastTouchDate()
public void setLastTouchDate(java.lang.String dateString)
dateString
- The new lastTouchDate valuepublic java.util.Date getLastTouchDateDate()
public java.lang.String getId()
public void setId(java.lang.String id)
id
- The new id valuepublic java.lang.String getLastEditor()
public void setLastEditor(java.lang.String userName)
dateString
- The new lastEditor valuepublic void clearNdrInfo()
public org.dom4j.Element getNdrInfo()
public java.lang.String getNdrNormalizedStatus()
public java.lang.String getNdrHandle()
public void setNdrHandle(java.lang.String ndrHandle)
ndrHandle
- The new ndrHandle valuepublic java.lang.String getMetadataProviderHandle()
public void setMetadataProviderHandle(java.lang.String mdpHandle)
mdpHandle
- The new metadataProviderHandle valuepublic java.lang.String getNsdlItemId()
public void setNsdlItemId(java.lang.String itemId)
itemId
- The new nsdlItemId valuepublic void setLastSyncDate(java.lang.String dateString)
dateString
- The new lastSyncDate valuepublic void setLastSyncDate(java.util.Date date)
date
- The new lastSyncDate valuepublic java.lang.String getLastSyncDate()
public java.util.Date getLastSyncDateDate()
public java.lang.String getNdrSyncError()
public boolean hasSyncError()
public java.lang.String getHasSyncError()
public void setNdrSyncError(java.lang.String ndrSyncError)
ndrSyncError
- The new ndrSyncError valuepublic void clearSyncErrors()
public java.lang.String getSetSpec()
public void setSetSpec(java.lang.String setSpec)
setSpec
- The new setSpec valuepublic java.lang.String getStatus()
public java.lang.String getPriorStatus()
public java.lang.String getStatusNote()
public java.lang.String getChangeDate()
public java.util.Date getChangeDateDate()
public void flushToDisk() throws java.lang.Exception
java.lang.Exception
- If record cannot be written to disk.public boolean delete() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDpublic java.lang.String getDocType()
protected void destroy()
public static void setDebug(boolean bol)
bol
- The new debug value