Class CATServiceHelper
- All Implemented Interfaces:
SuggestionServiceHelper
- Direct Known Subclasses:
AsnSuggestionServiceHelper,CommCoreServiceHelper,DleseSuggestionServiceHelper,TeachersDomainServiceHelper
The CAT service UI involves extraction of several values from the item
record being edited for each framework, such as selected keywords, selected
graderanges, etc. The functionality to extract these values is delegated to
the framework-specific plug-in, which implments CATHelperPlugin.
- Author:
- ostwald
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCATServiceHelper(SchemEditForm sef, CATHelperPlugin frameworkPlugin) Constructor for the CATServiceHelper object -
Method Summary
Modifier and TypeMethodDescriptionvoiddisplaySuggestions(List standardsList) DebuggingGets the actionForm attribute of the CATServiceHelper objectResolves author from the asnDocument (which it gets from the StandardsDocument)Gets the availableDocs attribute of the CATServiceHelper objectprotected CATRequestConstraintsBuild a MetadataContraint instance from current CATServiceHelper attributes, including keywords, description, gradeRanges (when the corresponding "use" attributes return true).Gets the currentDoc attribute of the CATServiceHelper objectGets the gradeRangeOptionValue corresponding to the highest selected gradeRange in the current instance document.Gets the gradeRangeOptionValue corresponding to the lowest selected gradeRange in the current instance document.Determines what standards to display (SUGGESTED_CONTENT, STANDARDS_CONTENT, BOTH, ALL)Determines whether standards are displayed as a heirarchical tree or flat list.protected MetaDataFrameworkGets the framework attribute of the CATServiceHelper objectGets the frameworkPlugin attribute of the SuggestionServiceHelper objectGets the gradeRanges corresponding to the grades searchable in the current frameworkprotected abstract StringGets the idFromCATStandard attribute of the CATServiceHelper objectstatic CATServiceHelpergetInstance(SchemEditForm sef) Gets the instance attribute of the CATServiceHelper classprotected org.dom4j.DocumentGets the document attribute of the CATServiceHelper objectintintGets the numSelectedStandards attribute of the CATServiceHelper objectGets a list specifying what optional fields (e.g., "subject", "keyword") is exported by this framework.Gets the otherSelectedStandards attribute of the CATServiceHelper objectGets the value of the description field of the current metadata recordString[]Gets the gradeRanges assigned for the current recordString[]Gets the value of the description field of the current metadata recordString[]Gets the recordSubjects attribute of the CATServiceHelper objectGets the recordUrl specified in the instance document (via theSchemEditForm).Gets the rootStandardNode attribute of the CATServiceHelper objectString[]Gets the GradeRanges curently selected in the CAT UI.Gets the keywords currently selected in the service controls.Retrieves a list of selected standards that can be fed into the "moreLikeThis" method.protected ListgetSelectedStandards(org.dom4j.Document doc) Retrieves a list of selected standards from the provided instance document that can be fed into the "moreLikeThis" method.booleanGets the serviceIsActive attribute of the CATServiceHelper objectabstract StandardsDocumentGets the standardsDocument from which suggestions are requested and received.abstract StringGets the standardsFormat attribute of the CATServiceHelper objectGets the standardsManager attribute of the CATServiceHelper objectGets a list of all standardsNodes in the current StandardsDocument in standards document order.Gets the suggested Standards represented in ADN format.getTopic()Resolves topic for this asnDocument asnDocument (which it gets from the StandardsDocument)getUrl()Gets the url attribute of the CATServiceHelper objectbooleanSpecifies whether user has chosen to constrain suggestion service using current value of description field in the current metadata record.booleanSpecifies whether user has chosen to constrain suggestion service using current value of gradeRange checkboxes in the suggestion service interface.booleanSpecifies whether user has chosen to constrain suggestion service using current value of keywords box in the suggestion service interface.booleanSpecifies whether user has chosen to constrain suggestion service using current value of keywords box in the suggestion service interface.Gets the xmlFormat attribute of the CATServiceHelper objectgetXpath()Gets the xpath of the metadata element containing the managedStandardsvoidUpdate the suggestions based on the currently selected standards and the current suggestionConstraints.voidsetDisplayContent(String content) Sets the displayContent attribute of the CATServiceHelper objectvoidsetDisplayMode(String mode) Sets the displayMode attribute to either TREE_MODE (to display all standards) or LIST_MODE (to display either suggested or selected standards);protected voidsetFrameworkPlugin(CATHelperPlugin plugin) Sets the frameworkPlugin attribute of the CATServiceHelper objectvoidsetKeywordWeighting(int weight) Keywordweighting specifies how many times the keyword contents are repeated before they are inserted into the keyword field of the Contraint instance.voidsetSelectedGradeRanges(String[] grs) Sets the selectedGradeRanges attribute of the CATServiceHelper objectvoidSets the selectedKeywords attribute of the CATServiceHelper objectvoidsetServiceIsActive(boolean b) Sets the serviceIsActive attribute of the CATServiceHelper objectvoidsetSuggestedStandards(List stds) Sets the suggestedStandards attribute of the CATServiceHelper objectvoidSets the url attribute of the CATServiceHelper objectvoidsetUseDescription(boolean useIt) Sets the useDescription attribute of the CATServiceHelper objectvoidsetUseGradeRanges(boolean useIt) Sets the useGradeRanges attribute of the CATServiceHelper objectvoidsetUseKeywords(boolean useIt) Sets the useKeywords attribute of the CATServiceHelper objectvoidsetUseSubjects(boolean useIt) Sets the useSubjects attribute of the CATServiceHelper objectvoidupdateDisplayControls(HttpServletRequest request) Sets various control attributes from the information contained in the request, such as displayMode, displayContent, and whether description, grade ranges, subjects, keywords, will be used in the CAT Service request.voidupdateStandardsDisplay(String displayContent) Initialize the collapse bean to show selected and suggested standards nodes in the display specified by "displayContent".voidDescription of the MethodvoidupdateSuggestions(List feedbackStandards) Performs a query on the suggestion server using the current contraints, and updates the suggestedStandards attribute of the CATServiceHelper with the results, which is a list of standards IDS.
-
Field Details
-
TREE_MODE
NOT YET DOCUMENTED- See Also:
-
LIST_MODE
NOT YET DOCUMENTED- See Also:
-
SELECTED_CONTENT
NOT YET DOCUMENTED- See Also:
-
SUGGESTIONS_CONTENT
NOT YET DOCUMENTED- See Also:
-
BOTH_CONTENT
NOT YET DOCUMENTED- See Also:
-
ALL_CONTENT
NOT YET DOCUMENTED- See Also:
-
-
Constructor Details
-
CATServiceHelper
Constructor for the CATServiceHelper object- Parameters:
sef- Description of the ParameterframeworkPlugin- NOT YET DOCUMENTED
-
-
Method Details
-
getStandardsDocument
Gets the standardsDocument from which suggestions are requested and received.- Returns:
- The standardsDocument value
-
getStandardsFormat
Gets the standardsFormat attribute of the CATServiceHelper object- Returns:
- The standardsFormat value (e.g., "dlese", "asn")
-
getFrameworkPlugin
Gets the frameworkPlugin attribute of the SuggestionServiceHelper object- Returns:
- The frameworkPlugin value
-
setFrameworkPlugin
Sets the frameworkPlugin attribute of the CATServiceHelper object- Parameters:
plugin- The new frameworkPlugin value
-
getStandardsManager
Gets the standardsManager attribute of the CATServiceHelper object- Specified by:
getStandardsManagerin interfaceSuggestionServiceHelper- Returns:
- The standardsManager value
-
getRootStandardNode
Gets the rootStandardNode attribute of the CATServiceHelper object- Returns:
- The rootStandardNode value
-
getStandardsNodes
Gets a list of all standardsNodes in the current StandardsDocument in standards document order.- Returns:
- The standardsNodes value
-
getAuthor
Resolves author from the asnDocument (which it gets from the StandardsDocument)- Returns:
- The author value
-
getTopic
Resolves topic for this asnDocument asnDocument (which it gets from the StandardsDocument)- Returns:
- The topic value
-
getAvailableDocs
Gets the availableDocs attribute of the CATServiceHelper object- Returns:
- The availableDocs value
-
getCurrentDoc
Gets the currentDoc attribute of the CATServiceHelper object- Specified by:
getCurrentDocin interfaceSuggestionServiceHelper- Returns:
- The currentDoc value
-
getInstance
Gets the instance attribute of the CATServiceHelper class- Parameters:
sef- Description of the Parameter- Returns:
- The instance value
- Throws:
Exception- Description of the Exception
-
getActionForm
Gets the actionForm attribute of the CATServiceHelper object- Returns:
- The actionForm value
-
getFramework
Gets the framework attribute of the CATServiceHelper object- Returns:
- The framework value
-
getInstanceDocument
protected org.dom4j.Document getInstanceDocument()Gets the document attribute of the CATServiceHelper object- Returns:
- The document value
-
getServiceIsActive
public boolean getServiceIsActive()Gets the serviceIsActive attribute of the CATServiceHelper object- Specified by:
getServiceIsActivein interfaceSuggestionServiceHelper- Returns:
- true if the SuggestionService is available
-
setServiceIsActive
public void setServiceIsActive(boolean b) Sets the serviceIsActive attribute of the CATServiceHelper object- Parameters:
b- The new serviceIsActive value
-
getXpath
Gets the xpath of the metadata element containing the managedStandards- Specified by:
getXpathin interfaceSuggestionServiceHelper- Returns:
- The xpath value
-
getXmlFormat
Gets the xmlFormat attribute of the CATServiceHelper object- Specified by:
getXmlFormatin interfaceSuggestionServiceHelper- Returns:
- The xmlFormat value
-
getSuggestedStandards
Gets the suggested Standards represented in ADN format.- Specified by:
getSuggestedStandardsin interfaceSuggestionServiceHelper- Returns:
- The suggestedStandards value
-
getNumSelectedStandards
public int getNumSelectedStandards()Gets the numSelectedStandards attribute of the CATServiceHelper object- Specified by:
getNumSelectedStandardsin interfaceSuggestionServiceHelper- Returns:
- The numSelectedStandards value
-
getSelectedStandards
Retrieves a list of selected standards that can be fed into the "moreLikeThis" method.- Specified by:
getSelectedStandardsin interfaceSuggestionServiceHelper- Returns:
- The selectedStandards value
-
getSelectedStandards
Retrieves a list of selected standards from the provided instance document that can be fed into the "moreLikeThis" method.NOTE: used to support asyncronous calls, in which the instance document of the formBean may not reflect the most recent values.
- Parameters:
doc- the instance document- Returns:
- The selectedStandards as a list of standards IDS
-
getOtherSelectedStandards
Gets the otherSelectedStandards attribute of the CATServiceHelper object- Returns:
- The otherSelectedStandards value
-
setSuggestedStandards
Sets the suggestedStandards attribute of the CATServiceHelper object- Specified by:
setSuggestedStandardsin interfaceSuggestionServiceHelper- Parameters:
stds- The new suggestedStandards value
-
getUseDescription
public boolean getUseDescription()Specifies whether user has chosen to constrain suggestion service using current value of description field in the current metadata record.- Returns:
- true if description contstraint is to be used.
-
setUseDescription
public void setUseDescription(boolean useIt) Sets the useDescription attribute of the CATServiceHelper object- Parameters:
useIt- The new useDescription value
-
getUseKeywords
public boolean getUseKeywords()Specifies whether user has chosen to constrain suggestion service using current value of keywords box in the suggestion service interface.- Returns:
- The useKeywords value
-
setUseKeywords
public void setUseKeywords(boolean useIt) Sets the useKeywords attribute of the CATServiceHelper object- Parameters:
useIt- The new useKeywords value
-
getUseSubjects
public boolean getUseSubjects()Specifies whether user has chosen to constrain suggestion service using current value of keywords box in the suggestion service interface.- Returns:
- The useSubjects value
-
setUseSubjects
public void setUseSubjects(boolean useIt) Sets the useSubjects attribute of the CATServiceHelper object- Parameters:
useIt- The new useSubjects value
-
getUseGradeRanges
public boolean getUseGradeRanges()Specifies whether user has chosen to constrain suggestion service using current value of gradeRange checkboxes in the suggestion service interface.- Returns:
- The useGradeRanges value
-
setUseGradeRanges
public void setUseGradeRanges(boolean useIt) Sets the useGradeRanges attribute of the CATServiceHelper object- Parameters:
useIt- The new useGradeRanges value
-
getDisplayMode
Determines whether standards are displayed as a heirarchical tree or flat list.- Specified by:
getDisplayModein interfaceSuggestionServiceHelper- Returns:
- LIST_MODE for list mode, TREE_MODE for tree mode.
-
setDisplayMode
Sets the displayMode attribute to either TREE_MODE (to display all standards) or LIST_MODE (to display either suggested or selected standards);- Parameters:
mode- The new displayMode value
-
getDisplayContent
Determines what standards to display (SUGGESTED_CONTENT, STANDARDS_CONTENT, BOTH, ALL)- Specified by:
getDisplayContentin interfaceSuggestionServiceHelper- Returns:
- The displayContent value
-
setDisplayContent
Sets the displayContent attribute of the CATServiceHelper object- Parameters:
content- The new displayContent value
-
getUrl
Gets the url attribute of the CATServiceHelper object- Specified by:
getUrlin interfaceSuggestionServiceHelper- Returns:
- The url value
-
setUrl
Sets the url attribute of the CATServiceHelper object- Parameters:
url- The new url value
-
getOptionalCatUIFields
Gets a list specifying what optional fields (e.g., "subject", "keyword") is exported by this framework. The UI controls for these fields will be active.- Returns:
- The optionalCatUIFields value
-
getRecordGradeRanges
Gets the gradeRanges assigned for the current record- Returns:
- The recordGradeRanges value
-
getSelectedGradeRanges
Gets the GradeRanges curently selected in the CAT UI.- Returns:
- The selectedGradeRanges value
-
getDerivedCATStartGrade
Gets the gradeRangeOptionValue corresponding to the lowest selected gradeRange in the current instance document.NOTE: this requires converting from possible gradeRange metadata values to the values supplied for gradeRangeOptions.
- Specified by:
getDerivedCATStartGradein interfaceSuggestionServiceHelper- Returns:
- The startGradeOptionValue value
-
getDerivedCATEndGrade
Gets the gradeRangeOptionValue corresponding to the highest selected gradeRange in the current instance document.NOTE: this requires converting from possible gradeRange metadata values to the values supplied for gradeRangeOptions.
- Specified by:
getDerivedCATEndGradein interfaceSuggestionServiceHelper- Returns:
- The endGrade value
-
setSelectedGradeRanges
Sets the selectedGradeRanges attribute of the CATServiceHelper object- Parameters:
grs- The new selectedGradeRanges value
-
getKeywordWeighting
public int getKeywordWeighting()- Returns:
- The keywordWeighting value
-
setKeywordWeighting
public void setKeywordWeighting(int weight) Keywordweighting specifies how many times the keyword contents are repeated before they are inserted into the keyword field of the Contraint instance.- Parameters:
weight- The new keywordWeighting value
-
getGradeRangeOptions
Gets the gradeRanges corresponding to the grades searchable in the current framework- Returns:
- The gradeRanges value
-
getRecordDescription
Gets the value of the description field of the current metadata record- Returns:
- The description
-
getRecordKeywords
Gets the value of the description field of the current metadata record- Returns:
- The keywords
-
getRecordSubjects
Gets the recordSubjects attribute of the CATServiceHelper object- Returns:
- The recordSubjects value
-
getSelectedKeywords
Gets the keywords currently selected in the service controls.- Returns:
- The selectedKeywords value
-
setSelectedKeywords
Sets the selectedKeywords attribute of the CATServiceHelper object- Parameters:
kws- The new selectedKeywords value
-
getRecordUrl
Gets the recordUrl specified in the instance document (via theSchemEditForm).Note: this method depends on the url path being defined in the framework configuration.
- Specified by:
getRecordUrlin interfaceSuggestionServiceHelper- Returns:
- The recordUrl value
-
updateSuggestions
Description of the Method- Specified by:
updateSuggestionsin interfaceSuggestionServiceHelper- Throws:
Exception- Description of the Exception
-
updateSuggestions
Performs a query on the suggestion server using the current contraints, and updates the suggestedStandards attribute of the CATServiceHelper with the results, which is a list of standards IDS.- Parameters:
feedbackStandards- Description of the Parameter- Throws:
Exception- NOT YET DOCUMENTED
-
moreLikeThis
Update the suggestions based on the currently selected standards and the current suggestionConstraints.- Throws:
Exception- NOT YET DOCUMENTED
-
getConstraints
Build a MetadataContraint instance from current CATServiceHelper attributes, including keywords, description, gradeRanges (when the corresponding "use" attributes return true).NOTE: Author and Topic hardcoded to "National Science Education Standards (NSES)" and "Science", respectively
- Returns:
- A contraint for a SuggestionService Search request.
-
getIdFromCATStandard
Gets the idFromCATStandard attribute of the CATServiceHelper object- Parameters:
std- NOT YET DOCUMENTED- Returns:
- The idFromCATStandard value
-
updateDisplayControls
Sets various control attributes from the information contained in the request, such as displayMode, displayContent, and whether description, grade ranges, subjects, keywords, will be used in the CAT Service request.- Parameters:
request- NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-
updateStandardsDisplay
Initialize the collapse bean to show selected and suggested standards nodes in the display specified by "displayContent".- Specified by:
updateStandardsDisplayin interfaceSuggestionServiceHelper- Parameters:
displayContent- Description of the Parameter- Throws:
Exception- NOT YET DOCUMENTED
-
displaySuggestions
Debugging- Parameters:
standardsList- A list of StandardsWrapper instances to display.
-