Package org.dlese.dpc.index.writer
Class DleseAnnoFileIndexingServiceWriter
java.lang.Object
org.dlese.dpc.index.writer.FileIndexingServiceWriter
org.dlese.dpc.index.writer.XMLFileIndexingWriter
org.dlese.dpc.index.writer.DleseAnnoFileIndexingServiceWriter
- All Implemented Interfaces:
DocWriter
Creates a Lucene
Documents for a DLESE annotation record. The Lucene fields that are created by this class are:
-
collection- The collection associated with this resource. Stored. Appended with a '0' at the beginning to support wildcard searching. - Others...
- Author:
- John Weatherley
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a DleseAnnoFileIndexingServiceWriter -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]_getIds()Gets the id of this annotationprotected voidaddFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc, File sourceFile) Adds additional custom fields that are unique to the dlese anno document format being indexed.protected voiddestroy()This method is called at the conclusion of processing and may be used for tear-down.protected voidfinalize()Perform finalization...Return a description for the document being indexed, or null if none applies.Gets the docType attribute of the DleseAnnoFileIndexingServiceWriter objectstatic longGets the numInstances attribute of the DleseAnnoFileIndexingServiceWriter classGets the fully qualified name of the concreteDocReaderclass that is used to read this type ofDocument, for example "org.dlese.dpc.index.reader.ItemDocReader".getTitle()Return a title for the document being indexed, or null if none applies.String[]getUrls()Return the URL(s) to the resource being indexed, or null if none apply.protected StringGets a report detailing any errors found in the validation of the data, or null if no error was found.protected DateReturns the the first available of item/statusOf@date, service/date@modified or service/date@created.protected StringReturns 'annocomplete,' 'annoinprogress,' 'drcannocomplete,' or 'drcannoinprogress'.booleanDefault and stems fields handled here, so do not index full content.voidThis method is called prior to processing and may be used to for any necessary set-up.Methods 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
-
DleseAnnoFileIndexingServiceWriter
public DleseAnnoFileIndexingServiceWriter()Create a DleseAnnoFileIndexingServiceWriter
-
-
Method Details
-
finalize
Perform finalization... closing resources, etc. -
getNumInstances
public static long getNumInstances()Gets the numInstances attribute of the DleseAnnoFileIndexingServiceWriter class- Returns:
- The numInstances value
-
getDocType
Gets the docType attribute of the DleseAnnoFileIndexingServiceWriter object- Specified by:
getDocTypein interfaceDocWriter- Specified by:
getDocTypein classFileIndexingServiceWriter- Returns:
- The docType value
- Throws:
Exception- if error
-
getReaderClass
Gets the fully qualified name of the concreteDocReaderclass that is used to read this type ofDocument, for example "org.dlese.dpc.index.reader.ItemDocReader".- Specified by:
getReaderClassin interfaceDocWriter- Specified by:
getReaderClassin classFileIndexingServiceWriter- Returns:
- The String "org.dlese.dpc.index.reader.DleseAnnoDocReader"
-
init
This method is called prior to processing and may be used to for any necessary set-up. This method should throw and exception with appropriate message if an error occurs.- 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.
-
getValidationReport
Gets a report detailing any errors found in the validation of the data, 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.
-
destroy
protected void destroy()This method is called at the conclusion of processing and may be used for tear-down.- Specified by:
destroyin classFileIndexingServiceWriter
-
_getIds
Gets the id of this annotation- Specified by:
_getIdsin classXMLFileIndexingWriter- Returns:
- The id value
-
getUrls
Description copied from class:XMLFileIndexingWriterReturn the URL(s) to the resource being indexed, or null if none apply. If more than one URL references the resource, the first one is the primary. The URL Strings are tokenized and indexed under the field key 'uri' and is also indexed in the 'default' field. It is also stored in the index untokenized under the field key 'url.'- Specified by:
getUrlsin classXMLFileIndexingWriter- Returns:
- The url String(s)
-
getTitle
Description copied from class:XMLFileIndexingWriterReturn a title for the document being indexed, or null if none applies. The String is tokenized, stored and indexed under the field key 'title' and is also indexed in the 'default' field.- Specified by:
getTitlein classXMLFileIndexingWriter- Returns:
- The title String
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getDescription
Description copied from class:XMLFileIndexingWriterReturn a description for the document being indexed, or null if none applies. The String is tokenized, stored and indexed under the field key 'description' and is also indexed in the 'default' field.- Specified by:
getDescriptionin classXMLFileIndexingWriter- Returns:
- The description String
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getWhatsNewDate
Returns the the first available of item/statusOf@date, service/date@modified or service/date@created. Note that the statusOf@date was deprecated as of anno framework v1.0.- Specified by:
getWhatsNewDatein classXMLFileIndexingWriter- Returns:
- The what's new date for the annotation
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getWhatsNewType
Returns 'annocomplete,' 'annoinprogress,' 'drcannocomplete,' or 'drcannoinprogress'.- Specified by:
getWhatsNewTypein classXMLFileIndexingWriter- Returns:
- The string 'annocomplete,' 'annoinprogress,' 'drcannocomplete,' or 'drcannoinprogress'.
- Throws:
Exception- If error
-
indexFullContentInDefaultAndStems
public boolean indexFullContentInDefaultAndStems()Default and stems fields handled here, so do not index full content.- Specified by:
indexFullContentInDefaultAndStemsin classXMLFileIndexingWriter- Returns:
- False
-
addFields
protected void addFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc, File sourceFile) throws Exception Adds additional custom fields that are unique to the dlese anno document format being indexed.- Specified by:
addFieldsin classXMLFileIndexingWriter- Parameters:
newDoc- The newDocumentthat is being created for this resourceexistingDoc- An existingDocumentthat currently resides in the index for the given resource, or null if none was previously presentsourceFile- The sourceFile that is being indexed- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-