Package org.dlese.dpc.vocab
Class MetadataVocabOPML
java.lang.Object
org.dlese.dpc.vocab.MetadataVocabOPML
- All Implemented Interfaces:
Serializable,MetadataVocab,ContentHandler
MetadataVocabOPML is an implementation of MetadataVocab that uses an OPML-based framework to provide a set of methods for accessing mappings between metadata vocabulary encoded IDs and their term names, as well as rendering groups of controlled vocabularies in a variety of ways (such as simple HTML checkboxes, or dHTML flyouts).
UI renderings and mapping lookups are keyed in one of two ways:
- metaFormat, version (encoded ID <--> term name mappings)
- audiene, language, metaFormat, version (UI renderings and label lookups)
NOTE: the version parameter is optional, as most methods have a version that does not take it. In these instances, the current , or most recently loaded version is assumed.
Instances of this class are loaded via LoadMetadataOPML and are placed into application scope via MetadataVocabServlet as an attribute named according to the context parameter "metadataVocabInstanceAttributeName".- Author:
- Ryan Deardorff
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetadataVocabOPML(boolean debug, String loaderFile, ServletContext servletContext) Constructor for the MetadataVocabOPML object -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to the Error attribute of the MetadataVocabOPML objectvoidaddMessage(String msg) Adds a feature to the Message attribute of the MetadataVocabOPML objectvoidcharacters(char[] ch, int start, int length) (SAX) Element data (characters between tags)voidInvoked when all OPML files have been loadedvoid(SAX) Invoked at the end of parsing.voidendElement(String namespaceURI, String lName, String qName) (SAX) Invoked upon closing tag of an XML elementvoidendPrefixMapping(String prefix) (SAX) Required by SAX, but not used hereerrorDisplay(String err, String method) Display vocab error as HTMLfindVocabNode(String system, String fieldName, String valueName) Description of the MethodgetCacheValuesInOrder(String system, String group, Map cache) Gets the cacheValuesInOrder attribute of the MetadataVocabOPML objectorg.dlese.dpc.gui.OPMLTreeGets the currentTree attribute of the MetadataVocabOPML objectgetCurrentVersion(String metaFormat) Get the most recently loaded metadata format version numberstatic StringReturn a string for the current time and date, sutiable for display in log files and output to standout:getDescription(org.dlese.dpc.gui.OPMLTree.TreeNode node, PageContext page) Gets the description from HTTP request of SRC URLGets the errors attribute of the MetadataUIManager objectgetFieldSystemId(String field) Gets the encoded field Id of the given metadata fieldbooleangetFieldValueIdPairExists(String fieldId, String valueId) Does a vocabulary definition exist for the given encoded FIELD + VALUE IDs?getFieldValueSystemId(String field, String value) Gets the encoded value Id of the given metadata field/value pairgetFilenameOfFieldPath(String format, String version, String audience, String language, String fieldPath) Physical filename of the OPML that loaded the given vocabulary field XPathGets the messages attribute of the MetadataVocabOPML objectgetMetaFormatOfField(String field) Gets the metaFormatOfField attribute of the MetadataVocabOPML objectgetMetaNameOfId(String system, String fieldId, String valueId) Deprecated.As of MetadataUI v1.0, replaced by getTranslatedValue OR getTranslatedFieldgetNameFromPath(String fieldPath) Gets the vocab field name by clipping from the end of a full xpathorg.dlese.dpc.gui.OPMLTreeGets the newTree attribute of the MetadataVocabOPML objectgetNodeId(org.dlese.dpc.gui.OPMLTree.TreeNode node) Gets the nodeId attribute of the MetadataVocabOPML objectGets the OPML for a given format/audience/language using the current or most recently loaded version without the XML declaration taggetOPML(String metaFormat, String audience, String language, String field, boolean includeXmlDeclaration) Gets the OPML for a given format/audience/language using the current or most recently loaded versionGets the OPML for a given format/version/audience/language without the XML declaration taggetOPML(String metaFormat, String metaVersion, String audience, String language, String field, boolean includeXmlDeclaration) Gets the OPML for a given format/version/audience/languagegetResponseOPML(PageContext context) Gets the re-ordered/grouped/labeled OPML tree of metadata values from the cache created by setResponseGroup()getTopLevelAbbrevLabelOf(String system, String metadataField, String systemFieldId, String systemValueId) Gets the topLevelAbbrevLabelOf attribute of the MetadataVocab objectgetTranslatedField(String metaFormat, String field) Gets the translated FIELD NAME/ID of the given FIELD NAME/ID using the current or most recently loaded metadata format version numbergetTranslatedField(String metaFormat, String metaVersion, String field) Gets the translated FIELD NAME/ID of the given FIELD NAME/IDgetTranslatedFieldPath(String metaFormat, String field) Gets the translated FIELD XPATH of the given FIELD+VALUE NAMES/IDS using the current or most recently loaded metadata format version numbergetTranslatedFieldPath(String metaFormat, String metaVersion, String field) Gets the translated FIELD XPATH of the given FIELD+VALUE NAMES/IDSgetTranslatedValue(String metaFormat, String field, String value) Gets the translated VALUE NAME/ID of the given FIELD+VALUE NAMES/IDS using the current or most recently loaded metadata format version numbergetTranslatedValue(String metaFormat, String metaVersion, String field, String value) Gets the translated VALUE NAME/ID of the given FIELD+VALUE NAMES/IDSgetUiFieldLabel(String audience, String language, String field, boolean abbrev) Gets the uiFieldLabel attribute of the MetadataVocabOPML objectgetUiFieldLabel(String metaFormat, String audience, String language, String field, boolean abbrev) Gets the UI label associated with the given FIELD NAME/ID, using the current or most recently loaded metadata format version numbergetUiFieldLabel(String metaFormat, String metaVersion, String audience, String language, String field) Gets the non-abbreviated UI label associated with the given FIELD NAME/IDgetUiFieldLabel(String metaFormat, String metaVersion, String audience, String language, String field, boolean abbrev) Gets the UI label associated with the given FIELD NAME/IDgetUiLabelOf(String system, String metadataField, String metadataValue) Gets the uiLabelOf attribute of the MetadataVocabOPML objectgetUiLabelOf(String system, String metadataField, String metadataValue, boolean abbreviated) Gets the UI label of the given metadata field/value pairgetUiLabelOfFieldId(String fieldId) Gets the uiLabelOfFieldId attribute of the MetadataVocabOPML objectgetUiLabelOfSystemIds(String system, String systemFieldId, String systemValueId) Gets the full (non-abbreviated) UI label of the given encoded field/value Id pairgetUiLabelOfSystemIds(String system, String systemFieldId, String systemValueId, boolean abbreviated) Gets the UI label of the given encoded field/value Id pairGets the "display" attribute value for the given field/value vocab using the CURRENT metadata framework versiongetUiValueDisplay(String metaFormat, String metaVersion, String audience, String language, String field, String value) Gets the "display" attribute value for the given field/value vocabgetUiValueLabel(String audience, String language, String field, String value, boolean abbrev) Gets the uiValueLabel attribute of the MetadataVocabOPML objectgetUiValueLabel(String metaFormat, String audience, String language, String field, String value, boolean abbrev) Gets the UI label associated with the given FIELD+VALUE NAMES/IDS, using the current or most recently loaded metadata format version numbergetUiValueLabel(String metaFormat, String metaVersion, String audience, String language, String field, String value) Gets the non-abbreviated UI label associated with the given FIELD+VALUE NAMES/IDSgetUiValueLabel(String metaFormat, String metaVersion, String audience, String language, String field, String value, boolean abbrev) Gets the UI label associated with the given FIELD+VALUE NAMES/IDSgetVocabCheckbox(String groupTop, String value, String label, MetadataVocabInputState inputState) Returns a SINGLE HTML CHECKBOX input of the specified part of the vocabulary.getVocabCheckboxes(String system, String group, int size, String tdWidth, boolean skipTopRow, MetadataVocabInputState inputState) Returns an HTML TABLE of CHECKBOX inputs of the specified part of the vocabulary.Gets the vocabFieldIds attribute of the MetadataVocab objectGets the vocabFieldPaths attribute of the MetadataVocabOPML objectgetVocabHiddenInputs(String system, String group, MetadataVocabInputState inputState) Generates HTML HIDDEN inputs of the specified part of the vocabulary.getVocabNode(String metaFormat, String audience, String language, String fieldName, String valueName) Gets the vocabNode attribute of the MetadataVocabOPML objectgetVocabNode(String metaFormat, String metaVersion, String audience, String language, String fieldName, String valueName) Gets a VocabNode for the given field/value pairgetVocabNodes(String system, String group) Gets the vocabNodes attribute of the MetadataVocabOPML objectgetVocabNodes(String metaFormat, String audience, String language, String field) Gets the vocabNodes attribute of the MetadataVocab objectGets the vocabNodes attribute of the MetadataVocabOPML objectgetVocabSelectList(String system, String group, int size, MetadataVocabInputState inputState) Returns an HTML SELECT list of the specified part of the vocabulary.Gets the vocabSystemInterfaces attribute of the MetadataUIManager objectgetVocabTreeMenu(String system, String language, String group, PageContext page) Generates a Javascript Tree Menu (collapsable hierarchy) of the specified part of the vocabularybooleanDoes the given field/value pair (in the CURRENT version of the given framework) exist in this MetadataVocab instance?booleanDoes the given field/value pair exist in this MetadataVocab instance?voidignorableWhitespace(char[] ch, int start, int length) (SAX) Reports any whitespace that is ignored because it falls outside of the DTD or schema definition--usefull for re-generating the file with indents intact.voidprocessingInstruction(String target, String data) (SAX) Required by SAX, but not used herevoidreportError(String err) Log an errorvoidreportMessage(String msg) Log a messagesetCurrentTree(String key) Sets the currentTree OPMLTree using the system info.setCurrentTree(String key, String subGroup) Sets currentTree using its key (framework/version/audience/language/id)voidsetDocumentLocator(Locator locator) (SAX) Sets the SAX locator, which indicates the current position of the parser within the document (line number, column number).voidsetResponseGroup(PageContext context, String metaFormat, String audience, String language, String field) Initiate the re-ordering/grouping/labeling of a flat list of metadata values in a search response (Services or otherwise) by indicating an audience grouping (OPML tree) sans versionvoidsetResponseGroup(PageContext context, String metaFormat, String metaVersion, String audience, String language, String field) Initiate the re-ordering/grouping/labeling of a flat list of metadata values in a search response (Services or otherwise) by indicating an audience grouping (OPML tree)voidsetResponseList(String[] values, PageContext context) Adds an ArrayList of metadata values to the re-ordering/grouping/labeling cachevoidsetResponseList(ArrayList values, PageContext context) Adds an ArrayList of metadata values to the re-ordering/grouping/labeling cachevoidsetResponseValue(String value, PageContext context) Adds a single metadata value to the re-ordering/grouping/labeling cachevoidsetTreeKey(String key) Sets the treeKey attribute of the MetadataVocabOPML objectvoidskippedEntity(String name) (SAX) Required by SAX, but not used herevoid(SAX) Invoked at the start of any document parsevoidstartElement(String namespaceURI, String lName, String qName, Attributes atts) (SAX) Invoked upon opening tag of an XML elementvoidstartPrefixMapping(String prefix, String uri) (SAX) Required by SAX, but not used hereMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
OPML_VERSION
- See Also:
-
OPML_GROUPS_NAMESPACE
- See Also:
-
OPML_NAMESPACE_PREFIX
- See Also:
-
-
Constructor Details
-
MetadataVocabOPML
Constructor for the MetadataVocabOPML object- Parameters:
debug-loaderFile-servletContext-
-
-
Method Details
-
getCurrentTree
public org.dlese.dpc.gui.OPMLTree getCurrentTree()Gets the currentTree attribute of the MetadataVocabOPML object- Returns:
- The currentTree value
-
setCurrentTree
Sets currentTree using its key (framework/version/audience/language/id)- Parameters:
key- system (framework/version/audience/language/id) keysubGroup- The new currentTree value- Returns:
- String containing just the metadata id
-
setCurrentTree
Sets the currentTree OPMLTree using the system info.- Parameters:
key- system (framework/version/audience/language/id) key- Returns:
- metadata id
-
getNewTree
public org.dlese.dpc.gui.OPMLTree getNewTree()Gets the newTree attribute of the MetadataVocabOPML object- Returns:
- The newTree value
-
setTreeKey
Sets the treeKey attribute of the MetadataVocabOPML object- Parameters:
key- The new treeKey value
-
addError
Adds a feature to the Error attribute of the MetadataVocabOPML object- Specified by:
addErrorin interfaceMetadataVocab- Parameters:
err- The feature to be added to the Error attribute
-
addMessage
Adds a feature to the Message attribute of the MetadataVocabOPML object- Specified by:
addMessagein interfaceMetadataVocab- Parameters:
msg- The feature to be added to the Message attribute
-
getErrors
Gets the errors attribute of the MetadataUIManager object- Specified by:
getErrorsin interfaceMetadataVocab- Returns:
- The errors value
-
getVocabSystemInterfaces
Gets the vocabSystemInterfaces attribute of the MetadataUIManager object- Specified by:
getVocabSystemInterfacesin interfaceMetadataVocab- Returns:
- The vocabSystemInterfaces value
-
getMetaNameOfId
Deprecated.As of MetadataUI v1.0, replaced by getTranslatedValue OR getTranslatedFieldGets the metadata value or field name of the given encoded field and value Ids. Pass "" (empty string) for valueId to have it return the metadata field name (instead of value).- Specified by:
getMetaNameOfIdin interfaceMetadataVocab- Parameters:
system- Vocabulary framework/version/audience/language, i.e. "adn/0.6.50/community/en-us"fieldId- Encoded vocabulary field IdvalueId- Encoded vocabulary value Id- Returns:
- The metaNameOfId value
- See Also:
-
getFieldValueIdPairExists
Does a vocabulary definition exist for the given encoded FIELD + VALUE IDs?- Specified by:
getFieldValueIdPairExistsin interfaceMetadataVocab- Parameters:
fieldId- Encoded vocabulary field IdvalueId- Encoded vocabulary value Id- Returns:
- The fieldValueIdPairExists value
-
getFieldValueSystemId
Gets the encoded value Id of the given metadata field/value pair- Specified by:
getFieldValueSystemIdin interfaceMetadataVocab- Parameters:
field- Metadata field namevalue- Metadata value name- Returns:
- The encoded value Id
- Throws:
Exception
-
getFieldSystemId
Gets the encoded field Id of the given metadata field- Specified by:
getFieldSystemIdin interfaceMetadataVocab- Parameters:
field- Metadata field name- Returns:
- The encoded field Id
- Throws:
Exception
-
getFilenameOfFieldPath
public String getFilenameOfFieldPath(String format, String version, String audience, String language, String fieldPath) Physical filename of the OPML that loaded the given vocabulary field XPath- Parameters:
format-version-audience-language-fieldPath- field XPath- Returns:
- XML filename
-
getUiLabelOf
public String getUiLabelOf(String system, String metadataField, String metadataValue, boolean abbreviated) Gets the UI label of the given metadata field/value pair- Specified by:
getUiLabelOfin interfaceMetadataVocab- Parameters:
system- Vocabulary framework/version/audience/language key, i.e. "adn/0.6.50/community/en-us"metadataField- Metadata field namemetadataValue- Metadata value nameabbreviated- Return the abbreviated form of the UI label?- Returns:
- The user interface label associated with the given vocabulary value
-
getTopLevelAbbrevLabelOf
public String getTopLevelAbbrevLabelOf(String system, String metadataField, String systemFieldId, String systemValueId) Gets the topLevelAbbrevLabelOf attribute of the MetadataVocab object- Specified by:
getTopLevelAbbrevLabelOfin interfaceMetadataVocab- Parameters:
system-metadataField-systemFieldId-systemValueId-- Returns:
- The topLevelAbbrevLabelOf value
-
getVocabNodes
Gets the vocabNodes attribute of the MetadataVocab object- Specified by:
getVocabNodesin interfaceMetadataVocab- Parameters:
metaFormat-audience-language-field-- Returns:
- The vocabNodes value
-
getVocabNodes
public ArrayList getVocabNodes(String metaFormat, String audience, String language, String field, String group) Gets the vocabNodes attribute of the MetadataVocabOPML object- Specified by:
getVocabNodesin interfaceMetadataVocab- Parameters:
metaFormat-audience-language-field-group-- Returns:
- The vocabNodes value
-
getVocabNodes
Gets the vocabNodes attribute of the MetadataVocabOPML object- Specified by:
getVocabNodesin interfaceMetadataVocab- Parameters:
system-group-- Returns:
- The vocabNodes value
-
getVocabSelectList
public String getVocabSelectList(String system, String group, int size, MetadataVocabInputState inputState) Returns an HTML SELECT list of the specified part of the vocabulary.- Specified by:
getVocabSelectListin interfaceMetadataVocab- Parameters:
system-group- colon-seperated specifier of the part of the vocab hierarchy which is to be displayedsize- size (height) of the SELECT listinputState-- Returns:
- The vocabSelectList value
-
getVocabCheckboxes
public String getVocabCheckboxes(String system, String group, int size, String tdWidth, boolean skipTopRow, MetadataVocabInputState inputState) Returns an HTML TABLE of CHECKBOX inputs of the specified part of the vocabulary.- Specified by:
getVocabCheckboxesin interfaceMetadataVocab- Parameters:
system-group- colon-seperated specifier of the part of the vocab hierarchy which is to be displayedsize- how many inputs to display before starting a new column in the tabletdWidth- value inserted into the width param of the TD tagskipTopRow- Should the top row of checkboxes (next to All | Clear) be skipped?inputState-- Returns:
- the HTML code
-
getNodeId
Gets the nodeId attribute of the MetadataVocabOPML object- Parameters:
node-- Returns:
- The nodeId value
-
getVocabCheckbox
public String getVocabCheckbox(String groupTop, String value, String label, MetadataVocabInputState inputState) Returns a SINGLE HTML CHECKBOX input of the specified part of the vocabulary.- Specified by:
getVocabCheckboxin interfaceMetadataVocab- Parameters:
groupTop- Top-level vocab groupvalue- vocab valuelabel- UI labelinputState-- Returns:
- the HTML code
-
getVocabTreeMenu
Generates a Javascript Tree Menu (collapsable hierarchy) of the specified part of the vocabulary- Specified by:
getVocabTreeMenuin interfaceMetadataVocab- Parameters:
system-language-group- colon-seperated specifier of the part of the vocab hierarchy which is to be displayedpage-- Returns:
- the Javascript code defining the menu
-
getVocabHiddenInputs
Generates HTML HIDDEN inputs of the specified part of the vocabulary.- Specified by:
getVocabHiddenInputsin interfaceMetadataVocab- Parameters:
system-group- colon-seperated specifier of the part of the vocab hierarchy which is to be displayedinputState-- Returns:
- the HTML code
-
getMetaFormatOfField
Gets the metaFormatOfField attribute of the MetadataVocabOPML object- Specified by:
getMetaFormatOfFieldin interfaceMetadataVocab- Parameters:
field-- Returns:
- The metaFormatOfField value
-
getVocabFieldIds
Gets the vocabFieldIds attribute of the MetadataVocab object- Specified by:
getVocabFieldIdsin interfaceMetadataVocab- Returns:
- The vocabFieldIds value
-
getVocabFieldPaths
Gets the vocabFieldPaths attribute of the MetadataVocabOPML object- Returns:
- The vocabFieldPaths value
-
doneLoading
public void doneLoading()Invoked when all OPML files have been loaded- Specified by:
doneLoadingin interfaceMetadataVocab
-
getNameFromPath
Gets the vocab field name by clipping from the end of a full xpath- Parameters:
fieldPath-- Returns:
- The nameFromPath value
-
findVocabNode
Description of the Method- Specified by:
findVocabNodein interfaceMetadataVocab- Parameters:
system-fieldName-valueName-- Returns:
-
setDocumentLocator
(SAX) Sets the SAX locator, which indicates the current position of the parser within the document (line number, column number). Could be used to indicate the spot where an error occured.- Specified by:
setDocumentLocatorin interfaceContentHandler- Parameters:
locator- The new saxLocator value
-
startDocument
(SAX) Invoked at the start of any document parse- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
(SAX) Invoked at the end of parsing. Rewrite the definitions XML if new Ids have been assigned.- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String lName, String qName, Attributes atts) throws SAXException (SAX) Invoked upon opening tag of an XML element- Specified by:
startElementin interfaceContentHandler- Parameters:
namespaceURI-lName-qName-atts-- Throws:
SAXException
-
endElement
(SAX) Invoked upon closing tag of an XML element- Specified by:
endElementin interfaceContentHandler- Parameters:
namespaceURI- XML namespacelName- local tag nameqName- fully qualified tag name- Throws:
SAXException
-
characters
(SAX) Element data (characters between tags)- Specified by:
charactersin interfaceContentHandler- Parameters:
ch-start-length-- Throws:
SAXException
-
ignorableWhitespace
(SAX) Reports any whitespace that is ignored because it falls outside of the DTD or schema definition--usefull for re-generating the file with indents intact.- Specified by:
ignorableWhitespacein interfaceContentHandler- Parameters:
ch-start-length-- Throws:
SAXException
-
startPrefixMapping
(SAX) Required by SAX, but not used here- Specified by:
startPrefixMappingin interfaceContentHandler- Parameters:
prefix-uri-- Throws:
SAXException
-
endPrefixMapping
(SAX) Required by SAX, but not used here- Specified by:
endPrefixMappingin interfaceContentHandler- Parameters:
prefix-- Throws:
SAXException
-
processingInstruction
(SAX) Required by SAX, but not used here- Specified by:
processingInstructionin interfaceContentHandler- Parameters:
target-data-- Throws:
SAXException
-
skippedEntity
(SAX) Required by SAX, but not used here- Specified by:
skippedEntityin interfaceContentHandler- Parameters:
name-- Throws:
SAXException
-
errorDisplay
Display vocab error as HTML- Parameters:
err-method-- Returns:
-
getDescription
Gets the description from HTTP request of SRC URL- Parameters:
node-page-- Returns:
- The description value
-
getCurrentVersion
Get the most recently loaded metadata format version number- Specified by:
getCurrentVersionin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")- Returns:
- The current (most recently loaded) version for the given format
-
getVocabNode
public VocabNode getVocabNode(String metaFormat, String metaVersion, String audience, String language, String fieldName, String valueName) Gets a VocabNode for the given field/value pair- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion-audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"fieldName- vocab fieldvalueName- vocab value- Returns:
- VocabNode for the vocab
-
getVocabNode
public VocabNode getVocabNode(String metaFormat, String audience, String language, String fieldName, String valueName) Gets the vocabNode attribute of the MetadataVocabOPML object- Specified by:
getVocabNodein interfaceMetadataVocab- Parameters:
metaFormat-audience-language-fieldName-valueName-- Returns:
- The vocabNode value
-
getTranslatedField
public String getTranslatedField(String metaFormat, String metaVersion, String field) throws Exception Gets the translated FIELD NAME/ID of the given FIELD NAME/ID- Specified by:
getTranslatedFieldin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- The FIELD NAME/ID as translated from input FIELD NAME/ID
- Throws:
Exception
-
getTranslatedField
Gets the translated FIELD NAME/ID of the given FIELD NAME/ID using the current or most recently loaded metadata format version number- Specified by:
getTranslatedFieldin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- The FIELD NAME/ID as translated from input FIELD NAME/ID
- Throws:
Exception
-
getTranslatedFieldPath
public String getTranslatedFieldPath(String metaFormat, String metaVersion, String field) throws Exception Gets the translated FIELD XPATH of the given FIELD+VALUE NAMES/IDS- Specified by:
getTranslatedFieldPathin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- The FIELD XPATH as translated from input FIELD NAME/ID
- Throws:
Exception
-
getTranslatedFieldPath
Gets the translated FIELD XPATH of the given FIELD+VALUE NAMES/IDS using the current or most recently loaded metadata format version number- Specified by:
getTranslatedFieldPathin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- The FIELD XPATH as translated from input FIELD NAME/ID
- Throws:
Exception
-
getTranslatedValue
public String getTranslatedValue(String metaFormat, String metaVersion, String field, String value) throws Exception Gets the translated VALUE NAME/ID of the given FIELD+VALUE NAMES/IDS- Specified by:
getTranslatedValuein interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- The VALUE NAME/ID as translated from input FIELD+VALUE NAMEs/IDs
- Throws:
Exception
-
getTranslatedValue
Gets the translated VALUE NAME/ID of the given FIELD+VALUE NAMES/IDS using the current or most recently loaded metadata format version number- Specified by:
getTranslatedValuein interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- The VALUE NAME/ID as translated from input FIELD+VALUE NAMEs/IDs
- Throws:
Exception
-
hasValue
Does the given field/value pair exist in this MetadataVocab instance?- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- true if it exists
-
hasValue
Does the given field/value pair (in the CURRENT version of the given framework) exist in this MetadataVocab instance?- Parameters:
metaFormat- metadata format (i.e. "adn")field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- true if it exists
-
getUiValueLabel
public String getUiValueLabel(String metaFormat, String metaVersion, String audience, String language, String field, String value, boolean abbrev) Gets the UI label associated with the given FIELD+VALUE NAMES/IDS- Specified by:
getUiValueLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")abbrev- get the abbreviated version of the label?- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiValueLabel
public String getUiValueLabel(String metaFormat, String metaVersion, String audience, String language, String field, String value) Gets the non-abbreviated UI label associated with the given FIELD+VALUE NAMES/IDS- Specified by:
getUiValueLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiValueLabel
public String getUiValueLabel(String metaFormat, String audience, String language, String field, String value, boolean abbrev) Gets the UI label associated with the given FIELD+VALUE NAMES/IDS, using the current or most recently loaded metadata format version number- Specified by:
getUiValueLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")abbrev- get the abbreviated version of the label?- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiValueLabel
public String getUiValueLabel(String audience, String language, String field, String value, boolean abbrev) Gets the uiValueLabel attribute of the MetadataVocabOPML object- Specified by:
getUiValueLabelin interfaceMetadataVocab- Parameters:
audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value-abbrev- return the "textAbbrev" version of the label?- Returns:
- The uiValueLabel value
-
getUiFieldLabel
public String getUiFieldLabel(String metaFormat, String metaVersion, String audience, String language, String field, boolean abbrev) Gets the UI label associated with the given FIELD NAME/ID- Specified by:
getUiFieldLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")abbrev- get the abbreviated version of the label?- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiFieldLabel
public String getUiFieldLabel(String metaFormat, String metaVersion, String audience, String language, String field) Gets the non-abbreviated UI label associated with the given FIELD NAME/ID- Specified by:
getUiFieldLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiFieldLabel
public String getUiFieldLabel(String metaFormat, String audience, String language, String field, boolean abbrev) Gets the UI label associated with the given FIELD NAME/ID, using the current or most recently loaded metadata format version number- Specified by:
getUiFieldLabelin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")abbrev- get the abbreviated version of the label?- Returns:
- The user interface label associated with the given format/version/audience/language value
-
getUiFieldLabel
Gets the uiFieldLabel attribute of the MetadataVocabOPML object- Specified by:
getUiFieldLabelin interfaceMetadataVocab- Parameters:
audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")abbrev- return the "textAbbrev" version of the label?- Returns:
- The uiFieldLabel value
-
getUiValueDisplay
public String getUiValueDisplay(String metaFormat, String metaVersion, String audience, String language, String field, String value) Gets the "display" attribute value for the given field/value vocab- Specified by:
getUiValueDisplayin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- The uiValueDisplay value
-
getUiValueDisplay
public String getUiValueDisplay(String metaFormat, String audience, String language, String field, String value) Gets the "display" attribute value for the given field/value vocab using the CURRENT metadata framework version- Specified by:
getUiValueDisplayin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")- Returns:
- The uiValueDisplay value
-
setResponseGroup
public void setResponseGroup(PageContext context, String metaFormat, String metaVersion, String audience, String language, String field) Initiate the re-ordering/grouping/labeling of a flat list of metadata values in a search response (Services or otherwise) by indicating an audience grouping (OPML tree)- Specified by:
setResponseGroupin interfaceMetadataVocab- Parameters:
context- JSP page contextmetaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- See Also:
-
setResponseGroup
public void setResponseGroup(PageContext context, String metaFormat, String audience, String language, String field) Initiate the re-ordering/grouping/labeling of a flat list of metadata values in a search response (Services or otherwise) by indicating an audience grouping (OPML tree) sans version- Specified by:
setResponseGroupin interfaceMetadataVocab- Parameters:
context- JSP page contextmetaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- See Also:
-
setResponseValue
Adds a single metadata value to the re-ordering/grouping/labeling cache- Specified by:
setResponseValuein interfaceMetadataVocab- Parameters:
value- metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")context- JSP page context- See Also:
-
setResponseList
Adds an ArrayList of metadata values to the re-ordering/grouping/labeling cache- Specified by:
setResponseListin interfaceMetadataVocab- Parameters:
values- List of metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")context- JSP page context- See Also:
-
setResponseList
Adds an ArrayList of metadata values to the re-ordering/grouping/labeling cache- Specified by:
setResponseListin interfaceMetadataVocab- Parameters:
values- List of metadata VALUE encoded ID (i.e. "04") or metadata NAME (i.e. "DLESE:Intermediate elementary")context- JSP page context- See Also:
-
getResponseOPML
Gets the re-ordered/grouped/labeled OPML tree of metadata values from the cache created by setResponseGroup()- Specified by:
getResponseOPMLin interfaceMetadataVocab- Parameters:
context- JSP page context- Returns:
- OPML for the group specified with setResponseGroup() and trimmed to the subset indicated by values passed into setResponse()
- See Also:
-
getOPML
public String getOPML(String metaFormat, String metaVersion, String audience, String language, String field, boolean includeXmlDeclaration) Gets the OPML for a given format/version/audience/language- Specified by:
getOPMLin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")includeXmlDeclaration-- Returns:
- OPML for the given format/audience
-
getOPML
public String getOPML(String metaFormat, String audience, String language, String field, boolean includeXmlDeclaration) Gets the OPML for a given format/audience/language using the current or most recently loaded version- Specified by:
getOPMLin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")includeXmlDeclaration-- Returns:
- OPML for the given format/audience
-
getOPML
public String getOPML(String metaFormat, String metaVersion, String audience, String language, String field) Gets the OPML for a given format/version/audience/language without the XML declaration tag- Specified by:
getOPMLin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")metaVersion- metadata version (i.e. "0.6.50")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- OPML for the given format/audience
-
getOPML
Gets the OPML for a given format/audience/language using the current or most recently loaded version without the XML declaration tag- Specified by:
getOPMLin interfaceMetadataVocab- Parameters:
metaFormat- metadata format (i.e. "adn")audience- UI audience, i.e. "community" or "cataloger"language- UI language, i.e. "en-us"field- metadata FIELD encoded ID (i.e. "gr") or metadata NAME (i.e. "gradeRange")- Returns:
- OPML for the given format/audience
-
getDateStamp
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
reportMessage
Log a message- Specified by:
reportMessagein interfaceMetadataVocab- Parameters:
msg-
-
reportError
Log an error- Specified by:
reportErrorin interfaceMetadataVocab- Parameters:
err-
-
getMessages
Gets the messages attribute of the MetadataVocabOPML object- Specified by:
getMessagesin interfaceMetadataVocab- Returns:
- The messages value
-
getUiLabelOfSystemIds
public String getUiLabelOfSystemIds(String system, String systemFieldId, String systemValueId, boolean abbreviated) Gets the UI label of the given encoded field/value Id pair- Specified by:
getUiLabelOfSystemIdsin interfaceMetadataVocab- Parameters:
system- Vocabulary system/interface/language trio, i.e. "dds.default.en-us"systemFieldId- Encoded field IdsystemValueId- Encoded value Idabbreviated- Return the abbreviated form of the UI label?- Returns:
- The user interface label associated with the given vocabulary value
-
getUiLabelOfSystemIds
Gets the full (non-abbreviated) UI label of the given encoded field/value Id pair- Specified by:
getUiLabelOfSystemIdsin interfaceMetadataVocab- Parameters:
system- Vocabulary system/interface/language trio, i.e. "dds.default.en-us"systemFieldId- Encoded field IdsystemValueId- Encoded value Id- Returns:
- The user interface label associated with the given vocabulary value
-
getUiLabelOfFieldId
Gets the uiLabelOfFieldId attribute of the MetadataVocabOPML object- Specified by:
getUiLabelOfFieldIdin interfaceMetadataVocab- Parameters:
fieldId-- Returns:
- The uiLabelOfFieldId value
-
getUiLabelOf
Gets the uiLabelOf attribute of the MetadataVocabOPML object- Specified by:
getUiLabelOfin interfaceMetadataVocab- Parameters:
system-metadataField-metadataValue-- Returns:
- The uiLabelOf value
-
getCacheValuesInOrder
Gets the cacheValuesInOrder attribute of the MetadataVocabOPML object- Specified by:
getCacheValuesInOrderin interfaceMetadataVocab- Parameters:
system-group-cache-- Returns:
- The cacheValuesInOrder value
-