Package org.dlese.dpc.index.reader
Class XMLDocReader
java.lang.Object
org.dlese.dpc.index.reader.DocReader
org.dlese.dpc.index.reader.FileIndexingServiceDocReader
org.dlese.dpc.index.reader.XMLDocReader
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DcsDataDocReader,DleseAnnoDocReader,DleseCollectionDocReader,ItemDocReader,NewsOppsDocReader
A bean meant for subclassing that contains methods to read search results from indexed XML records.
Subclasses of this bean provide specific accessor methods for XML data of their type. The data is read
from a Lucene
Document that was returned from a search and from XML on
file.
In general, one XMLDocReader may be created for each document type that is defined in package org.dlese.dpc.index.writer.
- Author:
- John Weatherley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classA collection of user interface labels derived from vocabulary field/value IDs. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MetadataVocabThe vocab managerprotected RecordDataServiceThe record data serviceprotected RepositoryManagerThe RepositoryManager -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the XMLDocReader objectXMLDocReader(org.apache.lucene.document.Document doc) Constructor that may be used programatically to wrap a reader around a LuceneDocumentcreated by aFileIndexingServiceWriter. -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets all the IDs associated with this resource, including this record's ID.String[]Gets the annotataion collection keys, for example {06, 08}, for all collections that annotate this item.Gets the annotation formats that are associated with this item.Gets the anno pathways that are associated with this record.String[]Gets a String array of all annotation star ratings for this item in numerical form from 1 to 5, or null if none.Gets the annotation statuses that are associated with this item.Gets the ResultDocs for all annotations that refer to this resource.String[]Gets the anno types that are associated with this record.Gets a Map of records that this item assignes a relationship to by ID, keyed by relationship type, for example 'isAnnotatedBy'.Gets a Map of record ResultDoc arrays that this item assignes a relationship to by URL, keyed by relationship type, for example 'isAnnotatedBy'.String[]getAssignedRelatedIdsOfType(String relationType) Gets the record IDs for the items that this record assignes the given relationship to.String[]getAssignedRelatedUrlsOfType(String relationType) Gets the URLs for the items that this record assignes the given relationship to.String[]Gets the types of relationships that were asigned by this item by related ID, for example 'isAnnotatedBy'.String[]Gets the types of relationships that were asigned by this item by related URL, for example 'isAnnotatedBy'.Gets a Map of record IDs and the corresponding relationships they are assigned.String[]Gets the IDs of records that refer to the same resource, not including this record's ID.Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'audio' annotations for this resource.Gets the XML formats that are available for this item including those that are available throughXMLConversionService.Gets a the average of all star ratings for this item as a String, or null if none.floatGets a the average of all star ratings for this item as a float, or -1 if none.booleanDetermine if XML for this item can be dissiminated in the requested format specified using thesetRequestedXmlFormat(String), as available throughXMLConversionService.Gets the primary collection associated with this item, for example 'dcc'.Gets the collection key associated with this record, for example 01.String[]Gets all collection keys associated with this record, for example {01,02}.Gets the collection UI label from the vocab manager for this record, for example 'DLESE Community Collection (DCC)', or the short title from the collection record if the vocab manager is not available.String[]Gets the collections associated with this record as an array of Strings, for example {dcc,comet}.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'advice' annotations for this resource.String[]Gets the annotataion collection keys, for example {06, 08}, for all collections that annotate this item with one or more status completed annotations.Gets a list ofDleseAnnoDocReaders containing each of the completed annotations, regardless of type, for this resource.Gets a list of all completed annotataions for this item of the given type.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'annotation' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'average scores' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'bias' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'challenging situation' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'change' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'comment' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'editors summary' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'educational standard' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'example' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'explanation' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'question' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'review' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'see also' annotations for this resource.Gets a list ofDleseAnnoDocReaders containing each of the completed type 'teaching tip' annotations for this resource.Gets the description for the item.Gets the path to the source file of the document used to create this index record.protected StringgetFieldId(String fieldString, String metadataFormat) Gets the field ID from the field name, for example 'gradeRange' will return 'gr'.Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'graphical' annotations for this resource.booleanDetermines whether this item assigns one or more relationships by ID or URL.Gets the hasCompletedAnno attribute of the ItemDocReader objectDetermines whether the item has an annotation in progress.booleanDetermines whether this item has one or more relations.getId()Gets the id for this record, for example 'DLESE-000-000-000-001'.Gets the id for this record as encoded for unique searching and inexing.Gets a List of all IDs for records that this item assignes relationships for by ID or URL.Gets the full text of the content that was indexed.getInProgressAnnosOfFormat(String format) Gets all in-progress annotations for this item that have the given format, which is one of 'text', 'audio', 'graphical', or 'video'.booleanDetermines whether my collection is 'disabled'.booleanDetermines whether my collection is 'enabled'.Gets the metadata previx (format) of the file associated with this reader, for example 'dlese_ims' or 'adn'.Gets the metadataVocab manager, or null if one is not availableGets the metadataVocabAudience attribute of the XMLDocReader objectGets the metadataVocabLanguage attribute of the XMLDocReader objectprotected org.apache.lucene.document.DocumentGets the multiDoc lucene Document for this item, or the single doc, if none available.Gets the collection doc for the collection in which this record is a part.Gets the ID of collection record in which this item belongs.Gets the nativeFormat of the file associated with this reader, for example 'dlese_ims' or 'adn'.Gets the content in NSDL Dublin Core XML format, or empty String if not available.Gets a the total number of star ratings for this item as a String.intGets a the total number of star ratings for this item as a int.Gets the numAudioAnnosInProgress attribute of the ItemDocReader objectGets the numCompletedAnnos attribute of the ItemDocReader objectGets the numGraphicalAnnosInProgress attribute of the ItemDocReader objectGets the numInProgressAnnos attribute of the ItemDocReader objectGets the numTextAnnosInProgress attribute of the ItemDocReader objectGets the number of video format annotations in progress for this item.Gets the oaiDatestamp in UTC format for the given record.Gets the content in OAI Dublin Core XML format, or empty String if not available.Gets a String representataion of the oai datestamp in readable format.Gets the OAI sets associated with this record as an ArrayList of Strings, for example 'dcc' or null.Gets the String 'XmlDocReader,' which is the key that describes this reader type.String[]getRelatedIdsOfType(String relationType) Gets the record IDs for the documents with the given relationship to this item, for example 'isAnnotatedBy'.Gets a Map of records that are related to this item, keyed by relationship type, for example 'isAnnotatedBy'.String[]Gets the types of relationships that were indexed for this item, for example 'isAnnotatedBy'.final StringSame asgetRequestedXmlFormat()except returns the non-localized XML if no format was specified.final StringGets XML in the format that was previously specified using thesetRequestedXmlFormat(String)method, or the localized native format if none was specified.getSet()Gets the primary set (collection) associated with this item, for example dcc.String[]getSets()Gets the sets (collections) associated with this record as an array of Strings, for example dcc, which is not the same as the OAI sets.Gets the collections associated with this record as a single String.Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'text' annotations for this resource.getTitle()Gets the title of the item.protected StringgetUiLabelFromVocabId(String fieldId, String valueId, String metadataFormat) Gets the UI label corresponding to the given vocab value IDs and field ID.protected StringgetUiLabelFromVocabName(String fieldName, String vocabName, String metadataFormat) Gets the UI label corresponding to the given vocab value name from the XML and field name.protected CollectiongetUiLabelsFromVocabIds(String fieldId, String[] valueIds, String metadataFormat) Gets the UI labels corresponding to the given vocab value IDs and field ID.getUrl()Gets the url for the item.Gets the validationReport for this document, or null if no validationReport was found.protected StringgetValueId(String fieldName, String vocabName, String metadataFormat) Gets the value ID from the field name and value name, for example 'key', 'dcc' will return '09'.Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'video' annotations for this resource.Gets a org.w3c.dom.Document for this record.Gets the Whats New date as a String.Gets the Whats New date as a Date.Gets the Whats New type, which is one of 'itemnew,' 'itemannocomplete,' 'itemannoinprogress,' 'annocomplete,' 'annoinprogress,' 'drcannocomplete,' 'drcannoinprogress,' 'collection'.final StringgetXml()Gets the full XML for this record in it's native format.final org.dom4j.DocumentGets a dom4j XML Document for this record.getXmlFormat(String format, boolean filter) Gets XML in the given format.final StringGets the native format in a localized form if available, otherwise returns the native format stripped of XML and DTD declarations.final StringGets the full XML for this record in it's native format, with no XML or DTD declaration.booleanDetermines whether this item has annotations.booleanDetermines whether this item has at least one completed annotation.booleanhasCompletedAnnoOfType(String type) Determines whether this item has a completed annotataion of the given type, for example 'Review', 'Comment', 'Educational standard', etc.booleanDetermines whether the item has an annotation in progress.booleanhasInProgressAnnoOfFormat(String format) Determines whether the item has an annotation in progress of the given format, which is one of 'text', 'audio', 'graphical', or 'video'.voidinit()Initialized a new XMLDocReader at search time.booleanisValid()Determines whether the XML for this record is valid.protected static voidOutput a line of text to standard out, with datestamp, if debug is set to true.protected static voidOutput a line of text to error out, with datestamp.voidsetMetadataVocabAudience(String audience) Sets the metadataVocabAudience attribute of the XMLDocReader objectvoidsetMetadataVocabLanguage(String language) Sets the metadataVocabLanguage attribute of the XMLDocReader objectvoidsetRequestedXmlFormat(String format) Sets the XML format that will be returned by thegetRequestedXmlFormat()method.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, setDebugMethods inherited from class org.dlese.dpc.index.reader.DocReader
doInit, getAttribute, getDocMap, getDocument, getIndex, getLazyDocMap, getQuery, getRepositoryManager, getScore, setDoc
-
Field Details
-
metadataVocab
The vocab manager -
recordDataService
The record data service -
repositoryManager
The RepositoryManager
-
-
Constructor Details
-
XMLDocReader
public XMLDocReader()Constructor for the XMLDocReader object -
XMLDocReader
public XMLDocReader(org.apache.lucene.document.Document doc) Constructor that may be used programatically to wrap a reader around a LuceneDocumentcreated by aFileIndexingServiceWriter.- Parameters:
doc- A LuceneDocumentcreated by aItemFileIndexingWriter.
-
-
Method Details
-
init
public void init()Initialized a new XMLDocReader at search time. -
getReaderType
Gets the String 'XmlDocReader,' 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.- Specified by:
getReaderTypein classDocReader- Returns:
- The String 'XmlDocReader'.
-
getIndexedContent
Gets the full text of the content that was indexed.- Returns:
- The indexedContent value.
-
getTitle
Gets the title of the item.- Returns:
- The title or empty if none
-
getDescription
Gets the description for the item.- Returns:
- The description or empty
-
getUrl
Gets the url for the item.- Returns:
- The url or empty
-
getId
Gets the id for this record, for example 'DLESE-000-000-000-001'.- Returns:
- The id value
-
getIdEncoded
Gets the id for this record as encoded for unique searching and inexing.- Returns:
- The id encoded
-
getMetadataPrefix
Gets the metadata previx (format) of the file associated with this reader, for example 'dlese_ims' or 'adn'.- Returns:
- The metadataPrefix value
-
getNativeFormat
Gets the nativeFormat of the file associated with this reader, for example 'dlese_ims' or 'adn'. Same asgetMetadataPrefix().- Returns:
- The nativeFormat.
-
getWhatsNewType
Gets the Whats New type, which is one of 'itemnew,' 'itemannocomplete,' 'itemannoinprogress,' 'annocomplete,' 'annoinprogress,' 'drcannocomplete,' 'drcannoinprogress,' 'collection'.- Returns:
- The What's New type or empty String.
-
getWhatsNewDate
Gets the Whats New date as a String. Note that for ADN records, the appropriate method to use when displaying this value to an end user isItemDocReader.getMultiWhatsNewDate().- Returns:
- The What's New date or empty String.
-
getWhatsNewDateDate
Gets the Whats New date as a Date. Note that for ADN records, the appropriate method to use when displaying this value to an end user isItemDocReader.getMultiWhatsNewDateDate().- Returns:
- The What's New date or null.
-
getSetString
Gets the collections associated with this record as a single String.- Returns:
- The collections.
-
getSets
Gets the sets (collections) associated with this record as an array of Strings, for example dcc, which is not the same as the OAI sets. Assumes the set key has not been encoded using the vocab manager. The first set in the array is the primary set. Additional sets, if present, represent secondary sets that have been associated with this record via the ID mapper service.- Returns:
- The set(s) associated with this record.
-
getOaiSets
Gets the OAI sets associated with this record as an ArrayList of Strings, for example 'dcc' or null.- Returns:
- A List of OAI set Strings, or null if none
-
getSet
Gets the primary set (collection) associated with this item, for example dcc. The first collection in the array is the primary collection. Additional collection, if present, represent secondary collections that have been associated with this record via the ID mapper service.- Returns:
- The primary collection associated with this record.
-
getCollection
Gets the primary collection associated with this item, for example 'dcc'. The first collection in the array is the primary collection. Additional collection, if present, represent secondary collections that have been associated with this record via the ID mapper service.- Returns:
- The primary collection associated with this record.
-
getCollections
Gets the collections associated with this record as an array of Strings, for example {dcc,comet}. Assumes the collection key has not been encoded using the vocab manager. The first collection in the array is the primary collection. Additional collection, if present, represent secondary collections that have been associated with this record via the ID mapper service.- Returns:
- The collection(s) associated with this record.
-
getCollectionKey
Gets the collection key associated with this record, for example 01. Assumes the set key has been encoded using the vocab manager and that there is only one collection associated with this item.- Returns:
- The collection for which this item belogs.
-
getCollectionKeys
Gets all collection keys associated with this record, for example {01,02}. Assumes the set key has been encoded using the vocab manager and that there are more than one collections associated with this item.- Returns:
- The collections for which this item belogs.
-
getCollectionLabel
Gets the collection UI label from the vocab manager for this record, for example 'DLESE Community Collection (DCC)', or the short title from the collection record if the vocab manager is not available. To specify the vocab interface to use, first call, otherwise the default will be used, which is 'dds.descr.en-us'.invalid reference
#setVocabInterface(String)An example application using JSTL might look like:
<%-- The following line is optional --%> <c:set property="vocabInterface" target="${docReader}" value="dds.descr.en-us"/> ${docReader.collectionLabel}- Returns:
- The collection label for this record
-
getMyCollectionDoc
Gets the collection doc for the collection in which this record is a part.- Returns:
- The myCollectionDoc value, or null if none available.
-
getIsMyCollectionEnabled
public boolean getIsMyCollectionEnabled()Determines whether my collection is 'enabled'.- Returns:
- True if my collection is configured and is enabled, false if not
-
getIsMyCollectionDisabled
public boolean getIsMyCollectionDisabled()Determines whether my collection is 'disabled'.- Returns:
- True if my collection is configured and is disabled, false if not
-
getMyCollectionsRecordId
Gets the ID of collection record in which this item belongs.- Returns:
- The ID of this item's collection record, or null if not available.
-
getXml
Gets the full XML for this record in it's native format. Characters in the String returned are encoded as UTF-8.- Returns:
- The XML, or empty string if unable to process.
-
getXmlDoc
public final org.dom4j.Document getXmlDoc()Gets a dom4j XML Document for this record. This method is optimized to create only one DOM when accessed multiple times for the same XMLDocReader.- Returns:
- A dom4j XML Document, or null if unable to read
-
getW3CXmlDoc
Gets a org.w3c.dom.Document for this record. This method is optimized to create only one DOM when accessed multiple times for the same XMLDocReader.- Returns:
- A org.w3c.dom.Document, or null if unable to read.
-
getXmlStripped
Gets the full XML for this record in it's native format, with no XML or DTD declaration. Characters in the returned String are encoded as UTF-8.- Returns:
- The XML, or empty string if unable to process.
-
getXmlLocalized
Gets the native format in a localized form if available, otherwise returns the native format stripped of XML and DTD declarations. Localized XML contains no namespace declarations, making XPath sytax much simpler to work with since there is no need to use the local-name() function. Characters in the String retured are encoded at UTF-8.- Returns:
- The localized XML, or the native format stripped of XML and DTD declarations.
-
getXmlFormat
Gets XML in the given format. The resulting String contains XML in the given format, or an empty String if unable to dissiminate. Uses anXMLConversionServiceto perform the transformation from the native format to the requested format. Iffilteris set to true then the output will have the XML declaration stripped out and the DTD declaration will be commented out, in the case of DLESE IMS. Usefilter=trueto get XML suitable for insertion into an OAI container. Usefilter=trueto get the full XML including XML and DTD declaration, if present. Characters in the String returned are encoded as UTF-8.- Parameters:
format- The format desired.filter- Indicates whether to filter out the XML and DTD declaration.- Returns:
- XML for the given format, or an empty String if unable to process.
-
getRequestedXmlFormat
Gets XML in the format that was previously specified using thesetRequestedXmlFormat(String)method, or the localized native format if none was specified. The resulting String contains XML in the requested format, or an empty String if unable to process. Uses anXMLConversionServiceto perform the transformation from the native format to the requested format. XML and DTD declarations do not appear the output.- Returns:
- XML for the requested format, or an empty String if unable to process.
- See Also:
-
getRequestedXml
Same asgetRequestedXmlFormat()except returns the non-localized XML if no format was specified. XML and DTD declarations do not appear the output.- Returns:
- XML for the requested format, or an empty String if unable to process.
- See Also:
-
setRequestedXmlFormat
Sets the XML format that will be returned by thegetRequestedXmlFormat()method.- Parameters:
format- The new requestedXmlFormat value- See Also:
-
getAvailableFormats
Gets the XML formats that are available for this item including those that are available throughXMLConversionService.- Returns:
- The availableFormats, for example adn, oai_dc
-
getCanDissiminateFormat
public boolean getCanDissiminateFormat()Determine if XML for this item can be dissiminated in the requested format specified using thesetRequestedXmlFormat(String), as available throughXMLConversionService.- Returns:
- True if the requested XML format can be dissiminated
- See Also:
-
getOaiDublinCoreXml
Gets the content in OAI Dublin Core XML format, or empty String if not available. The output contains no XML and DTD declaration.- Returns:
- The oaiDublinCoreXml or empty String
-
getNsdlDublinCoreXml
Gets the content in NSDL Dublin Core XML format, or empty String if not available. The output contains no XML and DTD declaration.- Returns:
- The nsdlDublinCoreXml or empty String
-
getOaiDatestamp
Gets the oaiDatestamp in UTC format for the given record.- Returns:
- The oaiDatestamp value.
-
getOaiLastModifiedString
Gets a String representataion of the oai datestamp in readable format.- Returns:
- The File modification time.
-
getValidationReport
Gets the validationReport for this document, or null if no validationReport was found.- Returns:
- The validationReport value.
- See Also:
-
getDocsource
Gets the path to the source file of the document used to create this index record.- Overrides:
getDocsourcein classFileIndexingServiceDocReader- Returns:
- The document source file path
-
isValid
public boolean isValid()Determines whether the XML for this record is valid. To search for valididity, use field valid:[true|false] (unstored). If the XML was not valid there will be a validation report available.- Returns:
- True if valid, else false.
- See Also:
-
getFieldId
Gets the field ID from the field name, for example 'gradeRange' will return 'gr'.- Parameters:
fieldString- A vocab field, for example 'gradeRange'metadataFormat- The metadata format, for example 'adn'- Returns:
- The field ID, for example 'gr', or the original field name if a translation is not available
-
getValueId
Gets the value ID from the field name and value name, for example 'key', 'dcc' will return '09'.- Parameters:
fieldName- The vocab field ID, for example 'key' or 'gradeRange'.vocabName- The vocab value name, for example 'dcc' or 'DLESE:High school'.metadataFormat- The metadata format, for example 'adn'- Returns:
- The value ID, for example '09' or '02', or the original value name if a translation is not available
-
getMetadataVocab
Gets the metadataVocab manager, or null if one is not available- Returns:
- The metadataVocab manager
-
getMetadataVocabLanguage
Gets the metadataVocabLanguage attribute of the XMLDocReader object- Returns:
- The metadataVocabLanguage value
-
setMetadataVocabLanguage
Sets the metadataVocabLanguage attribute of the XMLDocReader object- Parameters:
language- The new metadataVocabLanguage value
-
getMetadataVocabAudience
Gets the metadataVocabAudience attribute of the XMLDocReader object- Returns:
- The metadataVocabAudience value
-
setMetadataVocabAudience
Sets the metadataVocabAudience attribute of the XMLDocReader object- Parameters:
audience- The new metadataVocabAudience value
-
getUiLabelFromVocabId
Gets the UI label corresponding to the given vocab value IDs and field ID. To specify the vocab interface to use, first call, otherwise the default will be used, which is 'dds.descr.en-us'. Note that if the vocab manager can not translate the given IDs then a comment string <!-- MUI... will be returned.invalid reference
#setVocabInterface(String)- Parameters:
fieldId- The vocab field ID, for example 'gr'.valueId- The vocab value IDs, for example '07'.metadataFormat- The metadata format, for example 'adn'- Returns:
- The UI lables for the given IDs, for example 'Primary (K-2)'
-
getUiLabelFromVocabName
Gets the UI label corresponding to the given vocab value name from the XML and field name. To specify the vocab interface to use, first call, otherwise the default will be used, which is 'dds.descr.en-us'. Note that if the vocab manager can not translate the given name then a comment string <!-- MUI... will be returned.invalid reference
#setVocabInterface(String)- Parameters:
fieldName- The vocab field ID, for example 'key' or 'gradeRange'.vocabName- The vocab value name, for example 'dcc' or 'DLESE:High school'.metadataFormat- The metadata format, for example 'adn'- Returns:
- The UI lables for the given IDs, for example 'DLESE Community Collection (DCC)' or 'High (9-12)'.
-
getUiLabelsFromVocabIds
protected Collection getUiLabelsFromVocabIds(String fieldId, String[] valueIds, String metadataFormat) Gets the UI labels corresponding to the given vocab value IDs and field ID. To specify the vocab interface to use, first call, otherwise the default will be used, which is 'dds.descr.en-us'. Note that if the vocab manager can not translate the given IDs then the valueIds will be returned unchanged.invalid reference
#setVocabInterface(String)- Parameters:
fieldId- The vocab field ID, for example 'gr'.valueIds- The vocab value IDs, for example '07', '04', '05'.metadataFormat- The metadata format, for example 'adn'- Returns:
- The UI lables for the given IDs, for example 'Primary (K-2)', 'Intermediate (3-5)', 'Middle (6-8)'
-
getMultiDoc
protected org.apache.lucene.document.Document getMultiDoc()Gets the multiDoc lucene Document for this item, or the single doc, if none available. A multiDoc is a Document that holds data from multiple XML records that catalog/reference the same resource. This method is overridden by the sub classes that support it.- Returns:
- The multiDoc value
-
getHasAssignedRelations
public boolean getHasAssignedRelations()Determines whether this item assigns one or more relationships by ID or URL.- Returns:
- True if asigned relations are present, false otherwise.
-
getAssignedRelationshipByIdTypes
Gets the types of relationships that were asigned by this item by related ID, for example 'isAnnotatedBy'.- Returns:
- The types of assigned relationships, or empty array if none
-
getAssignedRelationshipByUrlTypes
Gets the types of relationships that were asigned by this item by related URL, for example 'isAnnotatedBy'.- Returns:
- The types of assigned relationships, or empty array if none
-
getAssignedRelatedIdsOfType
Gets the record IDs for the items that this record assignes the given relationship to.- Parameters:
relationType- The type of relationship assigned, for example 'isAnnotatedBy'- Returns:
- The IDs of the related records
-
getAssignedRelatedUrlsOfType
Gets the URLs for the items that this record assignes the given relationship to.- Parameters:
relationType- The type of relationship assigned, for example 'isAnnotatedBy'- Returns:
- The URLs of the related items
-
getAssignedByIdRelatedRecordsMap
Gets a Map of records that this item assignes a relationship to by ID, keyed by relationship type, for example 'isAnnotatedBy'.- Returns:
- A Map of record ResultDoc arrays keyed by relationship type
-
getAssignedByUrlRelatedRecordsMap
Gets a Map of record ResultDoc arrays that this item assignes a relationship to by URL, keyed by relationship type, for example 'isAnnotatedBy'.- Returns:
- A Map of record ResultDoc arrays keyed by relationship type
-
getAssignedRelationshipsForItemsMap
Gets a Map of record IDs and the corresponding relationships they are assigned. The key is the record ID, the value is a list of relationships assigned for that ID (assigned by ID or URL).- Returns:
- A Map of type
-
getIdsOfRecordsWithAssignedRelationships
Gets a List of all IDs for records that this item assignes relationships for by ID or URL.- Returns:
- A List of ID Strings.
-
getHasRelations
public boolean getHasRelations()Determines whether this item has one or more relations.- Returns:
- True if relations are present, false otherwise.
-
getRelationshipTypes
Gets the types of relationships that were indexed for this item, for example 'isAnnotatedBy'.- Returns:
- The types of relationships, or empty array if none
-
getRelatedIdsOfType
Gets the record IDs for the documents with the given relationship to this item, for example 'isAnnotatedBy'.- Parameters:
relationType- The type of relationship, for example 'isAnnotatedBy'- Returns:
- The IDs of the related records
-
getRelatedRecordsMap
Gets a Map of records that are related to this item, keyed by relationship type, for example 'isAnnotatedBy'.- Returns:
- A Map of record ResultDoc arrays keyed by relationship type
-
hasAnnotations
public boolean hasAnnotations()Determines whether this item has annotations.- Returns:
- True if annotations are present, false otherwise.
-
getAllIds
Gets all the IDs associated with this resource, including this record's ID.- Returns:
- The allIds value
-
getAssociatedIds
Gets the IDs of records that refer to the same resource, not including this record's ID.- Returns:
- The associated IDs value.
-
getAnnotationResultDocs
Gets the ResultDocs for all annotations that refer to this resource.- Returns:
- The ResultDocs value
-
hasCompletedAnno
public boolean hasCompletedAnno()Determines whether this item has at least one completed annotation.- Returns:
- True if this item has one or more completed annotation, false otherwise.
-
getHasCompletedAnno
Gets the hasCompletedAnno attribute of the ItemDocReader object- Returns:
- The hasCompletedAnno value
-
getNumCompletedAnnos
Gets the numCompletedAnnos attribute of the ItemDocReader object- Returns:
- The numCompletedAnnos value
-
getNumInProgressAnnos
Gets the numInProgressAnnos attribute of the ItemDocReader object- Returns:
- The numInProgressAnnos value
-
getNumTextAnnosInProgress
Gets the numTextAnnosInProgress attribute of the ItemDocReader object- Returns:
- The numTextAnnosInProgress value
-
getNumAudioAnnosInProgress
Gets the numAudioAnnosInProgress attribute of the ItemDocReader object- Returns:
- The numAudioAnnosInProgress value
-
getNumGraphicalAnnosInProgress
Gets the numGraphicalAnnosInProgress attribute of the ItemDocReader object- Returns:
- The numGraphicalAnnosInProgress value
-
getNumVideoAnnosInProgress
Gets the number of video format annotations in progress for this item.- Returns:
- The number of video format annotations
-
hasCompletedAnnoOfType
Determines whether this item has a completed annotataion of the given type, for example 'Review', 'Comment', 'Educational standard', etc.- Parameters:
type- The annotation type- Returns:
- True if this item has a completed annotataion of the given type.
-
getCompletedAnnosOfType
Gets a list of all completed annotataions for this item of the given type.- Parameters:
type- The annotation type, for example 'Review', 'Teaching tip', etc.- Returns:
- A list of
DleseAnnoDocReaders for all completed annotataions for this item of the given type, or an empty list.
-
getHasInProgressAnno
Determines whether the item has an annotation in progress.- Returns:
- 'true' if the item has an annotation in progress, otherwise 'false'.
-
hasInProgressAnno
public boolean hasInProgressAnno()Determines whether the item has an annotation in progress.- Returns:
- True if the item has an annotation in progress, otherwise false.
-
hasInProgressAnnoOfFormat
Determines whether the item has an annotation in progress of the given format, which is one of 'text', 'audio', 'graphical', or 'video'.- Parameters:
format- Annotation format- Returns:
- True if the item has an annotation in progress of the given format, otherwise false.
-
getInProgressAnnosOfFormat
Gets all in-progress annotations for this item that have the given format, which is one of 'text', 'audio', 'graphical', or 'video'.- Parameters:
format- Annotation format- Returns:
- A list of
DleseAnnoDocReaders
-
getTextAnnosInProgress
Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'text' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getAudioAnnosInProgress
Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'audio' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders
-
getGraphicalAnnosInProgress
Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'graphical' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getVideoAnnosInProgress
Gets a list ofDleseAnnoDocReaders containing each of the in-progress type 'video' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedAnnos
Gets a list ofDleseAnnoDocReaders containing each of the completed annotations, regardless of type, for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedReviews
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'review' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedTeachingTips
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'teaching tip' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedEditorSummaries
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'editors summary' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedChallengingSituations
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'challenging situation' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedAverageScores
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'average scores' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedAdvice
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'advice' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedAnnotation
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'annotation' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedBias
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'bias' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedChange
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'change' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedComment
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'comment' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedEducationalStandard
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'educational standard' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedExample
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'example' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedExplanation
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'explanation' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedQuestion
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'question' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getCompletedSeeAlso
Gets a list ofDleseAnnoDocReaders containing each of the completed type 'see also' annotations for this resource.- Returns:
- A list of
DleseAnnoDocReaders or empty list
-
getAnnoCollectionKeys
Gets the annotataion collection keys, for example {06, 08}, for all collections that annotate this item.- Returns:
- The annoCollectionKeys value
-
getCompletedAnnoCollectionKeys
Gets the annotataion collection keys, for example {06, 08}, for all collections that annotate this item with one or more status completed annotations.- Returns:
- The completedAnnoCollectionKeys value
-
getAnnoTypes
Gets the anno types that are associated with this record.- Returns:
- The anno types value.
-
getAnnoPathways
Gets the anno pathways that are associated with this record.- Returns:
- The list of anno pathway Strings
-
getAnnoStatus
Gets the annotation statuses that are associated with this item.- Returns:
- A list of anno status Strings
-
getAnnoFormats
Gets the annotation formats that are associated with this item.- Returns:
- A list of anno formats Strings
-
getAnnoRatings
Gets a String array of all annotation star ratings for this item in numerical form from 1 to 5, or null if none. Each rating represents a single annotation's star rating for this item.- Returns:
- An String array of numbers 1, 2, 3, 4, 5, or null
-
getAverageAnnoRating
Gets a the average of all star ratings for this item as a String, or null if none. The rating is shown to three decimal points, for example '4.333' or '3.000'.- Returns:
- The average star rating to three decimal points as a String
-
getAverageAnnoRatingFloat
public float getAverageAnnoRatingFloat()Gets a the average of all star ratings for this item as a float, or -1 if none.- Returns:
- The average star rating or -1 if none
-
getNumAnnoRatings
Gets a the total number of star ratings for this item as a String. The number is displayed to five digits, for example '00002' or '00000'.- Returns:
- The number of star ratings as a String
-
getNumAnnoRatingsInt
public int getNumAnnoRatingsInt()Gets a the total number of star ratings for this item as a int.- Returns:
- The number of star ratings for this item
-
prtlnErr
Output a line of text to error out, with datestamp.- Parameters:
s- The text that will be output to error out.
-
prtln
Output a line of text to standard out, with datestamp, if debug is set to true.- Parameters:
s- The String that will be output.
-