|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.input.InputManager
public class InputManager
Aids metadata editor in processing of requests, and more specifically in
processing (incl. validating) metadata field values as they are passed in
the Request object (see 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 Summary | |
---|---|
InputManager(HttpServletRequest request,
MetaDataFramework framework)
Constructor for the InputManager object |
Method Summary | |
---|---|
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). |
List |
getAnyTypeFields()
Gets the anyTypeFields attribute of the InputManager object |
List |
getAttributeFields()
Selects the InputFields corresponding to metadata Attributes. |
static boolean |
getDebug()
|
List |
getElementFields()
Selects the InputFields corresponding to metadata Elements. |
List |
getEntityErrorFields()
Gets the entityErrorFields managed by this InputManager |
static String |
getIndexedParamName(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(String paramName)
Gets the inputField for the given param |
Collection |
getInputFields()
Get the InputField instances managed by this InputManager |
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(String paramName)
Gets the schemaNode corresponding to the xpath contained in the provided paramName. |
protected List |
getUrlSchemaPaths()
Get the url schema paths for this framework configuration. |
boolean |
hasSchemaNode(String paramName)
Filters request parameters holding field data from other request parameters. |
static String |
paramNameToNormalizedXPath(String paramName)
Extracts an xpath from a request parameter name, and normalizes it to remove all indexing information. |
static String |
paramNameToXPath(String paramName)
Extracts the xpath portion of a paramName and decodes the xpath by converting indexing information from javscript to xpath forms. |
void |
removeAnyTypeFields(List fieldsToRemove,
DocMap docMap)
Remove specified Anytype fields from the managedFields of this inputManager and also from the instanceDocument. |
protected ReferenceResolver.ResolverResults |
resolveReferences(String fieldValue)
Identifies entity references and attempts to resolve them |
static void |
setDebug(boolean bool)
|
static String |
stripFunctionCall(String paramName)
Strips the function call from a request parameter name, leaving a xpath. |
String |
toString()
NOT YET DOCUMENTED |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InputManager(HttpServletRequest request, MetaDataFramework framework)
request
- Description of the Parameterframework
- Description of the ParameterMethod Detail |
---|
public InputField getInputField(String paramName)
paramName
- NOT YET DOCUMENTED
protected List getUrlSchemaPaths()
public Collection getInputFields()
public List getEntityErrorFields()
public SchemaNode getSchemaNode(String paramName)
paramName
- request parameter supplied by the Request object
public SchemaHelper getSchemaHelper()
public boolean checkValidValue(InputField inputField) throws Exception
The work is done by SchemaHelper.checkValidValue(String,String)
,
which is called with information extracted from the InputField parameter.
inputField
- Description of the Parameter
Exception
- Contains error message if value is not validpublic boolean hasSchemaNode(String paramName)
paramName
- paramName in the request that may correspond to a metadata
field
public static String paramNameToNormalizedXPath(String paramName)
For example, the following parameter name of:
paramName
- Description of the Parameter
public static String getIndexedParamName(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 Parameter
public static String paramNameToXPath(String paramName)
For example, for a paramName of
paramName
- Description of the Parameter
public static String stripFunctionCall(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 Parameter
public List getAttributeFields()
public List getAnyTypeFields()
public List getElementFields()
public List getMultiValueFields()
public void removeAnyTypeFields(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(String fieldValue)
fieldValue
- NOT YET DOCUMENTED
public void displayAttributeFields()
public void displayElementFields()
public void displayAnyTypeFields()
public void displayEntityErrorFields()
public void displayMultiValueFields()
public void displayAllParams()
public String toString()
toString
in class Object
public void destroy()
public static void setDebug(boolean bool)
public static boolean getDebug()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |