Package com.orchestranetworks.ui

# Interface UIFormRequestContext

public interface UIFormRequestContext
Encapsulates an HTTP request so that a custom form can provide the user input validation context.

Since:
  5.5.0
See Also:
  - `UIForm`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `displayOccurrence(Object aValue, SchemaNode aNode, boolean useLabels)`
  Returns a string for displaying the specified value of the specified node, according to the current locale of this context.
  `Adaptation`
  `getCurrentDataSet()`
  Returns the dataset currently selected.
  `HierarchyNode`
  `getHierarchyNode()`
  Returns current hierarchy node if the current `UIForm` is instantiated in the context of a hierarchy.
  `Locale`
  `getLocale()`
  Returns the current locale of the user session.
  `SchemaNode`
  `getNode(Path aPath)`
  Returns the node located at the specified path.
  `String`
  `getOptionalRequestParameterValue(String aParameterName)`
  Returns the HTTP parameter value in the incoming request.
  `String[]`
  `getOptionalRequestParameterValues(String aParameterName)`
  Returns the HTTP parameter values in the incoming request.
  `Session`
  `getSession()`
  Returns the current session.
  `SchemaNode`
  `getTableNode()`
  Returns the table node to which the form is attached, as specified in the data model.
  `Object`
  `getValue(Path aPath)`
  Returns the value at the specified path.
  `ValueContextForInputValidation`
  `getValueContext(Path aPath)`
  Returns the validation context of the specified node.
  `String`
  `getWebNameFor(String aLocalId)`
  Returns a string that uniquely identifies the entity specified in the context of the current form in the current page.
  `String`
  `getWebNameForPath(Path aPath)`
  Returns a string that uniquely identifies the entity specified in the context of the current form in the current page.
  `boolean`
  `isCreatingRecord()`
  Returns `true` if the form is displayed in the context of a new record creation.
  `boolean`
  `isDuplicatingRecord()`
  Returns `true` if the form is displayed in the context of the duplication of an existing record.

- ## Method Details

  - ### getLocale

    Locale getLocale()
    Returns the current locale of the user session.

  - ### getSession

    Session getSession()
    Returns the current session.

  - ### getHierarchyNode

    HierarchyNode getHierarchyNode()
    Returns current hierarchy node if the current `UIForm` is instantiated in the context of a hierarchy. Returns `null` otherwise.

    This method allows to specialize the look and feel of user interface according to the hierarchy context.

  - ### getValue

    Object getValue(Path aPath)
    Returns the value at the specified path.
    Parameters:
      `aPath` - the location of the target relative to the current node (for maximizing reusability, it is advised to use a relative path)

  - ### getTableNode

    SchemaNode getTableNode()
    Returns the table node to which the form is attached, as specified in the data model.

  - ### getNode

    SchemaNode getNode(Path aPath)
    Returns the node located at the specified path.
    See Also:
      - `SchemaNode.getNode(Path)`

  - ### getWebNameFor

    String getWebNameFor(String aLocalId)
    Returns a string that uniquely identifies the entity specified in the context of the current form in the current page.

  - ### getWebNameForPath

    String getWebNameForPath(Path aPath)
    Returns a string that uniquely identifies the entity specified in the context of the current form in the current page.
    Parameters:
      `aPath` - location of the target relative to the current node (for maximizing reusability, it is advised to use a relative path)

  - ### getValueContext

    ValueContextForInputValidation getValueContext(Path aPath)
    Returns the validation context of the specified node.

  - ### getOptionalRequestParameterValue

    String getOptionalRequestParameterValue(String aParameterName)
    Returns the HTTP parameter value in the incoming request.

  - ### getOptionalRequestParameterValues

    String[] getOptionalRequestParameterValues(String aParameterName)
    Returns the HTTP parameter values in the incoming request.

  - ### displayOccurrence

    String displayOccurrence(Object aValue, SchemaNode aNode, boolean useLabels)
    Returns a string for displaying the specified value of the specified node, according to the current locale of this context.

    The specified value must be related to the specified node.

    See Also:
      - `SchemaNode.displayOccurrence(Object, boolean, ValueContext, Locale)`

  - ### isCreatingRecord

    boolean isCreatingRecord()
    Returns `true` if the form is displayed in the context of a new record creation. In this case, the persistent record does not yet exist.

  - ### isDuplicatingRecord

    boolean isDuplicatingRecord()
    Returns `true` if the form is displayed in the context of the duplication of an existing record. In this case, the target persistent record does not yet exist.

  - ### getCurrentDataSet

    Adaptation getCurrentDataSet()
    Returns the dataset currently selected.