|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.dcs.DcsDataRecord
public class DcsDataRecord
Used to manage dcs_data that is associated with an indexed item-level record. A DcsDataRecord reads from and writes to a file on disk that is named the same as it's "source" item-level record, but in a different directory.
NOTE: the Document attribute should be implemented as a org.dlese.dpc.schemedit.DocMap
!!
Constructor Summary | |
---|---|
DcsDataRecord(File dcsDataFile,
MetaDataFramework framework,
CollectionConfig collectionConfig,
DcsDataManager dcsDataManager)
Constructor for DcsDataRecord. |
Method Summary | |
---|---|
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(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. |
String |
getChangeDate()
Gets the changeDate attribute of the most recent StatusEntry. |
Date |
getChangeDateDate()
Gets the lastChangeDate (last status update) as a Date. |
String |
getCollection()
Gets the collection attribute of the DcsDataRecord object |
StatusEntry |
getCurrentEntry()
Gets the current StatusEntry attribute of the DcsDataRecord object |
String |
getDocType()
Gets the docType attribute of the DcsDataRecord, which is 'dcs_data' |
Document |
getDocument()
Gets Editable (localized and ampersand-expanded) Document for this record. |
List |
getEntryList()
Returns List of managed suggestions records. |
MetaDataFramework |
getFramework()
Gets the metadata framework of this DcsDataRecord |
String |
getHasSyncError()
Returns "true" if there are any sync errors (errors occuring when writing to an external repository, such as the NDR). |
String |
getId()
Gets the id attribute of the DcsDataRecord object |
String |
getIsValid()
Gets the isValid attribute of the DcsDataRecord object |
boolean |
getIsValidityUnknown()
Returns true |
String |
getLastEditor()
Gets the lastEditor attribute of the DcsDataRecord object, reflecting the last time the metadata was changed. |
String |
getLastSyncDate()
Gets the lastSyncDate attribute of the DcsDataRecord object |
Date |
getLastSyncDateDate()
Gets the lastSyncDateDate attribute of the DcsDataRecord object |
String |
getLastTouchDate()
Gets the lastTouchDate attribute of the DcsDataRecord object, reflecting the last time the metadata was changed. |
Date |
getLastTouchDateDate()
Gets the lastTouchDateDate attribute of the DcsDataRecord object |
String |
getMetadataProviderHandle()
Gets the ndrHandle attribute of the DcsDataRecord object |
String |
getNdrHandle()
Gets the ndrHandle attribute of the DcsDataRecord object |
Element |
getNdrInfo()
Gets the ndrInfo attribute of the DcsDataRecord object |
String |
getNdrNormalizedStatus()
|
String |
getNdrSyncError()
Gets the ndrHandle attribute of the DcsDataRecord object |
String |
getNsdlItemId()
Gets the nsdlItemId attribute of the DcsDataRecord object |
String |
getPriorStatus()
Gets the priorStatus attribute of the DcsDataRecord object |
String |
getSetSpec()
Gets the setSpec attribute of the DcsDataRecord object (used to cache the setSpec of collections written to the NDR. |
File |
getSource()
Gets the source attribute of the DcsDataRecord object |
String |
getStatus()
Gets the status attribute of the most recent StatusEntry. |
StatusEntry |
getStatusEntry(String changeDate)
Gets the statusEntry corresponding to provided changeDate |
String |
getStatusLabel()
Gets the readable representation of this record's status. |
String |
getStatusLabel(String value)
|
String |
getStatusNote()
Gets the statusNote attribute of the most recent StatusEntry. |
String |
getValidationReport()
Gets the validationReport attribute of the DcsDataRecord object |
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(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(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(String id)
Sets the id attribute of the DcsDataRecord object |
void |
setLastEditor(String userName)
Sets the lastEditor attribute of the DcsDataRecord object |
void |
setLastSyncDate(Date date)
Sets the lastSyncDate attribute of the DcsDataRecord object |
void |
setLastSyncDate(String dateString)
Sets the lastSyncDate attribute of the DcsDataRecord object |
void |
setLastTouchDate(String dateString)
Sets the lastTouchDate attribute of the DcsDataRecord object |
void |
setMetadataProviderHandle(String mdpHandle)
Sets the ndrHandle attribute of the DcsDataRecord object |
void |
setNdrHandle(String ndrHandle)
Sets the ndrHandle attribute of the DcsDataRecord object |
void |
setNdrSyncError(String ndrSyncError)
Sets the ndrSyncError attribute of the DcsDataRecord object |
void |
setNsdlItemId(String itemId)
Sets the nsdlItemId attribute of the DcsDataRecord object |
void |
setSetSpec(String setSpec)
Sets the setSpec attribute of the DcsDataRecord object |
void |
setSource(File source)
Sets the source attribute of the DcsDataRecord object |
void |
setValidationReport(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(String status,
String statusNote,
String editor)
Change the current status of this record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DcsDataRecord(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 dcsDataRecordsMethod Detail |
---|
public 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(String value)
public String getStatusLabel()
public String getStatusLabel(String value)
protected void normalizeStatus()
public void updateStatus(String status, String statusNote, String editor) throws Exception
status
- new status for this recordstatusNote
- new status noteeditor
- user performing status update
Exception
- if status cannot be updatedpublic void updateStatus(StatusEntry statusEntry) throws Exception
statusEntry
- new statusEntry
Exception
- if unable to updatepublic void updateStatus(StatusEntry statusEntry, boolean retainChangeDate) throws Exception
statusEntry
- new statusEntryretainChangeDate
- if true, change date is not altered
Exception
- if unable to updatepublic StatusEntry getCurrentEntry()
public List getEntryList()
public StatusEntry getStatusEntry(String changeDate)
changeDate
- key used to locate existing status entry
public void replaceStatusEntry(String changeDate, StatusEntry statusEntry) throws Exception
changeDate
- key used to locate existing status entrystatusEntry
- new status entry to be added to record
Exception
- if unable to add status entry (no exception thrown if entry to delete does not exist)public void deleteStatusEntry(String changeDate) throws Exception
changeDate
- key used to specify existing status entry
Exception
- NOT YET DOCUMENTEDpublic MetaDataFramework getFramework()
public Document getDocument() throws Exception
First tries to read from cache, then tries to read from disk, then creates new record.
Exception
- Description of the Exceptionpublic File getSource()
public void setSource(File source)
source
- The new source valuepublic String getIsValid()
public boolean isValid()
public boolean getIsValidityUnknown()
public Element getValidationReportElement()
public void setValidationReport(String report)
report
- The new validationReport valuepublic String getValidationReport()
public String getLastTouchDate()
public void setLastTouchDate(String dateString)
dateString
- The new lastTouchDate valuepublic Date getLastTouchDateDate()
public String getId()
public void setId(String id)
id
- The new id valuepublic String getLastEditor()
public void setLastEditor(String userName)
dateString
- The new lastEditor valuepublic void clearNdrInfo()
public Element getNdrInfo()
public String getNdrNormalizedStatus()
public String getNdrHandle()
public void setNdrHandle(String ndrHandle)
ndrHandle
- The new ndrHandle valuepublic String getMetadataProviderHandle()
public void setMetadataProviderHandle(String mdpHandle)
mdpHandle
- The new metadataProviderHandle valuepublic String getNsdlItemId()
public void setNsdlItemId(String itemId)
itemId
- The new nsdlItemId valuepublic void setLastSyncDate(String dateString)
dateString
- The new lastSyncDate valuepublic void setLastSyncDate(Date date)
date
- The new lastSyncDate valuepublic String getLastSyncDate()
public Date getLastSyncDateDate()
public String getNdrSyncError()
public boolean hasSyncError()
public String getHasSyncError()
public void setNdrSyncError(String ndrSyncError)
ndrSyncError
- The new ndrSyncError valuepublic void clearSyncErrors()
public String getSetSpec()
public void setSetSpec(String setSpec)
setSpec
- The new setSpec valuepublic String getStatus()
public String getPriorStatus()
public String getStatusNote()
public String getChangeDate()
public Date getChangeDateDate()
public void flushToDisk() throws Exception
Exception
- If record cannot be written to disk.public boolean delete() throws Exception
Exception
- NOT YET DOCUMENTEDpublic String getDocType()
protected void destroy()
public static void setDebug(boolean bol)
bol
- The new debug value
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |