WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:WebFormProcess
Description:Accessor to perform the process of form generation, validation and execution.
Id:core:web:WebFormProcess
Category:accessor
Identifier Syntax

WebFormProcess is an accessor using Active URI syntax with the following base identifiers:

Base
active:webFormProcess

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
formState
Mandatory
Representation (java.lang.Object)(no description available)
formGeneratorID
Mandatory
Representation (java.lang.Object)(no description available)
formValidatorID
Mandatory
Representation (java.lang.Object)(no description available)
formActionID
Mandatory
Representation (java.lang.Object)(no description available)
validateItem
Optional
Representation (java.lang.Object)(no description available)
error
Optional
Representation (java.lang.Object)(no description available)
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use WebFormProcess accessor you must import the module urn:org:netkernel:web:core:

<import>
  <uri>urn:org:netkernel:web:core</uri>
</import>

The WebFormProcess endpoint provides a general HTML form processing workflow engine. The engine coordinates the following steps:

  1. Form (Re-)Generation
  2. Form Submission Validation
  3. Form Action.

Each step is specified by an endpoint identifier which will be invoked by the WebFormProrcess engine with Form state, Error State and Validity state as appropriate.

The "Form Action" endpoint is only invoked when the "FormValidation" endpoint returns a Boolean true - otherwise the engine repeatedly requests and returns generated form state to the requestor.

Details to be documented

In the meantime for an example of use see urn:org:netkernel:package:app

Example Spacial Configuration

The following module definition shows the general relationship between the WebFormProcess engine and the various services it calls. In particular it shows the grammars that the invoked endpoints must have...

<module version="2.0">
  <meta>
    <identity>
      <uri>urn:org:ten60:module:template:web:form</uri>
      <version>1.0.0</version>
    </identity>
    <info>
      <name>Template Module / Web Form Application</name>
      <description>A template for a form processing web application project</description>
    </info>
  </meta>
  <system>
    <dynamic />
  </system>
  <rootspace name="Template Form Processing" public="true">
    <overlay>
      <prototype>ExceptionHandler</prototype>
      <space>
        <mapper>
          <config>
            <endpoint>
              <grammar>
                <group>res:/form/
                  <optional>+error@
                    <group name="error" encoding="active">
                      <regex type="active-escaped-uri-loose" />
                    </group>
                  </optional>
                </group>
              </grammar>
              <request>
                <identifier>meta:WebFormProcess</identifier>
                <argument name="formState">httpRequest:/params</argument>
                <argument name="formGeneratorID">exampleFormGenerator</argument>
                <argument name="formValidatorID">exampleFormValidator</argument>
                <argument name="formActionID">exampleFormAction</argument>
                <argument name="validateItem">arg:validateItem</argument>
                <argument name="error">arg:error</argument>
              </request>
            </endpoint>
            <endpoint id="exampleFormGenerator">
              <id>exampleFormGenerator</id>
              <grammar>
                <active>
                  <identifier>active:exampleFormGenerator</identifier>
                  <argument name="formState" min="1" max="1" />
                  <argument name="validationState" min="0" max="1" />
                  <argument name="errorState" min="0" max="1" />
                </active>
              </grammar>
              <request>
                <identifier>meta:GroovyRuntime</identifier>
                <argument name="operator">res:/scripts/formGenerator.gy</argument>
                <argument name="formState">arg:formState</argument>
                <argument name="validationState">arg:validationState</argument>
                <argument name="errorState">arg:errorState</argument>
              </request>
            </endpoint>
            <endpoint id="packagerFormValidator">
              <id>exampleFormValidator</id>
              <grammar>
                <active>
                  <identifier>active:exampleFormValidator</identifier>
                  <argument name="formState" min="1" max="1" />
                </active>
              </grammar>
              <request>
                <identifier>meta:GroovyRuntime</identifier>
                <argument name="operator">res:/scripts/formValidator.gy</argument>
                <argument name="formState">arg:formState</argument>
              </request>
            </endpoint>
            <endpoint>
              <id>exampleFormAction</id>
              <grammar>
                <active>
                  <identifier>active:exampleFormAction</identifier>
                  <argument name="formState" min="1" max="1" />
                </active>
              </grammar>
              <request>
                <identifier>meta:GroovyRuntime</identifier>
                <argument name="operator">res:/scripts/formAction.gy</argument>
                <argument name="formState">arg:formState</argument>
              </request>
            </endpoint>
            <endpoint>
              <id>defaultExceptionHandler</id>
              <grammar>
                <active>
                  <identifier>active:defaultExceptionHandler</identifier>
                  <argument name="failedRequest" min="1" />
                  <argument name="exception" min="1" />
                  <argument name="handler" min="1" />
                </active>
              </grammar>
              <request>
                <identifier>meta:GroovyRuntime</identifier>
                <argument name="operator">res:/scripts/defaultExceptionHandler.gy</argument>
                <argument name="failedRequest">arg:failedRequest</argument>
                <argument name="exception">arg:exception</argument>
                <argument name="handler">arg:handler</argument>
              </request>
            </endpoint>
          </config>
          <space>
            <import>
              <uri>urn:org:netkernel:web:core</uri>
            </import>
            <import>
              <uri>urn:org:netkernel:lang:groovy</uri>
            </import>
            <fileset>
              <glob>scripts/*</glob>
            </fileset>
          </space>
        </mapper>
      </space>
    </overlay>
    <fileset>
      <private />
      <glob>etc/ExceptionHandlerConfig.xml</glob>
    </fileset>
    <import>
      <private />
      <uri>urn:org:netkernel:ext:layer1</uri>
    </import>
  </rootspace>
</module>