public class InputManager
extends java.lang.Object
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)
Constructor and Description |
---|
InputManager(javax.servlet.http.HttpServletRequest request,
MetaDataFramework framework)
Constructor for the InputManager object
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkValidValue(InputField inputField)
Validates the value for a given InputField against its dataType.
|
void |
destroy()
Description of the Method
|
void |
displayAllParams()
Debugging method to display all request parameters
|
void |
displayAnyTypeFields()
Displays the InputFields corresponding to metadata fields that are
Elements.
|
void |
displayAttributeFields()
Displays the InputFields corresponding to metadata fields that are
Attributes.
|
void |
displayElementFields()
Displays the InputFields corresponding to metadata fields that are
Elements.
|
void |
displayEntityErrorFields()
Displays the InputFields corresponding to metadata fields that are
Elements.
|
void |
displayMultiValueFields()
Displays the InputFields corresponding to metadata fields that allow for
multiple values (for debugging).
|
java.util.List |
getAnyTypeFields()
Gets the anyTypeFields attribute of the InputManager object
|
java.util.List |
getAttributeFields()
Selects the InputFields corresponding to metadata Attributes.
|
static boolean |
getDebug() |
java.util.List |
getElementFields()
Selects the InputFields corresponding to metadata Elements.
|
java.util.List |
getEntityErrorFields()
Gets the entityErrorFields managed by this InputManager
|
static java.lang.String |
getIndexedParamName(java.lang.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.
|
InputField |
getInputField(java.lang.String paramName)
Gets the inputField for the given param
|
java.util.Collection |
getInputFields()
Get the InputField instances managed by this InputManager
|
java.util.List |
getMultiValueFields()
Selects the InputFields corresponding to metadata fields that allow for
multiple values.
|
SchemaHelper |
getSchemaHelper()
Gets the schemaHelper attribute of the InputManager object
|
SchemaNode |
getSchemaNode(java.lang.String paramName)
Gets the schemaNode corresponding to the xpath contained in the provided
paramName.
|
protected java.util.List |
getUrlSchemaPaths()
Get the url schema paths for this framework configuration.
|
boolean |
hasSchemaNode(java.lang.String paramName)
Filters request parameters holding field data from other request
parameters.
|
static java.lang.String |
paramNameToNormalizedXPath(java.lang.String paramName)
Extracts an xpath from a request parameter name, and normalizes it to
remove all indexing information.
|
static java.lang.String |
paramNameToXPath(java.lang.String paramName)
Extracts the xpath portion of a paramName and decodes the xpath by
converting indexing information from javscript to xpath forms.
|
void |
removeAnyTypeFields(java.util.List fieldsToRemove,
DocMap docMap)
Remove specified Anytype fields from the managedFields of this inputManager
and also from the instanceDocument.
|
protected ReferenceResolver.ResolverResults |
resolveReferences(java.lang.String fieldValue)
Identifies entity references and attempts to resolve them
|
static void |
setDebug(boolean bool) |
static java.lang.String |
stripFunctionCall(java.lang.String paramName)
Strips the function call from a request parameter name, leaving a xpath.
|
java.lang.String |
toString()
NOT YET DOCUMENTED
|
public InputManager(javax.servlet.http.HttpServletRequest request, MetaDataFramework framework)
request
- Description of the Parameterframework
- Description of the Parameterpublic InputField getInputField(java.lang.String paramName)
paramName
- NOT YET DOCUMENTEDprotected java.util.List getUrlSchemaPaths()
public java.util.Collection getInputFields()
public java.util.List getEntityErrorFields()
public SchemaNode getSchemaNode(java.lang.String paramName)
paramName
- request parameter supplied by the Request objectpublic SchemaHelper getSchemaHelper()
public boolean checkValidValue(InputField inputField) throws java.lang.Exception
The work is done by SchemaHelper.checkValidValue(String,String)
,
which is called with information extracted from the InputField parameter.
inputField
- Description of the Parameterjava.lang.Exception
- Contains error message if value is not validpublic boolean hasSchemaNode(java.lang.String paramName)
paramName
- paramName in the request that may correspond to a metadata
fieldpublic static java.lang.String paramNameToNormalizedXPath(java.lang.String paramName)
For example, the following parameter name of:
paramName
- Description of the Parameterpublic static java.lang.String getIndexedParamName(java.lang.String paramName, int index)
This method creates an individual, indexed path for each value. For example, if there were several values for the paramName of
paramName
- Description of the Parameterindex
- Description of the Parameterpublic static java.lang.String paramNameToXPath(java.lang.String paramName)
For example, for a paramName of
paramName
- Description of the Parameterpublic static java.lang.String stripFunctionCall(java.lang.String paramName)
Request parameters corresponding to Input fields are of the form: function(xpath). Applying stripFunctionCall to "function(xpath)" yeilds xpath.
paramName
- Description of the Parameterpublic java.util.List getAttributeFields()
public java.util.List getAnyTypeFields()
public java.util.List getElementFields()
public java.util.List getMultiValueFields()
public void removeAnyTypeFields(java.util.List fieldsToRemove, DocMap docMap)
Note: updates inputField xpath indexing as appropriate after fields have been removed from the instance doc.
fieldsToRemove
- list of InputField instancesdocMap
- provides access to instanceDocumentprotected ReferenceResolver.ResolverResults resolveReferences(java.lang.String fieldValue)
fieldValue
- NOT YET DOCUMENTEDpublic void displayAttributeFields()
public void displayElementFields()
public void displayAnyTypeFields()
public void displayEntityErrorFields()
public void displayMultiValueFields()
public void displayAllParams()
public java.lang.String toString()
toString
in class java.lang.Object
public void destroy()
public static void setDebug(boolean bool)
public static boolean getDebug()