Comment on page
Paths and matchers
The value of the
pathattribute can be either a glob pattern or a full regular expression (Java regular expressions, which are very similar to Perl 5 regular expressions).
Simple examples of glob:
/about/company.htmlmatches exactly this URL
about/*matches any URL that starts with
*.gifmatches any URL that ends with
A default value for the
matcherattribute can also be placed on the element:
<controller xmlns="http://www.orbeon.com/oxf/controller" matcher="regexp">
COMPATIBILITY NOTE: Prior to Orbeon Forms 4.0, expression matchers were fully configurable via XPL processors. Starting Orbeon Forms 4.0, only Java/Perl 5 regular expressions and glob expressions are supported.
Groups of files can be matched using a single
<files>element with the regexp matcher:
A matcher can also be specified on a
When using a matcher that allows for groups, the part of the path matched by those groups can be extracted as documented above with the
<setvalue>element. This is only supported with the regexp matcher.
[SINCE Orbeon Forms 2017.2]
methodsattribute restricts which HTTP methods are allowed on the page or service. It is a space-separated list of HTTP method names.
#allcan be explicitly used to indicate that all HTTP methods are allowed.
By default, all HTTP methods are allowed.
This example requires that the incoming request be an HTTP
POST, or the controller returns a "404 Not Found" status code:
NOTE: This is independent from page or service authorization.
The result of matches can be referred to directly in the
viewattributes using the notation
In this case, if the path contains:
- The model file read will be
- The view file
viewattributes this way often allows greatly reducing the size of page flows that contain many similar pages.
resultelement directs flow to a page that uses matchers and
<setvalue>elements, the PFC attemps to rebuild the destination path accordingly. Consider the following example:
<page id="source" path="/">
<result page="destination" transform="oxf:xslt">
<form xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0">
<setvalue ref="/form/username" matcher-group="1"/>
<setvalue ref="/form/blog-id" matcher-group="2"/>
In this example, accessing the
sourcepage directly causes navigation to the
destinationpage. Using the following information:
- The internal XML submission
- The destination page's matcher groups
The PFC reconstructs the path to
/user/orbeon/blog/12345. This path is used to request the
destinationpage. In this case, the
viewattribute evaluates to
NOTE: Navigation to pages that use matchers but that do not provide an internal XML submission or
<setvalue>elements will cause the requested path to have its literal value, in the example above
/user/([^/]+)/blog/([^/]+). It is not advised to perform navigation this way.