DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.standards.asn
Class AsnCATPlugin

java.lang.Object
  extended by org.dlese.dpc.schemedit.standards.AbstractCATHelperPlugin
      extended by org.dlese.dpc.schemedit.standards.asn.AsnCATPlugin
All Implemented Interfaces:
CATHelperPlugin
Direct Known Subclasses:
EngPathFrameworkPlugin, MastFrameworkPlugin, NcsAnnoFrameworkPlugin, NcsItemFrameworkPlugin

public abstract class AsnCATPlugin
extends AbstractCATHelperPlugin

Abstract class for CATHelperPlugins whose frameworks store ASN identifiers.

These plugins make use of a GradeRangeHelper to map GradeRange vocabs defined in the schema to corresponding CAT API constraints.

Author:
ostwald

Constructor Summary
AsnCATPlugin()
           
 
Method Summary
protected  CATServiceHelper getCatHelper()
          Gets the catHelper attribute of the AsnCATPlugin object
 String getDerivedCATEndGrade()
          Gets the gradeRangeOptionValue corresponding to the highest selected gradeRange in the current instance document.
 String getDerivedCATStartGrade()
          Gets the gradeRangeOptionValue corresponding to the lowest selected gradeRange in the current instance document.
abstract  String getDescriptionPath()
          Gets the descriptionPath for the plugin's framework
protected  String getGradeLevelOptionValue(int i)
          Convert the provided CAT API gradeLevel to the corresponding option value
protected  GradeRangeHelper getGradeRangeHelper()
          Gets the gradeRangeHelper attribute of the AsnCATPlugin object
abstract  List getGradeRangeOptions()
          Gets the gradeRanges corresponding to the grades searchable in the CAT service (and which can be specified in the control box).
abstract  String getGradeRangePath()
          Gets the gradeRangePath attribute of the SuggestionServiceHelper object
abstract  String getKeywordPath()
          Gets the keywordPath for the plugin's framework
abstract  List getOptionalCatUIFields()
          Specifies the fields besides url, description and gradeRanges that a particular framework wants to control via the CAT UI.
 int getSelectedCATEndGrade(String[] gradeConstraints)
          Returns the lesser of the selected gradeLevel constraints selected in the CAT UI (as an integer).
 int getSelectedCATStartGrade(String[] gradeConstraints)
          Returns the greater of the selected gradeLevel constraints selected in the CAT UI (as an integer).
abstract  String getSubjectPath()
          Gets the subjectPath for the plugin's framework
protected abstract  GradeRangeHelper gradeRangeHelperInit()
          Initialize a gradeRangeHelper instance for the gradeRange Vocab values of a specific framework.
static void prtlnErr(String s)
          NOT YET DOCUMENTED
 
Methods inherited from class org.dlese.dpc.schemedit.standards.AbstractCATHelperPlugin
getRecordDescription, getRecordGradeRanges, getRecordKeywords, getRecordSubjects, getRecordSubjects, init, normalizeSubjectValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsnCATPlugin

public AsnCATPlugin()
Method Detail

getCatHelper

protected CATServiceHelper getCatHelper()
Gets the catHelper attribute of the AsnCATPlugin object

Overrides:
getCatHelper in class AbstractCATHelperPlugin
Returns:
The catHelper value

getGradeRangeHelper

protected GradeRangeHelper getGradeRangeHelper()
Gets the gradeRangeHelper attribute of the AsnCATPlugin object

Returns:
The gradeRangeHelper value

gradeRangeHelperInit

protected abstract GradeRangeHelper gradeRangeHelperInit()
Initialize a gradeRangeHelper instance for the gradeRange Vocab values of a specific framework.

Returns:
a gradeRange helper for the gradeRange vocabs
See Also:
GradeRangeHelper

getOptionalCatUIFields

public abstract List getOptionalCatUIFields()
Specifies the fields besides url, description and gradeRanges that a particular framework wants to control via the CAT UI.

For example, some frameworks want to provide controls for the "subject" field. In this case the list returned would contain "subjects"

Specified by:
getOptionalCatUIFields in interface CATHelperPlugin
Overrides:
getOptionalCatUIFields in class AbstractCATHelperPlugin
Returns:
The optionalCatUIFields value

getGradeLevelOptionValue

protected String getGradeLevelOptionValue(int i)
Convert the provided CAT API gradeLevel to the corresponding option value

Parameters:
i - a string representation of the provided int that can be used as a value in the CAT UI
Returns:
The gradeLevelOptionValue, or -1 if the provided value could not be processed as a CAT UI value.

getDerivedCATStartGrade

public String getDerivedCATStartGrade()
Gets the gradeRangeOptionValue corresponding to the lowest selected gradeRange in the current instance document.

NOTE: We have to convert from the lowest gradeRangeVocab to it's gradeRangeOption value

Specified by:
getDerivedCATStartGrade in interface CATHelperPlugin
Specified by:
getDerivedCATStartGrade in class AbstractCATHelperPlugin
Returns:
The startGradeOptionValue value

getDerivedCATEndGrade

public String getDerivedCATEndGrade()
Gets the gradeRangeOptionValue corresponding to the highest selected gradeRange in the current instance document.

NOTE: We return an gradeRangeOptionValue, so we have to convert from the lowest gradeRangeVocab to it's gradeRangeOption value

Specified by:
getDerivedCATEndGrade in interface CATHelperPlugin
Specified by:
getDerivedCATEndGrade in class AbstractCATHelperPlugin
Returns:
The endGrade value

getGradeRangePath

public abstract String getGradeRangePath()
Gets the gradeRangePath attribute of the SuggestionServiceHelper object

Specified by:
getGradeRangePath in class AbstractCATHelperPlugin
Returns:
The gradeRangePath value

getKeywordPath

public abstract String getKeywordPath()
Gets the keywordPath for the plugin's framework

Specified by:
getKeywordPath in class AbstractCATHelperPlugin
Returns:
The keywordPath value

getDescriptionPath

public abstract String getDescriptionPath()
Gets the descriptionPath for the plugin's framework

Specified by:
getDescriptionPath in class AbstractCATHelperPlugin
Returns:
The descriptionPath value

getSubjectPath

public abstract String getSubjectPath()
Gets the subjectPath for the plugin's framework

Specified by:
getSubjectPath in class AbstractCATHelperPlugin
Returns:
The subjectPath value

getSelectedCATStartGrade

public int getSelectedCATStartGrade(String[] gradeConstraints)
Returns the greater of the selected gradeLevel constraints selected in the CAT UI (as an integer).

NOTE: Assumes CAT UI specifies two constraints, and that both can be parsed as integers.

Specified by:
getSelectedCATStartGrade in interface CATHelperPlugin
Specified by:
getSelectedCATStartGrade in class AbstractCATHelperPlugin
Parameters:
gradeConstraints - NOT YET DOCUMENTED
Returns:
The startGrade value

getSelectedCATEndGrade

public int getSelectedCATEndGrade(String[] gradeConstraints)
Returns the lesser of the selected gradeLevel constraints selected in the CAT UI (as an integer).

NOTE: Assumes CAT UI specifies two constraints, and that both can be parsed as integers.

Specified by:
getSelectedCATEndGrade in interface CATHelperPlugin
Specified by:
getSelectedCATEndGrade in class AbstractCATHelperPlugin
Parameters:
gradeConstraints - NOT YET DOCUMENTED
Returns:
The endGrade value

getGradeRangeOptions

public abstract List getGradeRangeOptions()
Gets the gradeRanges corresponding to the grades searchable in the CAT service (and which can be specified in the control box).

NOTE: the "values" should correspond to what the service expects, while the "labels" are human-meaningful representations of the values. E.g., one member of the gradeRangeOption list might be (value: "1", label: "1st Grade")

Specified by:
getGradeRangeOptions in interface CATHelperPlugin
Specified by:
getGradeRangeOptions in class AbstractCATHelperPlugin
Returns:
The gradeRanges value

prtlnErr

public static void prtlnErr(String s)
NOT YET DOCUMENTED

Parameters:
s - NOT YET DOCUMENTED

DLESE Tools
v1.6.0