public class DleseCollectionFileIndexingWriter extends XMLFileIndexingWriter
Document
for a DLESE Collection XML record. The
reader for this type of Document
is DleseCollectionDocReader
. XMLDocReader
,
RecordDataService
,
FileIndexingServiceWriter
Modifier and Type | Class and Description |
---|---|
static class |
DleseCollectionFileIndexingWriter.CollectionAccessionStatusComparator
Allows sorting of a Collection accession status XML Node, by date giving precedence to status =
accessioned if dates are equal.
|
Constructor and Description |
---|
DleseCollectionFileIndexingWriter()
Create a DleseCollectionFileIndexingWriter.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
_getIds()
Gets the ID of this collection record.
|
protected void |
addFields(org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc,
java.io.File sourceFile)
Adds fields to the index that are part of the collection-level Document.
|
protected void |
destroy()
This method is called at the conclusion of processing and may be used for tear-down.
|
protected void |
finalize()
Perform finalization...
|
protected java.util.Date |
getAccessionDate()
Returns the accession date or null if this collection is not currently accessioned.
|
protected java.lang.String |
getAccessionStatus()
Gets the most recent accession status found in the XML record.
|
java.lang.String |
getAdditionalMetadata()
Gets the additional metadata for this collection that was indicated in
org.dlese.dpc.repository.RepositoryManager.putRecord when the collection was created inside an
additionalMetadata element, or null. |
protected java.lang.String |
getCollectionStatuses()
Gets the collectionStatus attribute of the DleseCollectionFileIndexingWriter object
|
protected java.lang.String |
getCost()
Gets the cost associated with this collection.
|
static java.lang.String |
getCurrentCollectionStatus(org.dom4j.Document doc)
Gets the status of the collection based on the values in the collection-level record.
|
org.apache.lucene.document.Document |
getDeletedDoc_OFF_2006_08_23(org.apache.lucene.document.Document existingDoc)
Creates a Lucene
Document from an existing CollectionFileIndexing
Document by setting the field "deleted" to "true" and making the modtime equal to current time. |
java.lang.String |
getDescription()
The description for the collection.
|
java.lang.String |
getDocType()
Gets the docType attribute of the DleseCollectionFileIndexingWriter, which is 'dlesecollect.'
|
protected java.lang.String |
getFormatOfRecords()
Gets the format of the records in this collection.
|
protected java.lang.String |
getFullTitle()
Returns the full title for the collection.
|
protected java.lang.String[] |
getGradeRanges()
Gets the gradeRanges for this collection.
|
protected java.lang.String |
getKey()
Gets the collection key used to identify the items in the collection this record refers to.
|
protected java.lang.String |
getKeywords()
Gets the keywords associated with this collection.
|
static long |
getNumInstances()
Gets the numInstances attribute of the DleseCollectionFileIndexingWriter class
|
protected java.lang.String |
getPartOfDRC()
Gets whether the collection is part of the DRC [true|false].
|
java.lang.String |
getReaderClass()
Gets the name of the concrete
DocReader class that is used to read
this type of Document , which is "DleseCollectionDocReader". |
protected java.lang.String |
getReviewProcess()
Gets the collection's review process statement.
|
protected java.lang.String |
getReviewProcessUrl()
Gets the URL to the collection's review process statement.
|
protected java.lang.String |
getScopeUrl()
Gets the URL to the collection's scope statement.
|
protected java.lang.String |
getShortTitle()
Returns the short title for the collection.
|
protected java.lang.String[] |
getSubjects()
Gets the subjects for this collection.
|
java.lang.String |
getTitle()
Gets the full title
|
java.lang.String[] |
getUrls()
Gets the URL to the collection.
|
protected java.lang.String |
getValidationReport()
Gets a report detailing any errors found in the XML validation of the collection record, or null if no
error was found.
|
protected java.util.Date |
getWhatsNewDate()
Returns the date used to determine "What's new" in the library.
|
protected java.lang.String |
getWhatsNewType()
Returns 'collection'.
|
boolean |
indexFullContentInDefaultAndStems()
Default and stems fields handled here, so do not index full content.
|
void |
init(java.io.File source,
org.apache.lucene.document.Document existingDoc)
Performs the necessary init functions (nothing done).
|
addCustomFields, getBoundingBox, getCollections, getDeletedDoc, getDocGroup, getDom4jDoc, getFieldContent, getFieldContent, getFieldName, getIds, getIndex, getMyAnnoResultDocs, getMyCollectionDoc, getOaiModtime, getPrimaryId, getRecordDataService, getRelatedIds, getRelatedIdsMap, getRelatedUrls, getRelatedUrlsMap, getTermStringFromStringArray, getXmlIndexer, getXmlIndexerFieldsConfig
abortIndexing, addDocToRemove, addToAdminDefaultField, addToDefaultField, create, getConfigAttributes, getDocsource, getFileContent, getFileIndexingPlugin, getFileIndexingService, getLuceneDoc, getPreviousRecordDoc, getSessionAttributes, getSourceDir, getSourceFile, isMakingDeletedDoc, isValidationEnabled, prtln, prtlnErr, setConfigAttributes, setDebug, setFileIndexingPlugin, setFileIndexingService, setIsMakingDeletedDoc, setValidationEnabled
public DleseCollectionFileIndexingWriter()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- If errorpublic static long getNumInstances()
protected java.lang.String getFullTitle() throws java.lang.Exception
java.lang.Exception
- If error reading XML.protected java.lang.String getShortTitle() throws java.lang.Exception
java.lang.Exception
- If error reading XML.public java.lang.String getTitle() throws java.lang.Exception
getTitle
in class XMLFileIndexingWriter
java.lang.Exception
- If errorpublic java.lang.String getDescription() throws java.lang.Exception
getDescription
in class XMLFileIndexingWriter
java.lang.Exception
- If error reading XML.public java.lang.String getAdditionalMetadata()
org.dlese.dpc.repository.RepositoryManager.putRecord
when the collection was created inside an
additionalMetadata element, or null.protected java.lang.String getPartOfDRC() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getAccessionStatus() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getCollectionStatuses() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getKey() throws java.lang.Exception
java.lang.Exception
- If errorpublic java.lang.String[] getUrls() throws java.lang.Exception
getUrls
in class XMLFileIndexingWriter
java.lang.Exception
- If errorprotected java.lang.String getScopeUrl() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getReviewProcessUrl() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getReviewProcess() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getFormatOfRecords() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getCost() throws java.lang.Exception
java.lang.Exception
- If errorprotected java.lang.String getKeywords() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDprotected java.lang.String[] getGradeRanges() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDprotected java.lang.String[] getSubjects() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDprotected java.lang.String[] _getIds() throws java.lang.Exception
_getIds
in class XMLFileIndexingWriter
java.lang.Exception
- If errorpublic java.lang.String getDocType()
getDocType
in interface DocWriter
getDocType
in class FileIndexingServiceWriter
public java.lang.String getReaderClass()
DocReader
class that is used to read
this type of Document
, which is "DleseCollectionDocReader".getReaderClass
in interface DocWriter
getReaderClass
in class FileIndexingServiceWriter
protected java.util.Date getAccessionDate() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.util.Date getWhatsNewDate() throws java.lang.Exception
getWhatsNewDate
in class XMLFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getWhatsNewType()
getWhatsNewType
in class XMLFileIndexingWriter
public void init(java.io.File source, org.apache.lucene.document.Document existingDoc) throws java.lang.Exception
init
in class XMLFileIndexingWriter
source
- The source file being indexedexistingDoc
- An existing Document that currently resides in the index for the given resource, or
null if none was previously presentjava.lang.Exception
- If an error occured during set-up.protected void destroy()
destroy
in class FileIndexingServiceWriter
protected java.lang.String getValidationReport() throws java.lang.Exception
getValidationReport
in class FileIndexingServiceWriter
java.lang.Exception
- If error in performing the validation.public boolean indexFullContentInDefaultAndStems()
indexFullContentInDefaultAndStems
in class XMLFileIndexingWriter
protected final void addFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc, java.io.File sourceFile) throws java.lang.Exception
addFields
in class XMLFileIndexingWriter
newDoc
- The new Document that is being created for this resourceexistingDoc
- An existing Document that currently resides in the index for the given resource, or
null if none was previously presentsourceFile
- The sourceFile that is being indexed.java.lang.Exception
- If an error occurspublic org.apache.lucene.document.Document getDeletedDoc_OFF_2006_08_23(org.apache.lucene.document.Document existingDoc) throws java.lang.Throwable
Document
from an existing CollectionFileIndexing
Document by setting the field "deleted" to "true" and making the modtime equal to current time.existingDoc
- An existing FileIndexingService Document that currently resides in the index for
the given resource.java.lang.Throwable
- Thrown if error occurspublic static final java.lang.String getCurrentCollectionStatus(org.dom4j.Document doc)
doc
- A dlese_collect XML Document