DLESE Tools
v1.2

org.dlese.dpc.index.reader
Class ItemDocReader

java.lang.Object
  extended byorg.dlese.dpc.index.reader.DocReader
      extended byorg.dlese.dpc.index.reader.FileIndexingServiceDocReader
          extended byorg.dlese.dpc.index.reader.XMLDocReader
              extended byorg.dlese.dpc.index.reader.ItemDocReader
All Implemented Interfaces:
Serializable

public class ItemDocReader
extends XMLDocReader

Provides getter methods to read data from a item-level metadata record in a Lucene Document that was created by a org.dlese.dpc.index.writer.ItmeFileIndexingWriter. The getter methods can then be accessed from (Struts) beans that need the data. This class may be extended for each document type that might be returned in a search. For example: DLESE-IMS, ADN-i, ADN-c or DC. Instances of this class and sublcasses are created by ResultDoc. After implemeting a new ItemDocReader, a new switch to access it should be added to class ResultDoc. In general, one ItemDocReader may be created for each document type that is defined in package org.dlese.dpc.index.writer.

Author:
John Weatherley
See Also:
ItemFileIndexingWriter, Serialized Form

Field Summary
 
Fields inherited from class org.dlese.dpc.index.reader.XMLDocReader
recordDataService, vocab
 
Fields inherited from class org.dlese.dpc.index.reader.DocReader
conf, doc, score
 
Constructor Summary
ItemDocReader(Document doc, float score, ResultDocConfig conf)
          Constructor that is used by ResultDoc at search time to create a new instance.
ItemDocReader(Document doc, SimpleLuceneIndex index)
          Constructor that may be used programatically to wrap a reader around a Lucene Document created by a ItemFileIndexingWriter.
 
Method Summary
 String getAccessionStatus()
          Gets the AccessionStatus attribute of the XMLDocReader object
 String[] getAllAssociatedCollectionKeys()
          Gets the collection keys for all collections that are associated with this resource including collections that are not enabled.
 ResultDoc[] getAllItemResultDocs()
          Gets the ItemDocReaders for all records that refer to this resource.
 String[] getAnnoCollectionKeys()
          Gets the annoCollectionKeys attribute of the ItemDocReader object
 String[] getAnnoPathways()
          Gets the anno pathways that are associated with this record.
 String[] getAnnoStatus()
          Gets the annoStatus attribute of the ItemDocReader object
 ResultDoc[] getAnnotationResultDocs()
          Gets the ResultDocs for all annotations that refer to this resource.
 String[] getAnnoTypes()
          Gets the anno types that are associated with this record.
 ArrayList getAssociatedCollectionKeys()
          Gets the collection keys for all enabled collections that are associated with this resource.
 String[] getAssociatedIds()
          Gets the IDs of records that refer to the same resource.
 ResultDoc[] getAssociatedItemResultDocs()
          Gets the ItemDocReaders for all associated items for this item (refer to same resource).
 ArrayList getAudioAnnosInProgress()
           
 String[] getCollections()
          Gets the collections associated with this record as an array of Strings.
 String getCollectionsString()
          Gets the collections associated with this record as a single String.
 ArrayList getCompletedAdvice()
           
 ArrayList getCompletedAnnos()
           
 ArrayList getCompletedAnnosOfType(String type)
           
 ArrayList getCompletedAnnotation()
           
 ArrayList getCompletedAverageScores()
           
 ArrayList getCompletedBias()
           
 ArrayList getCompletedChallengingSituations()
           
 ArrayList getCompletedChange()
           
 ArrayList getCompletedComment()
           
 ArrayList getCompletedEditorSummaries()
           
 ArrayList getCompletedEducationalStandard()
           
 ArrayList getCompletedExample()
           
 ArrayList getCompletedExplanation()
           
 ArrayList getCompletedQuestion()
           
 ArrayList getCompletedReviews()
           
 ArrayList getCompletedSeeAlso()
           
 ArrayList getCompletedTeachingTips()
           
 String[] getContentStandards()
          Gets the contentStandards attribute of the ItemDocReader object
 String getDescription()
          Gets the description attribute of the ItemDocReader object
 ResultDoc[] getDisplayableAssociatedItemResultDocs()
          Gets the ItemDocReaders for all associated items (refer to same resource) for this item that have an appropriate status for display in discovery.
 String[] getErrorStrings()
          Gets the errors identified by the ID mapper for this records.
 String[] getErrorTypes()
          Gets the errors types (codes) identified by the ID mapper for this records.
 String[] getGradeRanges()
          Gets the gradeRanges attribute of the ItemDocReader object
 ArrayList getGraphicalAnnosInProgress()
           
 String getHasCompletedAnno()
           
 String getHasInProgressAnno()
           
 ArrayList getInProgressAnnosOfStatus(String type)
           
 String[] getKeywords()
          Gets the keywords as an array.
 String getKeywordsDisplay()
          Gets the keywords a comma separated list terminated with a period suitable for display to users.
 ArrayList getMissingAssociatedItemIds()
          Gets the missingAssociatedItemIds for associated items that are not in the index.
 String getMultiAccessionStatus()
          Gets the multiAccessionStatus attribute of the XMLDocReader object
 String getMultiDescription()
          Gets the multiDescription attribute of the ItemDocReader object
 String[] getMultiGradeRanges()
          Gets the multiGradeRanges attribute of the ItemDocReader object
 String getMultiIds()
          Gets the multiIds attribute of the ItemDocReader object
 String getMultiRecordStatus()
          Gets the multiRecordStatus attribute of the ItemDocReader object
 String getMultiTitle()
          Gets the title attribute of the ItemDocReader object
 String getNumAudioAnnosInProgress()
           
 String getNumCompletedAnnos()
           
 String getNumGraphicalAnnosInProgress()
           
 String getNumInProgressAnnos()
           
 String getNumTextAnnosInProgress()
           
 String getPartOfDRC()
          Gets part of DRC status (true or false).
 String getReaderType()
          Gets the String 'ItemDocReader,' which is the key that describes this reader type.
 String[] getResourceTypes()
          Gets the resourceTypes attribute of the ItemDocReader object
 String[] getSubjects()
          Gets the subjects attribute of the ItemDocReader object
 ArrayList getTextAnnosInProgress()
           
 String getTitle()
          Gets the title attribute of the ItemDocReader object
 String getUrl()
          Gets the url attribute of the ItemDocReader object
 boolean hasAnnotations()
          DESCRIPTION
 boolean hasCompletedAnno()
           
 boolean hasCompletedAnnoOfType(String type)
           
 boolean hasInProgressAnno()
           
 boolean hasInProgressAnnoOfStatus(String type)
           
 boolean isMultiRecord()
          Gets the multiRecord attribute of the ItemDocReader object
 
Methods inherited from class org.dlese.dpc.index.reader.XMLDocReader
getAvailableFormats, getCollectionKey, getCollectionKeys, getDocsource, getFieldName, getId, getIndexedContent, getMetadataPrefix, getNativeFormat, getOaiDatestamp, getOaiLastModifiedString, getSets, getSetString, getValidationReport, getXml, getXmlFormat, getXmlStripped, isValid, setXMLConversionService
 
Methods inherited from class org.dlese.dpc.index.reader.FileIndexingServiceDocReader
fileExists, getDateStamp, getDeleted, getDocDir, getDocsourceEncoded, getDoctype, getFileExists, getFileName, getFullContent, getLastModified, getLastModifiedString, getSourceFile, isDeleted, prtln, prtlnErr, setDebug
 
Methods inherited from class org.dlese.dpc.index.reader.DocReader
getDocument, getIndex, getQuery, getScore, setDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemDocReader

public ItemDocReader(Document doc,
                     float score,
                     ResultDocConfig conf)
Constructor that is used by ResultDoc at search time to create a new instance.

Parameters:
doc - The Lucene Document that is read.
score - The rank of the Document in a set of results.
conf - DESCRIPTION

ItemDocReader

public ItemDocReader(Document doc,
                     SimpleLuceneIndex index)
Constructor that may be used programatically to wrap a reader around a Lucene Document created by a ItemFileIndexingWriter.

Parameters:
doc - A Lucene Document created by a ItemFileIndexingWriter.
index - DESCRIPTION
Method Detail

getReaderType

public String getReaderType()
Gets the String 'ItemDocReader,' which is the key that describes this reader type. This may be used in (Struts) beans to determine which type of reader is available for a given search result and thus what data is available for display in the UI. The reader type determines which getter methods are available.

Overrides:
getReaderType in class XMLDocReader
Returns:
The String 'ItemDocReader'.

getTitle

public String getTitle()
Gets the title attribute of the ItemDocReader object

Returns:
The title value

getKeywords

public String[] getKeywords()
Gets the keywords as an array.

Returns:
The keywords

getKeywordsDisplay

public String getKeywordsDisplay()
Gets the keywords a comma separated list terminated with a period suitable for display to users. For example: ocean, sea, rain.

Returns:
The keywords displayed suitable for users.

getMultiTitle

public String getMultiTitle()
Gets the title attribute of the ItemDocReader object

Returns:
The title value

getDescription

public String getDescription()
Gets the description attribute of the ItemDocReader object

Returns:
The description value

getMultiDescription

public String getMultiDescription()
Gets the multiDescription attribute of the ItemDocReader object

Returns:
The multiDescription value

getMultiIds

public String getMultiIds()
Gets the multiIds attribute of the ItemDocReader object

Returns:
The multiIds value

getMultiGradeRanges

public String[] getMultiGradeRanges()
Gets the multiGradeRanges attribute of the ItemDocReader object

Returns:
The multiGradeRanges value

getPartOfDRC

public String getPartOfDRC()
Gets part of DRC status (true or false).

Returns:
The String "true" or "false".

getUrl

public String getUrl()
Gets the url attribute of the ItemDocReader object

Returns:
The url value

getCollectionsString

public String getCollectionsString()
Gets the collections associated with this record as a single String. Same as Same as XMLDocReader.getSetString().

Returns:
The collections.

getCollections

public String[] getCollections()
Gets the collections associated with this record as an array of Strings. Assumes the collection keys have been indexed with spaces between each collection. Same as XMLDocReader.getSets().

Overrides:
getCollections in class XMLDocReader
Returns:
The collection(s) associated with this record.

getAccessionStatus

public String getAccessionStatus()
Gets the AccessionStatus attribute of the XMLDocReader object

Returns:
The status value

getMultiAccessionStatus

public String getMultiAccessionStatus()
Gets the multiAccessionStatus attribute of the XMLDocReader object

Returns:
The status value

getGradeRanges

public String[] getGradeRanges()
Gets the gradeRanges attribute of the ItemDocReader object

Returns:
The gradeRanges value

getSubjects

public String[] getSubjects()
Gets the subjects attribute of the ItemDocReader object

Returns:
The subjects value

getContentStandards

public String[] getContentStandards()
Gets the contentStandards attribute of the ItemDocReader object

Returns:
The contentStandards value

getResourceTypes

public String[] getResourceTypes()
Gets the resourceTypes attribute of the ItemDocReader object

Returns:
The resourceTypes value

getMultiRecordStatus

public String getMultiRecordStatus()
Gets the multiRecordStatus attribute of the ItemDocReader object

Returns:
The multiRecordStatus value

isMultiRecord

public boolean isMultiRecord()
Gets the multiRecord attribute of the ItemDocReader object

Returns:
The multiRecord value

hasAnnotations

public boolean hasAnnotations()
DESCRIPTION

Returns:
DESCRIPTION

getAnnoTypes

public String[] getAnnoTypes()
Gets the anno types that are associated with this record.

Returns:
The anno types value.

getAnnoPathways

public String[] getAnnoPathways()
Gets the anno pathways that are associated with this record.

Returns:
The anno pathways value.

getAnnoStatus

public String[] getAnnoStatus()
Gets the annoStatus attribute of the ItemDocReader object

Returns:
The annoStatus value

getAnnoCollectionKeys

public String[] getAnnoCollectionKeys()
Gets the annoCollectionKeys attribute of the ItemDocReader object

Returns:
The annoCollectionKeys value

getAssociatedCollectionKeys

public ArrayList getAssociatedCollectionKeys()
Gets the collection keys for all enabled collections that are associated with this resource.

Returns:
The associatedCollectionKeys value

getAllAssociatedCollectionKeys

public String[] getAllAssociatedCollectionKeys()
Gets the collection keys for all collections that are associated with this resource including collections that are not enabled.

Returns:
The associatedCollectionKeys value

getAssociatedIds

public String[] getAssociatedIds()
Gets the IDs of records that refer to the same resource.

Returns:
The associated IDs value.

getErrorTypes

public String[] getErrorTypes()
Gets the errors types (codes) identified by the ID mapper for this records. Returns integers as strings.

Returns:
The ID mapper error types (codes).

getErrorStrings

public String[] getErrorStrings()
Gets the errors identified by the ID mapper for this records.

Returns:
The ID mapper errors.

getAllItemResultDocs

public ResultDoc[] getAllItemResultDocs()
Gets the ItemDocReaders for all records that refer to this resource. The first record is this item.

Returns:
All records that refer to this resource.

getAssociatedItemResultDocs

public ResultDoc[] getAssociatedItemResultDocs()
Gets the ItemDocReaders for all associated items for this item (refer to same resource).

Returns:
The associatedItemDocReaders value

getDisplayableAssociatedItemResultDocs

public ResultDoc[] getDisplayableAssociatedItemResultDocs()
Gets the ItemDocReaders for all associated items (refer to same resource) for this item that have an appropriate status for display in discovery.

Returns:
The displayableAssociatedItemDocReaders value

getMissingAssociatedItemIds

public ArrayList getMissingAssociatedItemIds()
Gets the missingAssociatedItemIds for associated items that are not in the index.

Returns:
The missingAssociatedItemIds value.

getAnnotationResultDocs

public ResultDoc[] getAnnotationResultDocs()
Gets the ResultDocs for all annotations that refer to this resource.

Returns:
The ResultDocs value

hasCompletedAnno

public boolean hasCompletedAnno()

getHasCompletedAnno

public String getHasCompletedAnno()

getNumCompletedAnnos

public String getNumCompletedAnnos()

getNumInProgressAnnos

public String getNumInProgressAnnos()

getNumTextAnnosInProgress

public String getNumTextAnnosInProgress()

getNumAudioAnnosInProgress

public String getNumAudioAnnosInProgress()

getNumGraphicalAnnosInProgress

public String getNumGraphicalAnnosInProgress()

hasCompletedAnnoOfType

public boolean hasCompletedAnnoOfType(String type)

getCompletedAnnosOfType

public ArrayList getCompletedAnnosOfType(String type)

getHasInProgressAnno

public String getHasInProgressAnno()

hasInProgressAnno

public boolean hasInProgressAnno()

hasInProgressAnnoOfStatus

public boolean hasInProgressAnnoOfStatus(String type)

getInProgressAnnosOfStatus

public ArrayList getInProgressAnnosOfStatus(String type)

getTextAnnosInProgress

public ArrayList getTextAnnosInProgress()

getAudioAnnosInProgress

public ArrayList getAudioAnnosInProgress()

getGraphicalAnnosInProgress

public ArrayList getGraphicalAnnosInProgress()

getCompletedAnnos

public ArrayList getCompletedAnnos()

getCompletedReviews

public ArrayList getCompletedReviews()

getCompletedTeachingTips

public ArrayList getCompletedTeachingTips()

getCompletedEditorSummaries

public ArrayList getCompletedEditorSummaries()

getCompletedChallengingSituations

public ArrayList getCompletedChallengingSituations()

getCompletedAverageScores

public ArrayList getCompletedAverageScores()

getCompletedAdvice

public ArrayList getCompletedAdvice()

getCompletedAnnotation

public ArrayList getCompletedAnnotation()

getCompletedBias

public ArrayList getCompletedBias()

getCompletedChange

public ArrayList getCompletedChange()

getCompletedComment

public ArrayList getCompletedComment()

getCompletedEducationalStandard

public ArrayList getCompletedEducationalStandard()

getCompletedExample

public ArrayList getCompletedExample()

getCompletedExplanation

public ArrayList getCompletedExplanation()

getCompletedQuestion

public ArrayList getCompletedQuestion()

getCompletedSeeAlso

public ArrayList getCompletedSeeAlso()

DLESE Tools
v1.2