Package org.dlese.dpc.index.writer
Class NCSCollectionFileIndexingWriter
java.lang.Object
org.dlese.dpc.index.writer.FileIndexingServiceWriter
org.dlese.dpc.index.writer.XMLFileIndexingWriter
org.dlese.dpc.index.writer.NCSCollectionFileIndexingWriter
- All Implemented Interfaces:
DocWriter
Used to write a Lucene
Document for a NCS Collection XML record.- Author:
- John Weatherley
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]_getIds()Gets the ID of this collection record.protected final voidaddFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc, File sourceFile) Adds fields to the index that are part of the collection-level Document.protected voiddestroy()This method is called at the conclusion of processing and may be used for tear-down.The description for the collection.Gets the docType attribute of the NCSCollectionFileIndexingWriter, which is 'ncs_collect.'Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "XMLDocReader".getTitle()Returns the title for the collection.String[]getUrls()Gets the URL to the collection.protected StringGets a report detailing any errors found in the XML validation of the collection record, or null if no error was found.protected DateReturns the date used to determine "What's new" in the library.protected StringReturns 'collection'.booleanPlace the entire XML content into the default and stems search field.voidNothing neededMethods inherited from class org.dlese.dpc.index.writer.XMLFileIndexingWriter
addCustomFields, getBoundingBox, getCollections, getDeletedDoc, getDocGroup, getDom4jDoc, getFieldContent, getFieldContent, getFieldName, getIds, getIndex, getMyAnnoResultDocs, getMyCollectionDoc, getOaiModtime, getPrimaryId, getRecordDataService, getRelatedIds, getRelatedIdsMap, getRelatedUrls, getRelatedUrlsMap, getTermStringFromStringArray, getXmlIndexer, getXmlIndexerFieldsConfigMethods inherited from class org.dlese.dpc.index.writer.FileIndexingServiceWriter
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
-
Constructor Details
-
NCSCollectionFileIndexingWriter
public NCSCollectionFileIndexingWriter()Create a NCSCollectionFileIndexingWriter.
-
-
Method Details
-
getTitle
Returns the title for the collection.- Specified by:
getTitlein classXMLFileIndexingWriter- Returns:
- The title value
- Throws:
Exception- If error reading XML.
-
getDescription
The description for the collection.- Specified by:
getDescriptionin classXMLFileIndexingWriter- Returns:
- The description String
- Throws:
Exception- If error reading XML.
-
getUrls
Gets the URL to the collection.- Specified by:
getUrlsin classXMLFileIndexingWriter- Returns:
- The collectionUrl value
- Throws:
Exception- If error
-
_getIds
Gets the ID of this collection record.- Specified by:
_getIdsin classXMLFileIndexingWriter- Returns:
- The ID
- Throws:
Exception- If error
-
getDocType
Gets the docType attribute of the NCSCollectionFileIndexingWriter, which is 'ncs_collect.'- Specified by:
getDocTypein interfaceDocWriter- Specified by:
getDocTypein classFileIndexingServiceWriter- Returns:
- The docType, which is 'ncs_collect.'
-
getReaderClass
Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "XMLDocReader".- Specified by:
getReaderClassin interfaceDocWriter- Specified by:
getReaderClassin classFileIndexingServiceWriter- Returns:
- The String "org.dlese.dpc.index.reader.XMLDocReader".
-
getWhatsNewDate
Returns the date used to determine "What's new" in the library. Just returns the file mod date.- Specified by:
getWhatsNewDatein classXMLFileIndexingWriter- Returns:
- The what's new date for the item
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getWhatsNewType
Returns 'collection'.- Specified by:
getWhatsNewTypein classXMLFileIndexingWriter- Returns:
- The string 'collection'.
-
init
Nothing needed- Specified by:
initin classXMLFileIndexingWriter- Parameters:
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 present- Throws:
Exception- If an error occured during set-up.
-
destroy
protected void destroy()This method is called at the conclusion of processing and may be used for tear-down.- Specified by:
destroyin classFileIndexingServiceWriter
-
getValidationReport
Gets a report detailing any errors found in the XML validation of the collection record, or null if no error was found.- Overrides:
getValidationReportin classFileIndexingServiceWriter- Returns:
- Null if no data validation errors were found, otherwise a String that details the nature of the error.
- Throws:
Exception- If error in performing the validation.
-
indexFullContentInDefaultAndStems
public boolean indexFullContentInDefaultAndStems()Place the entire XML content into the default and stems search field.- Specified by:
indexFullContentInDefaultAndStemsin classXMLFileIndexingWriter- Returns:
- True
-
addFields
protected final void addFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc, File sourceFile) throws Exception Adds fields to the index that are part of the collection-level Document.- Specified by:
addFieldsin classXMLFileIndexingWriter- Parameters:
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.- Throws:
Exception- If an error occurs
-