Orbeon Forms
  • Getting started
  • Installation
    • Logging
    • Configuration banner
    • Docker
    • Azure
    • Tomcat
    • WildFly
    • WebSphere
    • WebLogic
    • GlassFish
    • Caches
    • Replication
    • Upgrading
  • Configuration
    • Properties
      • General
        • HTTP client
      • Form Runner
        • Detail page
          • Attachments
          • Email
          • PDF
          • Table of contents
        • Persistence
        • Summary page
      • Form Builder
      • XForms
    • Advanced
      • Workflows
      • Session management
      • State handling
      • Client-side error handling
      • Clustering and High Availability
      • Configuring a Form Runner eXist database
      • Creating a production WAR
      • Environments
      • JavaScript and CSS assets
      • Limiter filter
      • Run modes
      • Security
        • Content-Security-Policy header
      • SAP Hybris Module
      • XForms logging
    • Troubleshooting
      • Troubleshooting with the orbeon.log
      • Memory and threads
      • Relational database logging
      • Misc
  • Form Builder
    • Form settings
      • Time window
    • Form editor
      • Form area
      • Toolbox
      • Buttons bar
      • Control settings
      • Dependent fields and sections
      • Validation
      • Choices editor
      • Publishing
      • Cut, copy and paste
      • Section and grid settings
      • Section settings
      • Grid settings
      • Quick control search
      • Repeat settings
      • Repeated grids
      • Undo and redo
      • Keyboard shortcuts
    • Formulas
      • Examples of formulas
      • Formulas inspector
      • Formulas console
    • Summary page
    • Form localization
    • Advanced
      • Edit source
      • Services and actions
        • HTTP services
        • Database services
        • Simple Actions
        • Action Syntax
        • Action Syntax examples
        • Synchronizing repeated content
      • Testing a form in web mode
      • Testing PDF production
      • Testing offline functionality
      • Email settings
      • Field-level encryption
      • Messages
      • Section templates
      • Template syntax
      • XML Schemas support
      • Extensibility
        • Extension API
        • Integration
        • Toolbox component metadata
  • Form Runner
    • Overview
      • Terminology
    • Pages
      • Landing page
      • Published Forms page
      • Forms Admin page
      • Summary page
    • Components
      • Alert dialog
      • Attachment
      • Autocomplete
      • Captcha
      • Character counter
      • Checkbox input
      • Currency
      • Date
      • Dropdown date
      • Static and dynamic dropdown
      • Error summary
      • Grid
      • Handwritten signature
      • Hidden field
      • Image
      • Image annotation
      • Image attachment
      • Number
      • Open selection
      • Repeater
      • Formatted Text / Rich Text Editor
      • Section
      • Single-selection tree
      • Source code editor
      • Time
      • US phone
      • US state
      • Video
      • Video attachment
      • Wizard
      • XForms inspector
      • Yes/No answer
    • Features
      • Automatic calculations dependencies
      • Datasets
      • Excel and XML import
      • Excel and XML export
      • Summary page Excel Export
      • Form definitions and form data Zip Export
      • Purging historical data
      • Lease
      • Localization
      • Supported languages
      • Mobile support
      • Multitenancy
      • Form Runner navigation bar
      • PDF production
        • Automatic PDF
        • Automatic PDF header and footer configuration
        • PDF templates
      • Responsive design
      • Revision history
      • S3 storage
      • Simple data migration
      • TIFF production
      • Versioning
      • Wizard view
      • Workflow stage
    • Persistence
      • Using a relational database
      • Relational database schema
      • Purging old data using SQL
      • Auditing
      • Autosave
      • Database support
      • Flat view
    • Linking and embedding
      • Linking
      • Java Embedding API
      • JavaScript Embedding API
      • Liferay full portlet
      • Liferay proxy portlet
      • Securing Form Runner access
      • Form Runner offline embedding API
      • Angular component
      • React component
    • Access control and permissions
      • Users
      • Login & Logout
      • Deployed forms
      • Form fields
      • Editing forms
      • Owner and group member
      • Organizations
      • Scenarios
      • Token-based permissions
    • Styling
      • CSS
      • Grids CSS
      • Automatic PDF styling and CSS
    • APIs
      • Authentication of server-side service APIs
      • Persistence API
        • CRUD API
        • Search API
        • List form data attachments API
        • Form Metadata API
        • Lease API
        • Reindexing API
        • Caching
        • Versioning
        • Revision History API
        • Zip Export API
        • Custom persistence providers
      • Other APIs
        • Connection context API
        • Duplicate form data API
        • File scan API
        • Form Runner JavaScript API
        • Generate XML Schema API
        • PDF API
        • Publish form definition API
        • Run form in the background API
      • Data formats
        • Form data
        • Date and time
        • Form definition
    • Architecture and integration
      • Architecture
      • Access form data
      • Integration
    • Advanced
      • Buttons and processes
        • Simple process syntax
        • Core actions
        • Form Runner actions
          • Save action
          • Send action
          • Email action
        • XForms actions
        • Predefined buttons, processes and dialogs
        • Summary page buttons and processes
      • Custom dialogs/model logic
      • Services
      • Singleton form
      • Monitoring HTTP requests
  • XForms
    • Core
      • Attribute Value Templates (AVTs)
      • Binds
      • Validation
      • Variables
      • Keyboard focus
      • XForms JavaScript API
      • Error handling
        • Detailed behavior
      • Model-Bind variables
      • XForms 2.0 support
    • Events
      • Standard support
      • UI refresh events
      • Keyboard events
      • Extension events
      • Extension context information
      • Other event extensions
    • Actions
      • Repeat, insert and delete
      • Scripting actions
      • Extensions
    • Controls
      • Label, hint, help
      • Input
      • Output
      • Text area
      • Button
      • Upload
      • Dialog
    • Submission
      • Standard support
      • JSON support
      • Asynchronous submissions
      • Caching extension
      • Other submission extensions
    • XPath
      • Type annotations
      • Expression analysis
      • Tips
      • Compatibility
      • Standard functions
      • Maps and arrays Functions
      • Extension functions
        • Core functions
        • Utility functions
        • Model functions
        • Controls functions
        • XML functions
        • JSON functions
        • HTTP functions
        • Form Runner functions
        • Other functions
        • Deprecated functions
    • XBL components
      • FAQ
      • Guide
        • XBL Tutorial
        • Bindings
        • XForms models
        • Including content
        • Event handling
        • Conventions
        • Map XBL example
        • Learning from existing components
      • Advanced topics
        • XBL Modes
        • JavaScript companion classes
        • XBL library
        • Extensions
        • Attachment controls
    • XForms tutorial
      • Introduction
      • Installation
      • The Hello application
      • The Bookcast application
        • The basic app
        • Database access
        • Polishing the app
        • Adding a feed
    • Using XForms from Java apps
  • XML Platform
    • Page Flow Controller
      • Basics
      • XML submission
      • Navigating between pages
      • Paths and matchers
      • Other configuration elements
      • Typical combinations of page model and page view
      • Examples
      • Authorizing pages and services
    • Processors
      • URL generator
      • Request generator
      • PDF to image converter
    • Resources
      • Resource managers
      • Setting up an external resources directory
    • Other
      • Binary and text documents
  • FAQ
    • Licensing
    • PE and Dev Support
    • Form Builder and Form Runner
    • Resources and support
    • Other technical questions
  • Contributors
    • Automated tests
    • Building Orbeon Forms
    • Localizing Orbeon Forms
    • Validation functions
    • Contributor License Agreement
  • Release notes
    • Orbeon Forms 2022.1.9
    • Orbeon Forms 2024.1.1
    • Orbeon Forms 2023.1.7
    • Orbeon Forms 2024.1
    • Orbeon Forms 2023.1.6
    • Orbeon Forms 2023.1.5
    • Orbeon Forms 2021.1.11
    • Orbeon Forms 2022.1.8
    • Orbeon Forms 2023.1.4
    • Orbeon Forms 2023.1.3
    • Orbeon Forms 2023.1.2
    • Orbeon Forms 2022.1.7
    • Orbeon Forms 2023.1.1
    • Orbeon Forms 2023.1
    • Orbeon Forms 2022.1.6
    • Orbeon Forms 2021.1.10
    • Orbeon Forms 2022.1.5
    • Orbeon Forms 2021.1.9
    • Orbeon Forms 2022.1.4
    • Orbeon Forms 2022.1.3
    • Orbeon Forms 2021.1.8
    • Orbeon Forms 2022.1.2
    • Orbeon Forms 2022.1.1
    • Orbeon Forms 2022.1
    • Orbeon Forms 2021.1.7
    • Orbeon Forms 2021.1.6
    • Orbeon Forms 2021.1.5
    • Orbeon Forms 2021.1.4
    • Orbeon Forms 2021.1.3
    • Orbeon Forms 2021.1.2
    • Orbeon Forms 2021.1.1
    • Orbeon Forms 2021.1
    • Orbeon Forms 2020.1.6
    • Orbeon Forms 2019.2.4
    • Orbeon Forms 2019.1.2
    • Orbeon Forms 2018.2.5
    • Orbeon Forms 2018.1.4
    • Orbeon Forms 2020.1.5
    • Orbeon Forms 2020.1.4
    • Orbeon Forms 2020.1.3
    • Orbeon Forms 2020.1.2
    • Orbeon Forms 2019.2.3
    • Orbeon Forms 2020.1.1
    • Orbeon Forms 2020.1
    • Orbeon Forms 2019.2.2
    • Orbeon Forms 2019.2.1
    • Orbeon Forms 2019.1.1
    • Orbeon Forms 2019.2
    • Orbeon Forms 2019.1
    • Orbeon Forms 2018.2.4
  • Release history
  • Use cases
  • Product roadmap
  • Index of features
Powered by GitBook
On this page
  • Introduction
  • Configuration
  • Request attributes
  • Request body
  • Request headers
  • Uploaded files
  1. XML Platform
  2. Processors

Request generator

Introduction

Generators are a special category of processors that have no XML data inputs, only outputs. They are generally used at the top of an XML pipeline to generate XML data from a Java object or other non-XML source.

The Request generator streams XML from the current HTTP request. It can serialize request information including headers, parameters, query strings, user and server information.

NOTE: The Request generator can be used as the first component in a web application pipeline, but it is recommended to use the Page Flow Controller and XForms whenever possible. There are cases where additional data from the request may be required, however, and where the Request generator must be used.

Configuration

The Request generator takes a mandatory configuration to select which request information to return. This configuration consists of a series of include and exclude elements containing XPath expressions selecting a number of element from the request tree. Those expressions can be as complex as any regular XPath 1.0 expression that returns a single node or a node-set. However, it is recommended to keep those expressions as simple as possible. One known limitation is that it is not possible to test on the value element of uploaded files, as well as the content of the request body.

Sample Configuration:

<config>
  <include>/request/path-info</include>
  <include>/request/headers</include>
  <include>/request/parameters/parameter[starts-with(name, 'document-id')]</include>
  <exclude>/request/parameters/parameter[name = 'document-id-dummy']</exclude>
</config>

The full tree is:

<request>
  <container-type>servlet</container-type>
  <container-namespace/>
  <content-length>-1</content-length>
  <content-type/>
  <parameters>
    <parameter>
      <name>id</name>
      <value>12</value>
    </parameter>
    <parameter>       <name>print</name>
      <value>false</value>
    </parameter>
  </parameters>
  <body/>
  <protocol>HTTP/1.1</protocol>
  <remote-addr>127.0.0.1</remote-addr>
  <remote-host>localhost</remote-host>
  <scheme>http</scheme>
  <server-name>localhost</server-name>
  <server-port>8080</server-port>
  <is-secure>false</is-secure>
  <auth-type>BASIC</auth-type>
  <remote-user>jdoe</remote-user>
  <context-path>/ops</context-path>
  <headers>
    <header>
      <name>host</name>
      <value>localhost:8080</value>
    </header>
    <header>
      <name>user-agent</name>
      <value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826</value>
    </header>
    <header>
      <name>accept-language</name>
       <value>en-us, en;q=0.50</value>
    </header>
    <header>
      <name>accept-encoding</name>
      <value>gzip, deflate, compress;q=0.9</value>
    </header>
    <header>
      <name>accept-charset</name>
      <value>ISO-8859-1, utf-8;q=0.66, *;q=0.66</value>
    </header>
    <header>
      <name>keep-alive</name>
      <value>300</value>
    </header>
    <header>
      <name>connection</name>
      <value>keep-alive</value>
    </header>
    <header>
      <name>referer</name>
      <value>http://localhost:8080/ops/</value>
    </header>
    <header>
      <name>cookie</name>
      <value>JSESSIONID=DA6E64FC1E6DFF0499B5D6F46A32186A</value>
    </header>
  </headers>
  <attributes>
    <attribute>
      <name>oxf.xforms.renderer.deployment</name>
      <value>separate</value>
    </attribute>
    <attribute>
      <name>javax.servlet.forward.context_path</name>
      <value>/myapp</value>
    </attribute>
  </attributes>
  <method>GET</method>
  <path-info>/doc/home-welcome</path-info>
  <request-path>/doc/home-welcome</request-path>
  <path-translated>C:\orbeon\projects\OPS\build\ops-war\doc\home-welcome</path-translated>
  <query-string>id=12&print=false</query-string>
  <requested-session-id>DA6E64FC1E6DFF0499B5D6F46A32186A</requested-session-id>
  <request-uri>/ops/doc/home-welcome</request-uri>
  <request-url>http://localhost:8888/ops/doc/home-welcome</request-url>
  <servlet-path/>
</request>

NOTE: Orbeon Forms adds a computed request information item: the request-path. This is defined as a concatenation of the servlet-path and the path-info. This is useful because both these are frequently mixed up and often change depending on the application server or its configuration.

WARNING: This generator excludes all information items by default. To obtain the whole tree (as shown in the example above), you must explicitly include /request:

<p:processor name="oxf:request">
  <p:input name="config">
    <config>
      <include>/request</include>
    </config>
  </p:input>
  <p:output name="data" id="request"/>
</p:processor>

Request attributes

When the request includes /request/attributes, the Request generator attempts to retrieve request attributes. Since those can be any Java objects, the generator only includes string values.

Request body

When the request includes /request/body, the Request generator retrieves the body of the request sent to the application server. The content of the body is made available as the following data types:

  • If the attribute stream-type on the config element is set to xs:anyURI, an URI is returned as the value of the /request/body element.

  • If the attribute stream-type on the config element is set to xs:base64Binary, the content of the request encoded as Base64 is returned as the value of the /request/body element.

  • Otherwise, the content of the /request/body is set as either xs:anyURI if the request body is large (as set by the max-upload-memory-size property, by default larger than 10 KB), or xs:base64Binary if the request body is small.

  • The URL stored as the value of the request body is only valid for the duration of the current request, unless the stream-scope attribute is set to session, in which case it is valid for the duration of the session. [SINCE 2010-12-09]

Examples of configuration:

<config stream-type="xs:anyURI">
  <include>/request/body</include>
</config>
<config stream-type="xs:base64Binary">
  <include>/request/body</include>
</config>
<config stream-type="xs:anyURI" stream-scope="session">
  <include>/request/body</include>
</config>

The resulting data type is always set on the body element, for example:

<request>
  <body xsi:type="xs:anyURI">file:/C:/Tomcat/temp/upload_00000005.tmp</body>
</request>

WARNING: Reading the request body is incompatible with reading HTML forms POSTed with the multipart/form-data encoding, typically used when uploading files. In such a case, you should read either only the request body, or only the request parameters.

Request headers

Request header names are normalized to lowercase. According to the HTTP specification headers are case-insensitive. Normalization to lowercase makes it easier to compare header names without constantly calling the XPath lower-case() or similar.

Uploaded files

Uploaded files are stored into parameter elements, like any other form parameter. The rules for the data type used are the same as for the request body (see above), the data type depending on the stream-type attribute and the size of the uploaded files:

<config stream-type="xs:anyURI">
  <include>/request/parameters</include>
</config>

The URL stored as the value an upload body is only valid for the duration of the current request, unless the stream-scope attribute is set to session, in which case it is valid for the duration of the session.

The parameter element for an uploaded file contains the following elements in addition to the name and value elements use for other parameters:

  • filename: stores the file name sent by the user agent

  • content-type: store the media type sent by the user agent

  • content-length: stores the actual size in bytes of the uploaded data

A resulting uploaded file may look as follows:

<request>
  <parameters>
    <parameter>
      <name>upload-form-element-name</name>
      <filename>photo.jpg</filename>
      <content-type>image/jpeg</content-type>
      <content-length>2345</content-length>
      <value xsi:type="xs:anyURI">file:/C:/Tomcat/temp/upload_00000005.tmp</value>
    </parameter>
  </parameters>
</request>
PreviousURL generatorNextPDF to image converter

Last updated 2 years ago

NOTE: The URL stored as the value of the upload or request body is only accessible from the server side, and will not be accessible from a client such as a web browser. It is not guaranteed to be a file: URL, only that it can be read with Orbeon Forms's .

URL generator