Package org.dlese.dpc.index.writer
Class DleseIMSFileIndexingWriter
java.lang.Object
org.dlese.dpc.index.writer.FileIndexingServiceWriter
org.dlese.dpc.index.writer.XMLFileIndexingWriter
org.dlese.dpc.index.writer.ItemFileIndexingWriter
org.dlese.dpc.index.writer.DleseIMSFileIndexingWriter
- All Implemented Interfaces:
DocWriter
Creates a Lucene
Document from a DLESE-IMS XML source file.
The Lucene Document fields that are created by this class are (in
addition the the ones listed for FileIndexingServiceWriter):
doctype - Set to 'dlese_ims'. Stored. Note: the actual indexing of this field happens
in the superclass FileIndexingServiceWriter.
additional fields - A number of additional fields are defined. See the Java code for
method addFrameworkFields(Document, Document) for details.
- Author:
- John Weatherley, Ryan Deardorff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final String[]_getIds()Gets the id attribute of the DleseIMSFileIndexingWriter objectprotected final voidaddFrameworkFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc) Adds custom fields to the index that are unique to DLESE-IMSprotected voiddestroy()Release map resources for GC after processing.protected DateReturns the accession date, which is null (unknown).protected StringReturns the accession status of this record, for example 'accessioned'.protected MmdRec[]Returns the MmdRecs for all records associated with this resouce, including myMmdRec.protected MmdRec[]Returns the MmdRecs for records in other collections that catalog the same resource.protected StringReturns null.protected StringReturns null.protected DateReturns null.protected StringReturns the items creator's full name.protected StringReturns the items creator's last name.final StringGets the description attribute of the DleseIMSFileIndexingWriter objectfinal StringGets the docType attribute of the DleseIMSFileIndexingWriter, which is 'dlese_ims.'protected booleanReturns false (not implemented).protected StringReturns the items keywords.protected MmdRecReturns the MmdRec for this record only.Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "ItemDocReader".protected String[]Returns the IDs of related resources that are cataloged by ID, or null if none are presentprotected String[]Returns the URLs of related resources that are cataloged by URL, or null if none are presentfinal StringgetTitle()Gets the title attribute of the DleseIMSFileIndexingWriter objectfinal String[]getUrls()Gets the url attribute of the DleseIMSFileIndexingWriter objectprotected StringGets a report detailing any errors found in the validation of the data, or null if no error was found.protected DateReturns the date used to determine "What's new" in the library, which is null (unknown).protected StringReturns null (unknown).booleanDefault and stems fields handled here, so do not index full content.voidInitialize the XML map prior to processingMethods inherited from class org.dlese.dpc.index.writer.ItemFileIndexingWriter
addFields, getMyAnnoResultDocs, initMethods inherited from class org.dlese.dpc.index.writer.XMLFileIndexingWriter
addCustomFields, getBoundingBox, getCollections, getDeletedDoc, getDocGroup, getDom4jDoc, getFieldContent, getFieldContent, getFieldName, getIds, getIndex, 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
-
DleseIMSFileIndexingWriter
public DleseIMSFileIndexingWriter()Create a DleseIMSFileIndexingWriter
-
-
Method Details
-
initItem
Initialize the XML map prior to processing- Specified by:
initItemin classItemFileIndexingWriter- Parameters:
source- The source file being indexed.existingDoc- A Document that previously existed in the index for this item, if present- Throws:
Exception- Thrown if error reading the XML map
-
destroy
protected void destroy()Release map resources for GC after processing.- Specified by:
destroyin classItemFileIndexingWriter
-
getReaderClass
Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "ItemDocReader".- Specified by:
getReaderClassin interfaceDocWriter- Specified by:
getReaderClassin classItemFileIndexingWriter- Returns:
- The STring "rg.dlese.dpc.index.reader.ItemDocReader".
-
getValidationReport
Gets a report detailing any errors found in the validation of the data, or null if no error was found.- Specified by:
getValidationReportin classItemFileIndexingWriter- 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.
-
getDocType
Gets the docType attribute of the DleseIMSFileIndexingWriter, which is 'dlese_ims.'- Specified by:
getDocTypein interfaceDocWriter- Specified by:
getDocTypein classItemFileIndexingWriter- Returns:
- The docType, which is 'dlese_ims.'
-
_getIds
Gets the id attribute of the DleseIMSFileIndexingWriter object- Specified by:
_getIdsin classXMLFileIndexingWriter- Returns:
- The id value
- Throws:
Exception- If an error occurs
-
getTitle
Gets the title attribute of the DleseIMSFileIndexingWriter object- Specified by:
getTitlein classXMLFileIndexingWriter- Returns:
- The title value
- Throws:
Exception- If an error occurs
-
getDescription
Gets the description attribute of the DleseIMSFileIndexingWriter object- Specified by:
getDescriptionin classXMLFileIndexingWriter- Returns:
- The description value
- Throws:
Exception- If an error occurs
-
getKeywords
Returns the items keywords. An empty String or null is acceptable. The String is tokenized, stored and indexed under the field key 'keywords' and is also indexed in the 'default' field.- Specified by:
getKeywordsin classItemFileIndexingWriter- Returns:
- The keywords String
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getCreatorLastName
Returns the items creator's last name. An empty String or null is acceptable. The String is tokenized, stored and indexed under the field the 'default' field only.- Specified by:
getCreatorLastNamein classItemFileIndexingWriter- Returns:
- The creator's last name String
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getAssociatedMmdRecs
Returns the MmdRecs for records in other collections that catalog the same resource. Does not include myMmdRec.- Specified by:
getAssociatedMmdRecsin classItemFileIndexingWriter- Returns:
- null
-
getAllMmdRecs
Returns the MmdRecs for all records associated with this resouce, including myMmdRec.- Specified by:
getAllMmdRecsin classItemFileIndexingWriter- Returns:
- null
-
getMyMmdRec
Returns the MmdRec for this record only.- Specified by:
getMyMmdRecin classItemFileIndexingWriter- Returns:
- null
-
getCreator
Returns the items creator's full name. An empty String or null is acceptable. The String is tokenized, stored and indexed under the field key 'creator' and is also indexed in the 'default' field.- Specified by:
getCreatorin classItemFileIndexingWriter- Returns:
- Creator's full name
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getContent
Returns null.- Specified by:
getContentin classItemFileIndexingWriter- Returns:
- null
-
getContentType
Returns null.- Specified by:
getContentTypein classItemFileIndexingWriter- Returns:
- null
-
getAccessionStatus
Returns the accession status of this record, for example 'accessioned'. The String is tokenized, stored and indexed under the field key 'accessionstatus'.- Specified by:
getAccessionStatusin classItemFileIndexingWriter- Returns:
- The accession status.
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getHasRelatedResource
Returns false (not implemented).- Specified by:
getHasRelatedResourcein classItemFileIndexingWriter- Returns:
- False.
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getRelatedResourceIds
Returns the IDs of related resources that are cataloged by ID, or null if none are present- Specified by:
getRelatedResourceIdsin classItemFileIndexingWriter- Returns:
- Related resource IDs, or null if none are available
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getRelatedResourceUrls
Returns the URLs of related resources that are cataloged by URL, or null if none are present- Specified by:
getRelatedResourceUrlsin classItemFileIndexingWriter- Returns:
- Related resource URLs, or null if none are available
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getUrls
Gets the url attribute of the DleseIMSFileIndexingWriter object- Specified by:
getUrlsin classXMLFileIndexingWriter- Returns:
- The url value
- Throws:
Exception- If an error occurs
-
getWhatsNewDate
Returns the date used to determine "What's new" in the library, which is null (unknown).- Overrides:
getWhatsNewDatein classItemFileIndexingWriter- 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.
-
getAccessionDate
Returns the accession date, which is null (unknown).- Specified by:
getAccessionDatein classItemFileIndexingWriter- 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.
-
getCreationDate
Returns null.- Specified by:
getCreationDatein classItemFileIndexingWriter- Returns:
- null
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
getWhatsNewType
Returns null (unknown).- Overrides:
getWhatsNewTypein classItemFileIndexingWriter- Returns:
- null.
- Throws:
Exception- This method should throw and Exception with appropriate error message if an error occurs.
-
indexFullContentInDefaultAndStems
public boolean indexFullContentInDefaultAndStems()Default and stems fields handled here, so do not index full content.- Specified by:
indexFullContentInDefaultAndStemsin classXMLFileIndexingWriter- Returns:
- False
-
addFrameworkFields
protected final void addFrameworkFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc) throws Exception Adds custom fields to the index that are unique to DLESE-IMS- Specified by:
addFrameworkFieldsin classItemFileIndexingWriter- Parameters:
newDoc- The feature to be added to the FrameworkFields attributeexistingDoc- The feature to be added to the FrameworkFields attribute- Throws:
Exception- If an error occurs
-