public class ADNFileIndexingWriter extends ItemFileIndexingWriter
Document
from an ADN-item metadata source file.
The Lucene Document
fields that are created by this class are (in
addition the the ones listed for FileIndexingServiceWriter
):
doctype
- Set to 'adn'. 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.
Constructor and Description |
---|
ADNFileIndexingWriter()
Create a ADNFileIndexingWriter that indexes the given collection in field collection.
|
ADNFileIndexingWriter(boolean isDupDoc)
Create a ADNFileIndexingWriter that indexes the given collection in field collection.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
_getIds()
Gets the id(s) for this item.
|
protected void |
addFrameworkFields(org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc)
Adds custom fields to the index that are unique to this framework.
|
protected void |
destroy()
Release map resources for GC after processing.
|
protected void |
finalize()
Perform finalization...
|
protected java.util.Date |
getAccessionDate()
Returns the accession date for the item, or null if this item is not accessioned.
|
protected java.lang.String |
getAccessionStatus()
Returns the accession status of this record, for example 'accessioned'.
|
protected MmdRec[] |
getAllMmdRecs()
Returns the MmdRecs for all records that catalog this resouce, including myMmdRec.
|
protected MmdRec[] |
getAssociatedMmdRecs()
Returns the MmdRecs for records in other collections that catalog the same resource, not including
myMmdRec.
|
protected java.lang.String |
getAudienceBeneficiary()
The audience beneficiary.
|
protected java.lang.String |
getAudienceInstructionalGoal()
The audience instructionalGoal.
|
protected java.lang.String |
getAudienceTeachingMethod()
The audience teachingMethod.
|
protected java.lang.String |
getAudienceToolFor()
The audience tool for.
|
protected java.lang.String |
getAudienceTypicalAgeRange()
The audience typical age range.
|
protected BoundingBox |
getBoundingBox()
Gets the boundingBox attribute of the ADNFileIndexingWriter object
|
java.lang.String[] |
getCollections()
Returns unique collection keys for the item being indexed, separated by spaces.
|
protected java.lang.String |
getContent()
Returns the content of the item this record catalogs, or null if not available.
|
protected java.lang.String[] |
getContentStandards()
Gets the contentStandards attribute of the ADNFileIndexingWriter object
|
protected java.lang.String |
getContentType()
Returns the content type of the item this record catalogs, or null if not available.
|
protected java.lang.String |
getCost()
Returns the item's cost.
|
protected java.util.Date |
getCreationDate()
Returns the date this item was first created, or null if not available.
|
protected java.lang.String |
getCreator()
Returns the items creator's full name.
|
protected java.lang.String |
getCreatorEmailAlt()
Gets the creator's alternate email.
|
protected java.lang.String |
getCreatorEmailPrimary()
Gets the creator's primary email.
|
protected java.lang.String |
getCreatorLastName()
Returns the items creator's last name.
|
java.lang.String |
getDescription()
Gets the description attribute of the ADNFileIndexingWriter object
|
java.lang.String |
getDocType()
Gets the docType attribute of the ADNFileIndexingWriter, which is 'adn.'
|
protected java.lang.String |
getEventNames()
Gets all event names as text.
|
protected java.lang.String[] |
getGradeRange()
Gets the gradeRange attribute of the ADNFileIndexingWriter object
|
protected boolean |
getHasRelatedResource()
Returns true if the item has one or more related resource, false otherwise.
|
protected java.lang.String |
getKeywords()
Returns the item's keywords sorted and separated by the '+' symbol.
|
protected MmdRec |
getMyMmdRec()
Returns the MmdRec for this record only.
|
static long |
getNumInstances()
Gets the numInstances attribute of the ADNFileIndexingWriter class
|
protected java.lang.String |
getOrganizationEmail()
Gets the oraganization email.
|
protected java.lang.String |
getOrganizationInstDepartment()
Gets the oraganizations institution department name.
|
protected java.lang.String |
getOrganizationInstName()
Gets the oraganizations institution name.
|
protected java.lang.String |
getPersonInstDepartment()
Gets the persons institution department name.
|
protected java.lang.String |
getPersonInstName()
Gets the persons institution name.
|
protected java.lang.String |
getPlaceNames()
Gets all place names as text.
|
java.lang.String |
getReaderClass()
Gets the name of the concrete
DocReader class that is used to read
this type of Document , which is "ItemDocReader". |
protected java.lang.String[] |
getRelatedResourceIds()
Returns the IDs of related resources that are cataloged by ID, or null if none are present
|
protected java.lang.String[] |
getRelatedResourceUrls()
Returns the URLs of related resources that are cataloged by URL, or null if none are present
|
protected java.lang.String[] |
getResourceTypes()
Gets the resourceTypes attribute of the ADNFileIndexingWriter object
|
protected java.lang.String[] |
getSubjects()
Gets the subjects attribute of the ADNFileIndexingWriter object
|
protected java.lang.String |
getTemporalCoverageNames()
Gets all temporal coverage names as text.
|
java.lang.String |
getTitle()
Gets the title attribute of the ADNFileIndexingWriter object
|
protected java.lang.String |
getUrlMirrors()
Gets the mirror URLs encoded as terms, if any.
|
java.lang.String[] |
getUrls()
Gets the url(s) from the ADN record(s).
|
protected java.lang.String |
getValidationReport()
Gets a report detailing any errors found in the validation of the data, or null if no error was found.
|
boolean |
indexFullContentInDefaultAndStems()
Default and stems fields handled here, so do not index full content.
|
void |
initItem(java.io.File source,
org.apache.lucene.document.Document existingDoc)
Initialize the XML map, MmdRecs and other data prior to processing
|
void |
setIsSingleDoc(boolean isSingleDoc)
Sets the whether this writer should write a single record doc rather than a multi-item doc.
|
addFields, getMyAnnoResultDocs, getWhatsNewDate, getWhatsNewType, init
addCustomFields, getDeletedDoc, getDocGroup, getDom4jDoc, getFieldContent, getFieldContent, getFieldName, getIds, getIndex, 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 ADNFileIndexingWriter()
public ADNFileIndexingWriter(boolean isDupDoc)
isDupDoc
- False to force this to be processed as a non-dupprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- If errorpublic static long getNumInstances()
public void initItem(java.io.File source, org.apache.lucene.document.Document existingDoc) throws java.lang.Exception
initItem
in class ItemFileIndexingWriter
source
- The source file being indexed.existingDoc
- A Document that previously existed in the index for this item, if presentjava.lang.Exception
- Thrown if error reading the XML mapprotected void destroy()
destroy
in class ItemFileIndexingWriter
public java.lang.String[] getCollections() throws java.lang.Exception
getCollections
in class XMLFileIndexingWriter
java.lang.Exception
- If errorprotected java.lang.String getAccessionStatus() throws java.lang.Exception
getAccessionStatus
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected boolean getHasRelatedResource() throws java.lang.Exception
getHasRelatedResource
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String[] getRelatedResourceIds() throws java.lang.Exception
getRelatedResourceIds
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String[] getRelatedResourceUrls() throws java.lang.Exception
getRelatedResourceUrls
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.util.Date getAccessionDate() throws java.lang.Exception
getAccessionDate
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.util.Date getCreationDate() throws java.lang.Exception
getCreationDate
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.public java.lang.String getReaderClass()
DocReader
class that is used to read
this type of Document
, which is "ItemDocReader".getReaderClass
in interface DocWriter
getReaderClass
in class ItemFileIndexingWriter
public boolean indexFullContentInDefaultAndStems()
indexFullContentInDefaultAndStems
in class XMLFileIndexingWriter
protected MmdRec[] getAssociatedMmdRecs()
getAssociatedMmdRecs
in class ItemFileIndexingWriter
protected MmdRec[] getAllMmdRecs()
getAllMmdRecs
in class ItemFileIndexingWriter
protected MmdRec getMyMmdRec()
getMyMmdRec
in class ItemFileIndexingWriter
protected java.lang.String getValidationReport() throws java.lang.Exception
getValidationReport
in class ItemFileIndexingWriter
java.lang.Exception
- If error in performing the validation.public final java.lang.String getDocType()
getDocType
in interface DocWriter
getDocType
in class ItemFileIndexingWriter
protected java.lang.String[] _getIds() throws java.lang.Exception
_getIds
in class XMLFileIndexingWriter
java.lang.Exception
- If an error occurspublic final java.lang.String getTitle() throws java.lang.Exception
getTitle
in class XMLFileIndexingWriter
java.lang.Exception
- If an error occurspublic final java.lang.String getDescription() throws java.lang.Exception
getDescription
in class XMLFileIndexingWriter
java.lang.Exception
- If an error occurspublic final java.lang.String[] getUrls() throws java.lang.Exception
getUrls
in class XMLFileIndexingWriter
java.lang.Exception
- If an error occursprotected java.lang.String getKeywords() throws java.lang.Exception
getKeywords
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getCreatorLastName() throws java.lang.Exception
getCreatorLastName
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getCreator() throws java.lang.Exception
getCreator
in class ItemFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getCost() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected BoundingBox getBoundingBox() throws java.lang.Exception
getBoundingBox
in class XMLFileIndexingWriter
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getContent()
getContent
in class ItemFileIndexingWriter
protected java.lang.String getContentType()
getContentType
in class ItemFileIndexingWriter
protected final void addFrameworkFields(org.apache.lucene.document.Document newDoc, org.apache.lucene.document.Document existingDoc) throws java.lang.Exception
addFrameworkFields
in class ItemFileIndexingWriter
newDoc
- The feature to be added to the FrameworkFields attributeexistingDoc
- The feature to be added to the FrameworkFields attributejava.lang.Exception
- If an error occurspublic void setIsSingleDoc(boolean isSingleDoc)
isSingleDoc
- The new isSingleDoc valueprotected java.lang.String[] getGradeRange()
protected java.lang.String[] getResourceTypes()
protected java.lang.String[] getContentStandards()
protected java.lang.String[] getSubjects()
protected java.lang.String getCreatorEmailPrimary() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getCreatorEmailAlt() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getOrganizationEmail() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getOrganizationInstName() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getOrganizationInstDepartment() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getPersonInstName() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getPersonInstDepartment() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getUrlMirrors() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getAudienceToolFor() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getAudienceBeneficiary() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getAudienceTypicalAgeRange() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getAudienceInstructionalGoal() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getAudienceTeachingMethod() throws java.lang.Exception
java.lang.Exception
- This method should throw and Exception with appropriate error message if an error
occurs.protected java.lang.String getPlaceNames()
protected java.lang.String getEventNames()
protected java.lang.String getTemporalCoverageNames()