DLESE Tools
v1.6.0

org.dlese.dpc.serviceclients.remotesearch.reader
Class ADNItemDocReader

java.lang.Object
  extended by org.dlese.dpc.serviceclients.remotesearch.reader.ADNItemDocReader
Direct Known Subclasses:
ADNFragDocReader

public class ADNItemDocReader
extends Object

Description of the Class

Author:
ostwald

$Id: ADNItemDocReader.java,v 1.9 2010/07/14 00:19:27 jweather Exp $


Field Summary
protected  ResultDocList allItemResultDocs
          Description of the Field
protected  boolean allItemsInitialized
          Description of the Field
protected  boolean annotationDocReadersInitialized
          Description of the Field
protected  ResultDocList annotationResultDocs
          Description of the Field
protected  ResultDocList associatedItemResultDocs
          Description of the Field
protected  boolean associatedItemsInitialized
          Description of the Field
protected  String collection
          Description of the Field
protected  ArrayList completedAnnos
          Description of the Field
protected  HashMap completedAnnosByType
          Description of the Field
protected static boolean debug
          Description of the Field
protected  String DEFAULT
          Description of the Field
protected  ResultDocList displayableAssociatedItemResultDocs
          Description of the Field
protected  boolean displayableAssociatedItemsInitialized
          Description of the Field
protected  Document doc
          Description of the Field
protected  String[] EMPTY_ARRAY
          Description of the Field
protected  ArrayList EMPTY_LIST
          Description of the Field
protected  String id
          Description of the Field
protected  HashMap inProgressAnnosByStatus
          Description of the Field
protected  ArrayList missingAssociatedItemIds
          Description of the Field
protected  Document multiDoc
          Description of the Field
protected  String multiRecordStatus
          Description of the Field
protected  int numAudioInProgress
          Description of the Field
protected  int numCompletedAnnos
          Description of the Field
protected  int numGraphicalInProgress
          Description of the Field
protected  int numInProgressAnnos
          Description of the Field
protected  int numTextInProgress
          Description of the Field
protected  String readerType
          Description of the Field
protected  MetadataVocab vocab
          Description of the Field
 
Constructor Summary
ADNItemDocReader(String id, GetRecordResponse response)
          Constructor for the ADNItemDocReader object
ADNItemDocReader(String id, GetRecordResponse response, MetadataVocab vocab)
          parse a GetRecordResponse (a response from a GetRecord request), to create an ADNItemDocReader.
ADNItemDocReader(String id, String collection, Document itemRecordDoc, MetadataVocab vocab)
          ADNItemDocReader constructor requiring an itemRecordDoc
 
Method Summary
 ResultDocList getAnnotationResultDocs()
          Gets the ResultDocs for all annotations that refer to this resource.
 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.
 ArrayList getAudioAnnosInProgress()
          Gets the audioAnnosInProgress attribute of the ItemDocReader object
 String getCollection()
          Gets the collection attribute of the ADNItemDocReader object
 String getCollectionKey()
          Gets the collection key associated with this record, for example 01.
 String[] getCollectionKeys()
          Gets the collection keys associated with this record, for example {01,02}.
 ArrayList getCompletedAdvice()
          Gets the completedAdvice attribute of the ItemDocReader object
 ArrayList getCompletedAnnos()
          Gets the completedAnnos attribute of the ItemDocReader object
 ArrayList getCompletedAnnosOfType(String type)
          Gets a list of all completed annotataions for this item of the given type.
 ArrayList getCompletedAnnotation()
          Gets the completedAnnotation attribute of the ItemDocReader object
 ArrayList getCompletedAverageScores()
          Gets the completedAverageScores attribute of the ItemDocReader object
 ArrayList getCompletedBias()
          Gets the completedBias attribute of the ItemDocReader object
 ArrayList getCompletedChallengingSituations()
          Gets the completedChallengingSituations attribute of the ItemDocReader object
 ArrayList getCompletedChange()
          Gets the completedChange attribute of the ItemDocReader object
 ArrayList getCompletedComment()
          Gets the completedComment attribute of the ItemDocReader object
 ArrayList getCompletedEditorSummaries()
          Gets the completedEditorSummaries attribute of the ItemDocReader object
 ArrayList getCompletedEducationalStandard()
          Gets the completedEducationalStandard attribute of the ItemDocReader object
 ArrayList getCompletedExample()
          Gets the completedExample attribute of the ItemDocReader object
 ArrayList getCompletedExplanation()
          Gets the completedExplanation attribute of the ItemDocReader object
 ArrayList getCompletedQuestion()
          Gets the completedQuestion attribute of the ItemDocReader object
 ArrayList getCompletedReviews()
          Gets the completedReviews attribute of the ItemDocReader object
 ArrayList getCompletedSeeAlso()
          Gets the completedSeeAlso attribute of the ItemDocReader object
 ArrayList getCompletedTeachingTips()
          Gets the completedTeachingTips attribute of the ItemDocReader object
 String[] getContentStandards()
          Gets the contentStandards attribute of the ADNItemDocReader object
 String getDescription()
          Gets the description attribute of the ADNItemDocReader object
protected  Element getElement(String xpath)
          Gets a single Element satisfying given XPath.
protected  List getElements(String xpath)
          get all Elements satisfying the given xpath
protected  String getElementText(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  String getFieldContent(String value, String useVocabMapping)
          Gets the encoded vocab key for the given content.
 String[] getGradeRanges()
          Gets the gradeRanges for this item (as vocab keys)
 ArrayList getGraphicalAnnosInProgress()
          Gets the graphicalAnnosInProgress attribute of the ItemDocReader object
 String getHasCompletedAnno()
          Gets the hasCompletedAnno attribute of the ItemDocReader object
 String getHasInProgressAnno()
          Determines whether the item has an annotation in progress.
protected  boolean getHasRelatedResource()
          Returns true if the item has one or more related resource, false otherwise.
 String getId()
          gets the ID of the item
 ArrayList getInProgressAnnosOfStatus(String status)
          Gets all in-progress annotations for this item that have the given status.
 String getMetadataPrefix()
          Gets the metadataPrefix attribute of the ADNItemDocReader object
 List getMirrorUrls()
           
protected  String[] getMultiElementTexts(String xpath)
          get the values of all elements matching an XPath
 String[] getMultiGradeRanges()
          Gets the multiGradeRanges attribute of the ADNItemDocReader object
 String[] getMultiResourceTypes()
          Gets the multiResourceTypes attribute of the ADNItemDocReader object
 String[] getMultiSubjects()
          Gets the multiSubjects attribute of the ADNItemDocReader object
 String getNumAudioAnnosInProgress()
          Gets the numAudioAnnosInProgress attribute of the ItemDocReader object
 String getNumCompletedAnnos()
          Gets the numCompletedAnnos attribute of the ItemDocReader object
 String getNumGraphicalAnnosInProgress()
          Gets the numGraphicalAnnosInProgress attribute of the ItemDocReader object
 String getNumInProgressAnnos()
          Gets the numInProgressAnnos attribute of the ItemDocReader object
 String getNumTextAnnosInProgress()
          Gets the numTextAnnosInProgress attribute of the ItemDocReader object
 String getReaderType()
          Gets the String 'ItemDocReader,' which is the key that describes this reader type.
 String[] getResourceTypes()
          Gets the resourceTypes attribute of the ADNItemDocReader object
 String[] getSubjects()
          Gets the subjects attribute of the ADNItemDocReader object
 ArrayList getTextAnnosInProgress()
          Gets the textAnnosInProgress attribute of the ItemDocReader object
 String getTitle()
          Gets the title attribute of the ADNItemDocReader object
 String getUrl()
          Gets the url attribute of the
 String getUrlTruncated()
          Gets the URL for this resource, truncated if it is very long
 String getValueOf(String xpath)
          Gets the valueOf attribute of the ADNItemDocReader object
 boolean hasCompletedAnno()
          Determines whether this item has at least one completed annotation.
 boolean hasCompletedAnnoOfType(String type)
          Determines whether this item has a completed annotataion of the given type.
 boolean hasDoc()
          Description of the Method
 boolean hasInProgressAnno()
          Determines whether the item has an annotation in progress.
 boolean hasInProgressAnnoOfStatus(String status)
          Determines whether the item has an annotation in progress with the given status.
protected  void initAnnosByType()
          Description of the Method
static void prtln(String s)
          Description of the Method
static void prtlnArray(String[] s)
          Description of the Method
 void setReaderType(String s)
          Sets the readerType attribute of the ADNItemDocReader object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vocab

protected MetadataVocab vocab
Description of the Field


debug

protected static boolean debug
Description of the Field


id

protected String id
Description of the Field


collection

protected String collection
Description of the Field


readerType

protected String readerType
Description of the Field


doc

protected Document doc
Description of the Field


EMPTY_ARRAY

protected String[] EMPTY_ARRAY
Description of the Field


DEFAULT

protected String DEFAULT
Description of the Field


EMPTY_LIST

protected ArrayList EMPTY_LIST
Description of the Field


associatedItemResultDocs

protected ResultDocList associatedItemResultDocs
Description of the Field


displayableAssociatedItemResultDocs

protected ResultDocList displayableAssociatedItemResultDocs
Description of the Field


allItemResultDocs

protected ResultDocList allItemResultDocs
Description of the Field


annotationResultDocs

protected ResultDocList annotationResultDocs
Description of the Field


associatedItemsInitialized

protected boolean associatedItemsInitialized
Description of the Field


displayableAssociatedItemsInitialized

protected boolean displayableAssociatedItemsInitialized
Description of the Field


allItemsInitialized

protected boolean allItemsInitialized
Description of the Field


annotationDocReadersInitialized

protected boolean annotationDocReadersInitialized
Description of the Field


missingAssociatedItemIds

protected ArrayList missingAssociatedItemIds
Description of the Field


multiRecordStatus

protected String multiRecordStatus
Description of the Field


multiDoc

protected Document multiDoc
Description of the Field


completedAnnosByType

protected HashMap completedAnnosByType
Description of the Field


completedAnnos

protected ArrayList completedAnnos
Description of the Field


inProgressAnnosByStatus

protected HashMap inProgressAnnosByStatus
Description of the Field


numCompletedAnnos

protected int numCompletedAnnos
Description of the Field


numInProgressAnnos

protected int numInProgressAnnos
Description of the Field


numAudioInProgress

protected int numAudioInProgress
Description of the Field


numGraphicalInProgress

protected int numGraphicalInProgress
Description of the Field


numTextInProgress

protected int numTextInProgress
Description of the Field

Constructor Detail

ADNItemDocReader

public ADNItemDocReader(String id,
                        String collection,
                        Document itemRecordDoc,
                        MetadataVocab vocab)
ADNItemDocReader constructor requiring an itemRecordDoc

Parameters:
id - Description of the Parameter
collection - Description of the Parameter
itemRecordDoc - Description of the Parameter
vocab - Description of the Parameter

ADNItemDocReader

public ADNItemDocReader(String id,
                        GetRecordResponse response)
Constructor for the ADNItemDocReader object

Parameters:
id - Description of the Parameter
response - Description of the Parameter

ADNItemDocReader

public ADNItemDocReader(String id,
                        GetRecordResponse response,
                        MetadataVocab vocab)
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 Parameter
response - Description of the Parameter
vocab - Description of the Parameter
Method Detail

hasDoc

public boolean hasDoc()
Description of the Method

Returns:
Description of the Return Value

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.

Returns:
The String 'ItemDocReader'.

setReaderType

public void setReaderType(String s)
Sets the readerType attribute of the ADNItemDocReader object

Parameters:
s - The new readerType value

getMetadataPrefix

public String getMetadataPrefix()
Gets the metadataPrefix attribute of the ADNItemDocReader object

Returns:
The metadataPrefix value

getId

public String getId()
gets the ID of the item

Returns:
the id value

getUrl

public String getUrl()
Gets the url attribute of the

Returns:
The url value

getUrlTruncated

public String getUrlTruncated()
Gets the URL for this resource, truncated if it is very long

Returns:
The url value

getTitle

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

Returns:
The title value

getDescription

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

Returns:
The description value

getCollection

public String getCollection()
Gets the collection attribute of the ADNItemDocReader object

Returns:
The collection value

getCollectionKey

public String 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

public String[] 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

public List getMirrorUrls()

getAssociatedCollectionKeys

public ArrayList 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

public String[] getGradeRanges()
Gets the gradeRanges for this item (as vocab keys)

Returns:
The gradeRanges value

getMultiGradeRanges

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

Returns:
The multiGradeRanges value

getResourceTypes

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

Returns:
The resourceTypes value

getMultiResourceTypes

public String[] getMultiResourceTypes()
Gets the multiResourceTypes attribute of the ADNItemDocReader object

Returns:
The multiResourceTypes value

getSubjects

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

Returns:
The subjects value

getMultiSubjects

public String[] getMultiSubjects()
Gets the multiSubjects attribute of the ADNItemDocReader object

Returns:
The multiSubjects value

getContentStandards

public String[] 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

protected String[] getFieldContent(String[] values,
                                   String useVocabMapping)
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

protected String getFieldContent(String value,
                                 String useVocabMapping)
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

protected List getElements(String xpath)
get all Elements satisfying the given xpath

Parameters:
xpath - an XPath
Returns:
a List of all elements satisfying given XPath, or null

getElement

protected Element getElement(String xpath)
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

protected String getElementText(String xpath)
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

protected String[] getMultiElementTexts(String xpath)
get the values of all elements matching an XPath

Parameters:
xpath - Description of the Parameter
Returns:
Array of values

getValueOf

public String getValueOf(String xpath)
Gets the valueOf attribute of the ADNItemDocReader object

Parameters:
xpath - Description of the Parameter
Returns:
The valueOf value

prtlnArray

public static void prtlnArray(String[] s)
Description of the Method

Parameters:
s - Description of the Parameter

prtln

public static void prtln(String s)
Description of the Method

Parameters:
s - Description of the Parameter

getAnnotationResultDocs

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

Returns:
The ResultDocs value

getAssociatedIds

public String[] 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

public String getHasCompletedAnno()
Gets the hasCompletedAnno attribute of the ItemDocReader object

Returns:
The hasCompletedAnno value

getNumCompletedAnnos

public String getNumCompletedAnnos()
Gets the numCompletedAnnos attribute of the ItemDocReader object

Returns:
The numCompletedAnnos value

getNumInProgressAnnos

public String getNumInProgressAnnos()
Gets the numInProgressAnnos attribute of the ItemDocReader object

Returns:
The numInProgressAnnos value

getNumTextAnnosInProgress

public String getNumTextAnnosInProgress()
Gets the numTextAnnosInProgress attribute of the ItemDocReader object

Returns:
The numTextAnnosInProgress value

getNumAudioAnnosInProgress

public String getNumAudioAnnosInProgress()
Gets the numAudioAnnosInProgress attribute of the ItemDocReader object

Returns:
The numAudioAnnosInProgress value

getNumGraphicalAnnosInProgress

public String getNumGraphicalAnnosInProgress()
Gets the numGraphicalAnnosInProgress attribute of the ItemDocReader object

Returns:
The numGraphicalAnnosInProgress value

hasCompletedAnnoOfType

public boolean hasCompletedAnnoOfType(String type)
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

public ArrayList getCompletedAnnosOfType(String type)
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

public String 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

public boolean hasInProgressAnnoOfStatus(String status)
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

public ArrayList getInProgressAnnosOfStatus(String status)
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

public ArrayList getTextAnnosInProgress()
Gets the textAnnosInProgress attribute of the ItemDocReader object

Returns:
The textAnnosInProgress value

getAudioAnnosInProgress

public ArrayList getAudioAnnosInProgress()
Gets the audioAnnosInProgress attribute of the ItemDocReader object

Returns:
The audioAnnosInProgress value

getGraphicalAnnosInProgress

public ArrayList getGraphicalAnnosInProgress()
Gets the graphicalAnnosInProgress attribute of the ItemDocReader object

Returns:
The graphicalAnnosInProgress value

getCompletedAnnos

public ArrayList getCompletedAnnos()
Gets the completedAnnos attribute of the ItemDocReader object

Returns:
The completedAnnos value

getCompletedReviews

public ArrayList getCompletedReviews()
Gets the completedReviews attribute of the ItemDocReader object

Returns:
The completedReviews value

getCompletedTeachingTips

public ArrayList getCompletedTeachingTips()
Gets the completedTeachingTips attribute of the ItemDocReader object

Returns:
The completedTeachingTips value

getCompletedEditorSummaries

public ArrayList getCompletedEditorSummaries()
Gets the completedEditorSummaries attribute of the ItemDocReader object

Returns:
The completedEditorSummaries value

getCompletedChallengingSituations

public ArrayList getCompletedChallengingSituations()
Gets the completedChallengingSituations attribute of the ItemDocReader object

Returns:
The completedChallengingSituations value

getCompletedAverageScores

public ArrayList getCompletedAverageScores()
Gets the completedAverageScores attribute of the ItemDocReader object

Returns:
The completedAverageScores value

getCompletedAdvice

public ArrayList getCompletedAdvice()
Gets the completedAdvice attribute of the ItemDocReader object

Returns:
The completedAdvice value

getCompletedAnnotation

public ArrayList getCompletedAnnotation()
Gets the completedAnnotation attribute of the ItemDocReader object

Returns:
The completedAnnotation value

getCompletedBias

public ArrayList getCompletedBias()
Gets the completedBias attribute of the ItemDocReader object

Returns:
The completedBias value

getCompletedChange

public ArrayList getCompletedChange()
Gets the completedChange attribute of the ItemDocReader object

Returns:
The completedChange value

getCompletedComment

public ArrayList getCompletedComment()
Gets the completedComment attribute of the ItemDocReader object

Returns:
The completedComment value

getCompletedEducationalStandard

public ArrayList getCompletedEducationalStandard()
Gets the completedEducationalStandard attribute of the ItemDocReader object

Returns:
The completedEducationalStandard value

getCompletedExample

public ArrayList getCompletedExample()
Gets the completedExample attribute of the ItemDocReader object

Returns:
The completedExample value

getCompletedExplanation

public ArrayList getCompletedExplanation()
Gets the completedExplanation attribute of the ItemDocReader object

Returns:
The completedExplanation value

getCompletedQuestion

public ArrayList getCompletedQuestion()
Gets the completedQuestion attribute of the ItemDocReader object

Returns:
The completedQuestion value

getCompletedSeeAlso

public ArrayList getCompletedSeeAlso()
Gets the completedSeeAlso attribute of the ItemDocReader object

Returns:
The completedSeeAlso value

DLESE Tools
v1.6.0