Class ADNItemDocReader
java.lang.Object
org.dlese.dpc.serviceclients.remotesearch.reader.ADNItemDocReader
- Direct Known Subclasses:
ADNFragDocReader
Description of the Class
- Author:
- ostwald
$Id: ADNItemDocReader.java,v 1.9 2010/07/14 00:19:27 jweather Exp $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ResultDocListDescription of the Fieldprotected booleanDescription of the Fieldprotected booleanDescription of the Fieldprotected ResultDocListDescription of the Fieldprotected ResultDocListDescription of the Fieldprotected booleanDescription of the Fieldprotected StringDescription of the Fieldprotected ArrayListDescription of the Fieldprotected HashMapDescription of the Fieldprotected static booleanDescription of the Fieldprotected StringDescription of the Fieldprotected ResultDocListDescription of the Fieldprotected booleanDescription of the Fieldprotected org.dom4j.DocumentDescription of the Fieldprotected String[]Description of the Fieldprotected ArrayListDescription of the Fieldprotected StringDescription of the Fieldprotected HashMapDescription of the Fieldprotected ArrayListDescription of the Fieldprotected org.dom4j.DocumentDescription of the Fieldprotected StringDescription of the Fieldprotected intDescription of the Fieldprotected intDescription of the Fieldprotected intDescription of the Fieldprotected intDescription of the Fieldprotected intDescription of the Fieldprotected StringDescription of the Fieldprotected MetadataVocabDescription of the Field -
Constructor Summary
ConstructorsConstructorDescriptionADNItemDocReader(String id, String collection, org.dom4j.Document itemRecordDoc, MetadataVocab vocab) ADNItemDocReader constructor requiring an itemRecordDocADNItemDocReader(String id, GetRecordResponse response) Constructor for the ADNItemDocReader objectADNItemDocReader(String id, GetRecordResponse response, MetadataVocab vocab) parse a GetRecordResponse (a response from a GetRecord request), to create an ADNItemDocReader. -
Method Summary
Modifier and TypeMethodDescriptionGets the ResultDocs for all annotations that refer to this resource.Gets the collection keys for all enabled collections that are associated with this resource.String[]Gets the IDs of records that refer to the same resource.Gets the audioAnnosInProgress attribute of the ItemDocReader objectGets the collection attribute of the ADNItemDocReader objectGets the collection key associated with this record, for example 01.String[]Gets the collection keys associated with this record, for example {01,02}.Gets the completedAdvice attribute of the ItemDocReader objectGets the completedAnnos attribute of the ItemDocReader objectGets a list of all completed annotataions for this item of the given type.Gets the completedAnnotation attribute of the ItemDocReader objectGets the completedAverageScores attribute of the ItemDocReader objectGets the completedBias attribute of the ItemDocReader objectGets the completedChallengingSituations attribute of the ItemDocReader objectGets the completedChange attribute of the ItemDocReader objectGets the completedComment attribute of the ItemDocReader objectGets the completedEditorSummaries attribute of the ItemDocReader objectGets the completedEducationalStandard attribute of the ItemDocReader objectGets the completedExample attribute of the ItemDocReader objectGets the completedExplanation attribute of the ItemDocReader objectGets the completedQuestion attribute of the ItemDocReader objectGets the completedReviews attribute of the ItemDocReader objectGets the completedSeeAlso attribute of the ItemDocReader objectGets the completedTeachingTips attribute of the ItemDocReader objectString[]Gets the contentStandards attribute of the ADNItemDocReader objectGets the description attribute of the ADNItemDocReader objectprotected org.dom4j.ElementgetElement(String xpath) Gets a single Element satisfying given XPath.protected ListgetElements(String xpath) get all Elements satisfying the given xpathprotected StringgetElementText(String xpath) return the Text of a Element satisfying the given XPath.protected String[]getFieldContent(String[] values, String useVocabMapping) Gets the vocab encoded keys for the given values as a String Array.protected StringgetFieldContent(String value, String useVocabMapping) Gets the encoded vocab key for the given content.String[]Gets the gradeRanges for this item (as vocab keys)Gets the graphicalAnnosInProgress attribute of the ItemDocReader objectGets the hasCompletedAnno attribute of the ItemDocReader objectDetermines whether the item has an annotation in progress.protected booleanReturns true if the item has one or more related resource, false otherwise.getId()gets the ID of the itemgetInProgressAnnosOfStatus(String status) Gets all in-progress annotations for this item that have the given status.Gets the metadataPrefix attribute of the ADNItemDocReader objectprotected String[]getMultiElementTexts(String xpath) get the values of all elements matching an XPathString[]Gets the multiGradeRanges attribute of the ADNItemDocReader objectString[]Gets the multiResourceTypes attribute of the ADNItemDocReader objectString[]Gets the multiSubjects attribute of the ADNItemDocReader objectGets 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 String 'ItemDocReader,' which is the key that describes this reader type.String[]Gets the resourceTypes attribute of the ADNItemDocReader objectString[]Gets the subjects attribute of the ADNItemDocReader objectGets the textAnnosInProgress attribute of the ItemDocReader objectgetTitle()Gets the title attribute of the ADNItemDocReader objectgetUrl()Gets the url attribute of theGets the URL for this resource, truncated if it is very longgetValueOf(String xpath) Gets the valueOf attribute of the ADNItemDocReader objectbooleanDetermines whether this item has at least one completed annotation.booleanhasCompletedAnnoOfType(String type) Determines whether this item has a completed annotataion of the given type.booleanhasDoc()Description of the MethodbooleanDetermines whether the item has an annotation in progress.booleanhasInProgressAnnoOfStatus(String status) Determines whether the item has an annotation in progress with the given status.protected voidDescription of the Methodstatic voidDescription of the Methodstatic voidprtlnArray(String[] s) Description of the MethodvoidSets the readerType attribute of the ADNItemDocReader object
-
Field Details
-
vocab
Description of the Field -
debug
protected static boolean debugDescription of the Field -
id
Description of the Field -
collection
Description of the Field -
readerType
Description of the Field -
doc
protected org.dom4j.Document docDescription of the Field -
EMPTY_ARRAY
Description of the Field -
DEFAULT
Description of the Field -
EMPTY_LIST
Description of the Field -
associatedItemResultDocs
Description of the Field -
displayableAssociatedItemResultDocs
Description of the Field -
allItemResultDocs
Description of the Field -
annotationResultDocs
Description of the Field -
associatedItemsInitialized
protected boolean associatedItemsInitializedDescription of the Field -
displayableAssociatedItemsInitialized
protected boolean displayableAssociatedItemsInitializedDescription of the Field -
allItemsInitialized
protected boolean allItemsInitializedDescription of the Field -
annotationDocReadersInitialized
protected boolean annotationDocReadersInitializedDescription of the Field -
missingAssociatedItemIds
Description of the Field -
multiRecordStatus
Description of the Field -
multiDoc
protected org.dom4j.Document multiDocDescription of the Field -
completedAnnosByType
Description of the Field -
completedAnnos
Description of the Field -
inProgressAnnosByStatus
Description of the Field -
numCompletedAnnos
protected int numCompletedAnnosDescription of the Field -
numInProgressAnnos
protected int numInProgressAnnosDescription of the Field -
numAudioInProgress
protected int numAudioInProgressDescription of the Field -
numGraphicalInProgress
protected int numGraphicalInProgressDescription of the Field -
numTextInProgress
protected int numTextInProgressDescription of the Field
-
-
Constructor Details
-
ADNItemDocReader
public ADNItemDocReader(String id, String collection, org.dom4j.Document itemRecordDoc, MetadataVocab vocab) ADNItemDocReader constructor requiring an itemRecordDoc- Parameters:
id- Description of the Parametercollection- Description of the ParameteritemRecordDoc- Description of the Parametervocab- Description of the Parameter
-
ADNItemDocReader
Constructor for the ADNItemDocReader object- Parameters:
id- Description of the Parameterresponse- Description of the Parameter
-
ADNItemDocReader
parse a GetRecordResponse (a response from a GetRecord request), to create an ADNItemDocReader. This constructor called from RemoteResultDoc and SchemEditAction- Parameters:
id- Description of the Parameterresponse- Description of the Parametervocab- Description of the Parameter
-
-
Method Details
-
hasDoc
public boolean hasDoc()Description of the Method- Returns:
- Description of the Return Value
-
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.- Returns:
- The String 'ItemDocReader'.
-
setReaderType
Sets the readerType attribute of the ADNItemDocReader object- Parameters:
s- The new readerType value
-
getMetadataPrefix
Gets the metadataPrefix attribute of the ADNItemDocReader object- Returns:
- The metadataPrefix value
-
getId
gets the ID of the item- Returns:
- the id value
-
getUrl
Gets the url attribute of the- Returns:
- The url value
-
getUrlTruncated
Gets the URL for this resource, truncated if it is very long- Returns:
- The url value
-
getTitle
Gets the title attribute of the ADNItemDocReader object- Returns:
- The title value
-
getDescription
Gets the description attribute of the ADNItemDocReader object- Returns:
- The description value
-
getCollection
Gets the collection attribute of the ADNItemDocReader object- Returns:
- The collection value
-
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 the 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 collection for which this item belogs.
-
getMirrorUrls
-
getAssociatedCollectionKeys
Gets the collection keys for all enabled collections that are associated with this resource. Associated annotations such as CRS and JESSE that are identified as collections are included. Disabled collections are not included.- Returns:
- The associatedCollectionKeys value
-
getGradeRanges
Gets the gradeRanges for this item (as vocab keys)- Returns:
- The gradeRanges value
-
getMultiGradeRanges
Gets the multiGradeRanges attribute of the ADNItemDocReader object- Returns:
- The multiGradeRanges value
-
getResourceTypes
Gets the resourceTypes attribute of the ADNItemDocReader object- Returns:
- The resourceTypes value
-
getMultiResourceTypes
Gets the multiResourceTypes attribute of the ADNItemDocReader object- Returns:
- The multiResourceTypes value
-
getSubjects
Gets the subjects attribute of the ADNItemDocReader object- Returns:
- The subjects value
-
getMultiSubjects
Gets the multiSubjects attribute of the ADNItemDocReader object- Returns:
- The multiSubjects value
-
getContentStandards
Gets the contentStandards attribute of the ADNItemDocReader object- Returns:
- The contentStandards value
-
getHasRelatedResource
protected boolean getHasRelatedResource()Returns true if the item has one or more related resource, false otherwise.- Returns:
- True if the item has one or more related resource, false otherwise.
-
getFieldContent
Gets the vocab encoded keys for the given values as a String Array. Keys are found by VocabUtils.getFieldContent and converted from '+' delimited string into an Array.- Parameters:
values- The valuse to encode.useVocabMapping- The mapping to use, for example "contentStandards".- Returns:
- The encoded vocab keys.
-
getFieldContent
Gets the encoded vocab key for the given content.- Parameters:
value- The value to encode.useVocabMapping- The vocab mapping to use, for example "contentStandard".- Returns:
- The encoded value.
-
getElements
get all Elements satisfying the given xpath- Parameters:
xpath- an XPath- Returns:
- a List of all elements satisfying given XPath, or null
-
getElement
Gets a single Element satisfying given XPath. If more than one Element is found, the first is returned (and a msg is printed)- Parameters:
xpath- an XPath- Returns:
- a dom4j Element
-
getElementText
return the Text of a Element satisfying the given XPath.- Parameters:
xpath- an XPath\- Returns:
- Text of Element or empty String if no Element is found
-
getMultiElementTexts
get the values of all elements matching an XPath- Parameters:
xpath- Description of the Parameter- Returns:
- Array of values
-
getValueOf
Gets the valueOf attribute of the ADNItemDocReader object- Parameters:
xpath- Description of the Parameter- Returns:
- The valueOf value
-
prtlnArray
Description of the Method- Parameters:
s- Description of the Parameter
-
prtln
Description of the Method- Parameters:
s- Description of the Parameter
-
getAnnotationResultDocs
Gets the ResultDocs for all annotations that refer to this resource.- Returns:
- The ResultDocs value
-
getAssociatedIds
Gets the IDs of records that refer to the same resource.- Returns:
- The associated IDs 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
-
hasCompletedAnnoOfType
Determines whether this item has a completed annotataion of the given type.- 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.- Returns:
- A list of 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.
-
hasInProgressAnnoOfStatus
Determines whether the item has an annotation in progress with the given status.- Parameters:
status- Annotation status.- Returns:
- True if the item has an annotation in progress of the given status, otherwise false.
-
getInProgressAnnosOfStatus
Gets all in-progress annotations for this item that have the given status.- Parameters:
status- Annotation status.- Returns:
- All annotations for this item that have the given status, or empty list.
-
initAnnosByType
protected void initAnnosByType()Description of the Method -
getTextAnnosInProgress
Gets the textAnnosInProgress attribute of the ItemDocReader object- Returns:
- The textAnnosInProgress value
-
getAudioAnnosInProgress
Gets the audioAnnosInProgress attribute of the ItemDocReader object- Returns:
- The audioAnnosInProgress value
-
getGraphicalAnnosInProgress
Gets the graphicalAnnosInProgress attribute of the ItemDocReader object- Returns:
- The graphicalAnnosInProgress value
-
getCompletedAnnos
Gets the completedAnnos attribute of the ItemDocReader object- Returns:
- The completedAnnos value
-
getCompletedReviews
Gets the completedReviews attribute of the ItemDocReader object- Returns:
- The completedReviews value
-
getCompletedTeachingTips
Gets the completedTeachingTips attribute of the ItemDocReader object- Returns:
- The completedTeachingTips value
-
getCompletedEditorSummaries
Gets the completedEditorSummaries attribute of the ItemDocReader object- Returns:
- The completedEditorSummaries value
-
getCompletedChallengingSituations
Gets the completedChallengingSituations attribute of the ItemDocReader object- Returns:
- The completedChallengingSituations value
-
getCompletedAverageScores
Gets the completedAverageScores attribute of the ItemDocReader object- Returns:
- The completedAverageScores value
-
getCompletedAdvice
Gets the completedAdvice attribute of the ItemDocReader object- Returns:
- The completedAdvice value
-
getCompletedAnnotation
Gets the completedAnnotation attribute of the ItemDocReader object- Returns:
- The completedAnnotation value
-
getCompletedBias
Gets the completedBias attribute of the ItemDocReader object- Returns:
- The completedBias value
-
getCompletedChange
Gets the completedChange attribute of the ItemDocReader object- Returns:
- The completedChange value
-
getCompletedComment
Gets the completedComment attribute of the ItemDocReader object- Returns:
- The completedComment value
-
getCompletedEducationalStandard
Gets the completedEducationalStandard attribute of the ItemDocReader object- Returns:
- The completedEducationalStandard value
-
getCompletedExample
Gets the completedExample attribute of the ItemDocReader object- Returns:
- The completedExample value
-
getCompletedExplanation
Gets the completedExplanation attribute of the ItemDocReader object- Returns:
- The completedExplanation value
-
getCompletedQuestion
Gets the completedQuestion attribute of the ItemDocReader object- Returns:
- The completedQuestion value
-
getCompletedSeeAlso
Gets the completedSeeAlso attribute of the ItemDocReader object- Returns:
- The completedSeeAlso value
-