public abstract class CATServiceHelper extends java.lang.Object implements SuggestionServiceHelper
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
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL_CONTENT
NOT YET DOCUMENTED
|
static java.lang.String |
BOTH_CONTENT
NOT YET DOCUMENTED
|
static java.lang.String |
LIST_MODE
NOT YET DOCUMENTED
|
static java.lang.String |
SELECTED_CONTENT
NOT YET DOCUMENTED
|
static java.lang.String |
SUGGESTIONS_CONTENT
NOT YET DOCUMENTED
|
static java.lang.String |
TREE_MODE
NOT YET DOCUMENTED
|
Constructor and Description |
---|
CATServiceHelper(SchemEditForm sef,
CATHelperPlugin frameworkPlugin)
Constructor for the CATServiceHelper object
|
Modifier and Type | Method and Description |
---|---|
void |
displaySuggestions(java.util.List standardsList)
Debugging
|
SchemEditForm |
getActionForm()
Gets the actionForm attribute of the CATServiceHelper object
|
java.lang.String |
getAuthor()
Resolves author from the asnDocument (which it gets from the
StandardsDocument)
|
java.util.List |
getAvailableDocs()
Gets the availableDocs attribute of the CATServiceHelper object
|
protected CATRequestConstraints |
getConstraints()
Build a MetadataContraint instance from current CATServiceHelper
attributes, including keywords, description, gradeRanges (when the
corresponding "use" attributes return true).
|
java.lang.String |
getCurrentDoc()
Gets the currentDoc attribute of the CATServiceHelper object
|
java.lang.String |
getDerivedCATEndGrade()
Gets the gradeRangeOptionValue corresponding to the highest selected
gradeRange in the current instance document.
|
java.lang.String |
getDerivedCATStartGrade()
Gets the gradeRangeOptionValue corresponding to the lowest selected
gradeRange in the current instance document.
|
java.lang.String |
getDisplayContent()
Determines what standards to display (SUGGESTED_CONTENT, STANDARDS_CONTENT,
BOTH, ALL)
|
java.lang.String |
getDisplayMode()
Determines whether standards are displayed as a heirarchical tree or flat
list.
|
protected MetaDataFramework |
getFramework()
Gets the framework attribute of the CATServiceHelper object
|
CATHelperPlugin |
getFrameworkPlugin()
Gets the frameworkPlugin attribute of the SuggestionServiceHelper object
|
java.util.List |
getGradeRangeOptions()
Gets the gradeRanges corresponding to the grades searchable in the current
framework
|
protected abstract java.lang.String |
getIdFromCATStandard(CATStandard std)
Gets the idFromCATStandard attribute of the CATServiceHelper object
|
static CATServiceHelper |
getInstance(SchemEditForm sef)
Gets the instance attribute of the CATServiceHelper class
|
protected org.dom4j.Document |
getInstanceDocument()
Gets the document attribute of the CATServiceHelper object
|
int |
getKeywordWeighting() |
int |
getNumSelectedStandards()
Gets the numSelectedStandards attribute of the CATServiceHelper object
|
java.util.List |
getOptionalCatUIFields()
Gets a list specifying what optional fields (e.g., "subject", "keyword") is
exported by this framework.
|
java.util.Map |
getOtherSelectedStandards()
Gets the otherSelectedStandards attribute of the CATServiceHelper object
|
java.lang.String |
getRecordDescription()
Gets the value of the description field of the current metadata record
|
java.lang.String[] |
getRecordGradeRanges()
Gets the gradeRanges assigned for the current record
|
java.lang.String[] |
getRecordKeywords()
Gets the value of the description field of the current metadata record
|
java.lang.String[] |
getRecordSubjects()
Gets the recordSubjects attribute of the CATServiceHelper object
|
java.lang.String |
getRecordUrl()
Gets the recordUrl specified in the instance document (via the
SchemEditForm ). |
StandardsNode |
getRootStandardNode()
Gets the rootStandardNode attribute of the CATServiceHelper object
|
java.lang.String[] |
getSelectedGradeRanges()
Gets the GradeRanges curently selected in the CAT UI.
|
java.lang.String |
getSelectedKeywords()
Gets the keywords currently selected in the service controls.
|
java.util.List |
getSelectedStandards()
Retrieves a list of selected standards that can be fed into the
"moreLikeThis" method.
|
protected java.util.List |
getSelectedStandards(org.dom4j.Document doc)
Retrieves a list of selected standards from the provided instance document
that can be fed into the "moreLikeThis" method.
|
boolean |
getServiceIsActive()
Gets the serviceIsActive attribute of the CATServiceHelper object
|
abstract StandardsDocument |
getStandardsDocument()
Gets the standardsDocument from which suggestions are requested and received.
|
abstract java.lang.String |
getStandardsFormat()
Gets the standardsFormat attribute of the CATServiceHelper object
|
StandardsManager |
getStandardsManager()
Gets the standardsManager attribute of the CATServiceHelper object
|
java.util.List |
getStandardsNodes()
Gets a list of all standardsNodes in the current StandardsDocument in standards document order.
|
java.util.List |
getSuggestedStandards()
Gets the suggested Standards represented in ADN format.
|
java.lang.String |
getTopic()
Resolves topic for this asnDocument asnDocument (which it gets from the
StandardsDocument)
|
java.lang.String |
getUrl()
Gets the url attribute of the CATServiceHelper object
|
boolean |
getUseDescription()
Specifies whether user has chosen to constrain suggestion service using
current value of description field in the current metadata record.
|
boolean |
getUseGradeRanges()
Specifies whether user has chosen to constrain suggestion service using
current value of gradeRange checkboxes in the suggestion service interface.
|
boolean |
getUseKeywords()
Specifies whether user has chosen to constrain suggestion service using
current value of keywords box in the suggestion service interface.
|
boolean |
getUseSubjects()
Specifies whether user has chosen to constrain suggestion service using
current value of keywords box in the suggestion service interface.
|
java.lang.String |
getXmlFormat()
Gets the xmlFormat attribute of the CATServiceHelper object
|
java.lang.String |
getXpath()
Gets the xpath of the metadata element containing the managedStandards
|
void |
moreLikeThis()
Update the suggestions based on the currently selected standards and the
current suggestionConstraints.
|
void |
setDisplayContent(java.lang.String content)
Sets the displayContent attribute of the CATServiceHelper object
|
void |
setDisplayMode(java.lang.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 void |
setFrameworkPlugin(CATHelperPlugin plugin)
Sets the frameworkPlugin attribute of the CATServiceHelper object
|
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.
|
void |
setSelectedGradeRanges(java.lang.String[] grs)
Sets the selectedGradeRanges attribute of the CATServiceHelper object
|
void |
setSelectedKeywords(java.lang.String kws)
Sets the selectedKeywords attribute of the CATServiceHelper object
|
void |
setServiceIsActive(boolean b)
Sets the serviceIsActive attribute of the CATServiceHelper object
|
void |
setSuggestedStandards(java.util.List stds)
Sets the suggestedStandards attribute of the CATServiceHelper object
|
void |
setUrl(java.lang.String url)
Sets the url attribute of the CATServiceHelper object
|
void |
setUseDescription(boolean useIt)
Sets the useDescription attribute of the CATServiceHelper object
|
void |
setUseGradeRanges(boolean useIt)
Sets the useGradeRanges attribute of the CATServiceHelper object
|
void |
setUseKeywords(boolean useIt)
Sets the useKeywords attribute of the CATServiceHelper object
|
void |
setUseSubjects(boolean useIt)
Sets the useSubjects attribute of the CATServiceHelper object
|
void |
updateDisplayControls(javax.servlet.http.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.
|
void |
updateStandardsDisplay(java.lang.String displayContent)
Initialize the collapse bean to show selected and suggested standards nodes
in the display specified by "displayContent".
|
void |
updateSuggestions()
Description of the Method
|
void |
updateSuggestions(java.util.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.
|
public static final java.lang.String TREE_MODE
public static final java.lang.String LIST_MODE
public static final java.lang.String SELECTED_CONTENT
public static final java.lang.String SUGGESTIONS_CONTENT
public static final java.lang.String BOTH_CONTENT
public static final java.lang.String ALL_CONTENT
public CATServiceHelper(SchemEditForm sef, CATHelperPlugin frameworkPlugin)
sef
- Description of the ParameterframeworkPlugin
- NOT YET DOCUMENTEDpublic abstract StandardsDocument getStandardsDocument()
public abstract java.lang.String getStandardsFormat()
public CATHelperPlugin getFrameworkPlugin()
protected void setFrameworkPlugin(CATHelperPlugin plugin)
plugin
- The new frameworkPlugin valuepublic StandardsManager getStandardsManager()
getStandardsManager
in interface SuggestionServiceHelper
public StandardsNode getRootStandardNode()
public java.util.List getStandardsNodes()
public java.lang.String getAuthor()
public java.lang.String getTopic()
public java.util.List getAvailableDocs()
public java.lang.String getCurrentDoc()
getCurrentDoc
in interface SuggestionServiceHelper
public static CATServiceHelper getInstance(SchemEditForm sef) throws java.lang.Exception
sef
- Description of the Parameterjava.lang.Exception
- Description of the Exceptionpublic SchemEditForm getActionForm()
protected MetaDataFramework getFramework()
protected org.dom4j.Document getInstanceDocument()
public boolean getServiceIsActive()
getServiceIsActive
in interface SuggestionServiceHelper
public void setServiceIsActive(boolean b)
b
- The new serviceIsActive valuepublic java.lang.String getXpath()
getXpath
in interface SuggestionServiceHelper
public java.lang.String getXmlFormat()
getXmlFormat
in interface SuggestionServiceHelper
public java.util.List getSuggestedStandards()
getSuggestedStandards
in interface SuggestionServiceHelper
public int getNumSelectedStandards()
getNumSelectedStandards
in interface SuggestionServiceHelper
public java.util.List getSelectedStandards()
getSelectedStandards
in interface SuggestionServiceHelper
protected java.util.List getSelectedStandards(org.dom4j.Document doc)
NOTE: used to support asyncronous calls, in which the instance document of the formBean may not reflect the most recent values.
doc
- the instance documentpublic java.util.Map getOtherSelectedStandards()
public void setSuggestedStandards(java.util.List stds)
setSuggestedStandards
in interface SuggestionServiceHelper
stds
- The new suggestedStandards valuepublic boolean getUseDescription()
public void setUseDescription(boolean useIt)
useIt
- The new useDescription valuepublic boolean getUseKeywords()
public void setUseKeywords(boolean useIt)
useIt
- The new useKeywords valuepublic boolean getUseSubjects()
public void setUseSubjects(boolean useIt)
useIt
- The new useSubjects valuepublic boolean getUseGradeRanges()
public void setUseGradeRanges(boolean useIt)
useIt
- The new useGradeRanges valuepublic java.lang.String getDisplayMode()
getDisplayMode
in interface SuggestionServiceHelper
public void setDisplayMode(java.lang.String mode)
mode
- The new displayMode valuepublic java.lang.String getDisplayContent()
getDisplayContent
in interface SuggestionServiceHelper
public void setDisplayContent(java.lang.String content)
content
- The new displayContent valuepublic java.lang.String getUrl()
getUrl
in interface SuggestionServiceHelper
public void setUrl(java.lang.String url)
url
- The new url valuepublic java.util.List getOptionalCatUIFields()
public java.lang.String[] getRecordGradeRanges()
public java.lang.String[] getSelectedGradeRanges()
public java.lang.String getDerivedCATStartGrade()
NOTE: this requires converting from possible gradeRange metadata values to the values supplied for gradeRangeOptions.
getDerivedCATStartGrade
in interface SuggestionServiceHelper
public java.lang.String getDerivedCATEndGrade()
NOTE: this requires converting from possible gradeRange metadata values to the values supplied for gradeRangeOptions.
getDerivedCATEndGrade
in interface SuggestionServiceHelper
public void setSelectedGradeRanges(java.lang.String[] grs)
grs
- The new selectedGradeRanges valuepublic int getKeywordWeighting()
public void setKeywordWeighting(int weight)
weight
- The new keywordWeighting valuepublic java.util.List getGradeRangeOptions()
public java.lang.String getRecordDescription()
public java.lang.String[] getRecordKeywords()
public java.lang.String[] getRecordSubjects()
public java.lang.String getSelectedKeywords()
public void setSelectedKeywords(java.lang.String kws)
kws
- The new selectedKeywords valuepublic java.lang.String getRecordUrl()
SchemEditForm
).Note: this method depends on the url path being defined in the framework configuration.
getRecordUrl
in interface SuggestionServiceHelper
public void updateSuggestions() throws java.lang.Exception
updateSuggestions
in interface SuggestionServiceHelper
java.lang.Exception
- Description of the Exceptionpublic void updateSuggestions(java.util.List feedbackStandards) throws java.lang.Exception
feedbackStandards
- Description of the Parameterjava.lang.Exception
- NOT YET DOCUMENTEDpublic void moreLikeThis() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDprotected CATRequestConstraints getConstraints()
NOTE: Author and Topic hardcoded to "National Science Education Standards (NSES)" and "Science", respectively
protected abstract java.lang.String getIdFromCATStandard(CATStandard std)
std
- NOT YET DOCUMENTEDpublic void updateDisplayControls(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
request
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic void updateStandardsDisplay(java.lang.String displayContent) throws java.lang.Exception
updateStandardsDisplay
in interface SuggestionServiceHelper
displayContent
- Description of the Parameterjava.lang.Exception
- NOT YET DOCUMENTEDpublic void displaySuggestions(java.util.List standardsList)
standardsList
- A list of StandardsWrapper instances to display.