Class InputManager
SchemEditValidator).
The request parameters corrsponding to metadata elements contain the xpath
of the element, and are interspersed with other types of request parameters.
The InputManager selects the parameters for metadata elements and creates a
Map of InputField instances, keyed by xpath.
Example of a metadata request parameter:
valueOf(/itemRecord/lifecycle/contributors/contributor_2_/person/nameLast)
- Author:
- ostwald
-
Constructor Summary
ConstructorsConstructorDescriptionInputManager(HttpServletRequest request, MetaDataFramework framework) Constructor for the InputManager object -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckValidValue(InputField inputField) Validates the value for a given InputField against its dataType.voiddestroy()Description of the MethodvoidDebugging method to display all request parametersvoidDisplays the InputFields corresponding to metadata fields that are Elements.voidDisplays the InputFields corresponding to metadata fields that are Attributes.voidDisplays the InputFields corresponding to metadata fields that are Elements.voidDisplays the InputFields corresponding to metadata fields that are Elements.voidDisplays the InputFields corresponding to metadata fields that allow for multiple values (for debugging).Gets the anyTypeFields attribute of the InputManager objectSelects the InputFields corresponding to metadata Attributes.static booleangetDebug()Selects the InputFields corresponding to metadata Elements.Gets the entityErrorFields managed by this InputManagerstatic StringgetIndexedParamName(String paramName, int index) Creates a parameterName with an index for use in processing multivalue fields, which in the request, have several values for a given path.getInputField(String paramName) Gets the inputField for the given paramGet the InputField instances managed by this InputManagerSelects the InputFields corresponding to metadata fields that allow for multiple values.Gets the schemaHelper attribute of the InputManager objectgetSchemaNode(String paramName) Gets the schemaNode corresponding to the xpath contained in the provided paramName.protected ListGet the url schema paths for this framework configuration.booleanhasSchemaNode(String paramName) Filters request parameters holding field data from other request parameters.static StringparamNameToNormalizedXPath(String paramName) Extracts an xpath from a request parameter name, and normalizes it to remove all indexing information.static StringparamNameToXPath(String paramName) Extracts the xpath portion of a paramName and decodes the xpath by converting indexing information from javscript to xpath forms.voidremoveAnyTypeFields(List fieldsToRemove, DocMap docMap) Remove specified Anytype fields from the managedFields of this inputManager and also from the instanceDocument.protected ReferenceResolver.ResolverResultsresolveReferences(String fieldValue) Identifies entity references and attempts to resolve themstatic voidsetDebug(boolean bool) static StringstripFunctionCall(String paramName) Strips the function call from a request parameter name, leaving a xpath.toString()NOT YET DOCUMENTED
-
Constructor Details
-
InputManager
Constructor for the InputManager object- Parameters:
request- Description of the Parameterframework- Description of the Parameter
-
-
Method Details
-
getInputField
Gets the inputField for the given param- Parameters:
paramName- NOT YET DOCUMENTED- Returns:
- The inputField value
-
getUrlSchemaPaths
Get the url schema paths for this framework configuration.- Returns:
- A list of xpaths (never null)
-
getInputFields
Get the InputField instances managed by this InputManager- Returns:
- The inputFields value
-
getEntityErrorFields
Gets the entityErrorFields managed by this InputManager- Returns:
- The entityErrorFields value
-
getSchemaNode
Gets the schemaNode corresponding to the xpath contained in the provided paramName.- Parameters:
paramName- request parameter supplied by the Request object- Returns:
- The schemaNode value
-
getSchemaHelper
Gets the schemaHelper attribute of the InputManager object- Returns:
- The schemaHelper value
-
checkValidValue
Validates the value for a given InputField against its dataType.The work is done by
SchemaHelper.checkValidValue(String,String), which is called with information extracted from the InputField parameter.- Parameters:
inputField- Description of the Parameter- Returns:
- true if the inputField contains a valid value
- Throws:
Exception- Contains error message if value is not valid
-
hasSchemaNode
Filters request parameters holding field data from other request parameters.- Parameters:
paramName- paramName in the request that may correspond to a metadata field- Returns:
- true if paramName corresponds to an entry in the SchemaNodeMap
-
paramNameToNormalizedXPath
Extracts an xpath from a request parameter name, and normalizes it to remove all indexing information.For example, the following parameter name of:
- valueOf(/itemRecord/lifecycle/contributors/contributor_2_/person/nameLast)
- /itemRecord/lifecycle/contributors/contributor/person/nameLast
- Parameters:
paramName- Description of the Parameter- Returns:
- A schema-normalized xpath (that can access a schemaNode)
-
getIndexedParamName
Creates a parameterName with an index for use in processing multivalue fields, which in the request, have several values for a given path.This method creates an individual, indexed path for each value. For example, if there were several values for the paramName of
- enumerationValuesOf(/itemRecord/general/subjects/subject)
- enumerationValuesOf(/itemRecord/general/subjects/subject[1])
- Parameters:
paramName- Description of the Parameterindex- Description of the Parameter- Returns:
- Description of the Return Value
-
paramNameToXPath
Extracts the xpath portion of a paramName and decodes the xpath by converting indexing information from javscript to xpath forms.For example, for a paramName of
- valueOf(/itemRecord/metaMetadata/contributors/contributor_2_/@date)
- itemRecord/metaMetadata/contributors/contributor[2]/@date
- Parameters:
paramName- Description of the Parameter- Returns:
- Description of the Return Value
-
stripFunctionCall
Strips the function call from a request parameter name, leaving a xpath.Request parameters corresponding to Input fields are of the form: function(xpath). Applying stripFunctionCall to "function(xpath)" yeilds xpath.
- Parameters:
paramName- Description of the Parameter- Returns:
- Description of the Return Value
-
getAttributeFields
Selects the InputFields corresponding to metadata Attributes.- Returns:
- The attributes value
-
getAnyTypeFields
Gets the anyTypeFields attribute of the InputManager object- Returns:
- The anyTypeFields value
-
getElementFields
Selects the InputFields corresponding to metadata Elements.- Returns:
- The elements value
-
getMultiValueFields
Selects the InputFields corresponding to metadata fields that allow for multiple values.- Returns:
- The multiValueFields value
-
removeAnyTypeFields
Remove specified Anytype fields from the managedFields of this inputManager and also from the instanceDocument.Note: updates inputField xpath indexing as appropriate after fields have been removed from the instance doc.
- Parameters:
fieldsToRemove- list of InputField instancesdocMap- provides access to instanceDocument
-
resolveReferences
Identifies entity references and attempts to resolve them- Parameters:
fieldValue- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
displayAttributeFields
public void displayAttributeFields()Displays the InputFields corresponding to metadata fields that are Attributes. -
displayElementFields
public void displayElementFields()Displays the InputFields corresponding to metadata fields that are Elements. -
displayAnyTypeFields
public void displayAnyTypeFields()Displays the InputFields corresponding to metadata fields that are Elements. -
displayEntityErrorFields
public void displayEntityErrorFields()Displays the InputFields corresponding to metadata fields that are Elements. -
displayMultiValueFields
public void displayMultiValueFields()Displays the InputFields corresponding to metadata fields that allow for multiple values (for debugging). -
displayAllParams
public void displayAllParams()Debugging method to display all request parameters -
toString
NOT YET DOCUMENTED -
destroy
public void destroy()Description of the Method -
setDebug
public static void setDebug(boolean bool) -
getDebug
public static boolean getDebug()
-