DLESE Tools
v1.6.0

org.dlese.dpc.index.reader
Class DleseAnnoDocReader

java.lang.Object
  extended by org.dlese.dpc.index.reader.DocReader
      extended by org.dlese.dpc.index.reader.FileIndexingServiceDocReader
          extended by org.dlese.dpc.index.reader.XMLDocReader
              extended by org.dlese.dpc.index.reader.DleseAnnoDocReader
All Implemented Interfaces:
Serializable

public class DleseAnnoDocReader
extends XMLDocReader

A bean for accessing the data stored in a Lucene Document that was indexed from a DLESE annotation-level metadata record. The index writer that is responsible for creating this type of Lucene Document is a DleseAnnoFileIndexingServiceWriter.

Author:
John Weatherley
See Also:
ResultDoc, DleseAnnoFileIndexingServiceWriter, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dlese.dpc.index.reader.XMLDocReader
XMLDocReader.VocabUiLabelsCollection
 
Field Summary
 
Fields inherited from class org.dlese.dpc.index.reader.XMLDocReader
metadataVocab, recordDataService, repositoryManager
 
Fields inherited from class org.dlese.dpc.index.reader.DocReader
conf, doc, resultDoc, score
 
Constructor Summary
DleseAnnoDocReader()
          Constructor for the DleseAnnoDocReader object
DleseAnnoDocReader(org.apache.lucene.document.Document doc)
          Constructor that may be used programatically to wrap a reader around a Lucene Document that was created by a FileIndexingServiceWriter.
 
Method Summary
 ResultDoc getAnnotatedItemResultDoc()
          Gets the ResultDoc of the item this annotates, or null if not available.
 String getDate()
          Deprecated. As of annotation framework v1.0, this field no longer exists.
 Date getDateDate()
          Deprecated. As of annotation framework v1.0, this field no longer exists.
 String getDescription()
          Gets the content of the annotation itself, or empty if none.
 String getFormat()
          Gets the format of the annotation, which is one of 'audio', 'graphical', 'text', or 'video'.
 boolean getIsCompleted()
          Determines whether the annotation status is 'completed'.
 boolean getIsInProgress()
          Determines whether the annotation status is 'in progress'.
 String getIsPartOfDrc()
          True if the annotation that is part of the DRC, false otherwise.
 boolean getIsRetired()
          Determines whether the annotation status is 'retired'.
 String getItemId()
          Gets the ID of the item this annotates.
 String getPathway()
          Gets the annotation pathway, for example 'CRS (Community Review System)'.
 String getRating()
          Gets the star rating as a number from 1 to 5 or empty if none assigned.
 String getReaderType()
          Gets the String 'DleseAnnoDocReader,' which is the key that describes this reader type.
 String getServiceName()
          Gets the serviceName attribute of the DleseAnnoDocReader object
 String getStatus()
          Gets the status of the annotation, which is one of 'completed', 'in progress' or 'retired'.
 String getTitle()
          Gets the title of the annotation.
 String getType()
          Gets the type of annotation, for example 'Review', 'Comment', 'Educational standard', etc.
 String getUrl()
          Gets the url containing the content of the annotation, or empty if none.
 boolean isPartOfDrc()
          True if the annotation that is part of the DRC, false otherwise.
 
Methods inherited from class org.dlese.dpc.index.reader.XMLDocReader
getAllIds, getAnnoCollectionKeys, getAnnoFormats, getAnnoPathways, getAnnoRatings, getAnnoStatus, getAnnotationResultDocs, getAnnoTypes, getAssignedByIdRelatedRecordsMap, getAssignedByUrlRelatedRecordsMap, getAssignedRelatedIdsOfType, getAssignedRelatedUrlsOfType, getAssignedRelationshipByIdTypes, getAssignedRelationshipByUrlTypes, getAssignedRelationshipsForItemsMap, getAssociatedIds, getAudioAnnosInProgress, getAvailableFormats, getAverageAnnoRating, getAverageAnnoRatingFloat, getCanDissiminateFormat, getCollection, getCollectionKey, getCollectionKeys, getCollectionLabel, getCollections, getCompletedAdvice, getCompletedAnnoCollectionKeys, getCompletedAnnos, getCompletedAnnosOfType, getCompletedAnnotation, getCompletedAverageScores, getCompletedBias, getCompletedChallengingSituations, getCompletedChange, getCompletedComment, getCompletedEditorSummaries, getCompletedEducationalStandard, getCompletedExample, getCompletedExplanation, getCompletedQuestion, getCompletedReviews, getCompletedSeeAlso, getCompletedTeachingTips, getDocsource, getFieldId, getGraphicalAnnosInProgress, getHasAssignedRelations, getHasCompletedAnno, getHasInProgressAnno, getHasRelations, getId, getIdEncoded, getIdsOfRecordsWithAssignedRelationships, getIndexedContent, getInProgressAnnosOfFormat, getIsMyCollectionDisabled, getIsMyCollectionEnabled, getMetadataPrefix, getMetadataVocab, getMetadataVocabAudience, getMetadataVocabLanguage, getMultiDoc, getMyCollectionDoc, getMyCollectionsRecordId, getNativeFormat, getNsdlDublinCoreXml, getNumAnnoRatings, getNumAnnoRatingsInt, getNumAudioAnnosInProgress, getNumCompletedAnnos, getNumGraphicalAnnosInProgress, getNumInProgressAnnos, getNumTextAnnosInProgress, getNumVideoAnnosInProgress, getOaiDatestamp, getOaiDublinCoreXml, getOaiLastModifiedString, getOaiSets, getRelatedIdsOfType, getRelatedRecordsMap, getRelationshipTypes, getRequestedXml, getRequestedXmlFormat, getSet, getSets, getSetString, getTextAnnosInProgress, getUiLabelFromVocabId, getUiLabelFromVocabName, getUiLabelsFromVocabIds, getValidationReport, getValueId, getVideoAnnosInProgress, getW3CXmlDoc, getWhatsNewDate, getWhatsNewDateDate, getWhatsNewType, getXml, getXmlDoc, getXmlFormat, getXmlLocalized, getXmlStripped, hasAnnotations, hasCompletedAnno, hasCompletedAnnoOfType, hasInProgressAnno, hasInProgressAnnoOfFormat, init, isValid, prtln, prtlnErr, setMetadataVocabAudience, setMetadataVocabLanguage, setRequestedXmlFormat
 
Methods inherited from class org.dlese.dpc.index.reader.FileIndexingServiceDocReader
fileExists, getDateFileWasIndexed, getDateFileWasIndexedString, getDateStamp, getDeleted, getDocDir, getDocsourceEncoded, getDoctype, getFile, getFileExists, getFileName, getFullContent, getFullContentEncodedAs, getLastModified, getLastModifiedAsUTC, getLastModifiedString, isDeleted, setDebug
 
Methods inherited from class org.dlese.dpc.index.reader.DocReader
doInit, getAttribute, getDocMap, getDocument, getIndex, getLazyDocMap, getQuery, getRepositoryManager, getScore, setDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DleseAnnoDocReader

public DleseAnnoDocReader()
Constructor for the DleseAnnoDocReader object


DleseAnnoDocReader

public DleseAnnoDocReader(org.apache.lucene.document.Document doc)
Constructor that may be used programatically to wrap a reader around a Lucene Document that was created by a FileIndexingServiceWriter.

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

getReaderType

public String getReaderType()
Gets the String 'DleseAnnoDocReader,' 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 'DleseAnnoDocReader'.

getAnnotatedItemResultDoc

public ResultDoc getAnnotatedItemResultDoc()
Gets the ResultDoc of the item this annotates, or null if not available.

Returns:
The athe ResultDoc of the item this annotates.

getServiceName

public String getServiceName()
Gets the serviceName attribute of the DleseAnnoDocReader object

Returns:
The serviceName value

getItemId

public String getItemId()
Gets the ID of the item this annotates.

Returns:
The ID of the annotated item

getTitle

public String getTitle()
Gets the title of the annotation.

Overrides:
getTitle in class XMLDocReader
Returns:
The title or empty if none

getDescription

public String getDescription()
Gets the content of the annotation itself, or empty if none.

Overrides:
getDescription in class XMLDocReader
Returns:
The content or empty
See Also:
getUrl()

getUrl

public String getUrl()
Gets the url containing the content of the annotation, or empty if none.

Overrides:
getUrl in class XMLDocReader
Returns:
The url or empty
See Also:
getDescription()

getPathway

public String getPathway()
Gets the annotation pathway, for example 'CRS (Community Review System)'.

Returns:
The pathway value or empty

getRating

public String getRating()
Gets the star rating as a number from 1 to 5 or empty if none assigned. Available since anno framwork v1.0.

Returns:
The start rating or empty String if none

getStatus

public String getStatus()
Gets the status of the annotation, which is one of 'completed', 'in progress' or 'retired'. Note that status used to also contain the format string but there is now a separate field for format - see getFormat(). The status String here is the same regardless of whether the underlying record is in framework version 1.0 or 0.1.

Returns:
The status value

getFormat

public String getFormat()
Gets the format of the annotation, which is one of 'audio', 'graphical', 'text', or 'video'. The format String here is the same regardless of whether the underlying record is in framework version 1.0 or 0.1. Note that format used to be part of the status in v0.1 - see getStatus().

Returns:
The format value

getType

public String getType()
Gets the type of annotation, for example 'Review', 'Comment', 'Educational standard', etc.

Returns:
The type value

getDate

public String getDate()
Deprecated. As of annotation framework v1.0, this field no longer exists.

Gets the annotation date as a String, available only for annos in verion 0.1.

Returns:
The date String, or empty if none available.

getDateDate

public Date getDateDate()
Deprecated. As of annotation framework v1.0, this field no longer exists.

Gets the annotation date as a Date object, available only for annos in verion 0.1.

Returns:
The Date object or null if not available

getIsPartOfDrc

public String getIsPartOfDrc()
True if the annotation that is part of the DRC, false otherwise.

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

isPartOfDrc

public boolean isPartOfDrc()
True if the annotation that is part of the DRC, false otherwise.

Returns:
The partOfDrc value

getIsCompleted

public boolean getIsCompleted()
Determines whether the annotation status is 'completed'.

Returns:
True if status is 'completed'

getIsInProgress

public boolean getIsInProgress()
Determines whether the annotation status is 'in progress'.

Returns:
True if status is 'in progress'

getIsRetired

public boolean getIsRetired()
Determines whether the annotation status is 'retired'.

Returns:
True if status is 'retired'

DLESE Tools
v1.6.0