HTTP functions
xxf:get-portlet-mode()
[SINCE Orbeon Forms 4.2]
Return the portlet mode.
xxf:get-portlet-mode() as xs:stringIf running within a portlet context, return the portlet mode (e.g. view, edit), otherwise return the empty sequence.
NOTE: This function only works with the full portlet. The proxy portlet is not supported.
xxf:get-remote-user()
xxf:get-remote-user() as xs:string?Returns the username for the current user of the application, if known by the container, for instance because users log in with BASIC of FORM-based authentication.
xxf:get-request-attribute()
xxf:get-request-attribute(
$name as xs:string,
$content-type as xs:string?
) as item()?The xxf:get-request-attribute() function returns the value of the given request attribute. The attribute may have been previously placed in the request through Java code, or using xxf:set-request-attribute(), for example.
The types of attribute objects supported are the same [types supported by the Scope generator][3], plus types stored with xxf:set-request-attribute().
If present, the second parameter can specify the text/plain content type. In that case, if a String object is retrieved, it is return as an xs:string instead of being parsed as XML.
NOTE: This function can only be called during page initialization, otherwise it will throw an error. We recommend you use it only within event handlers called as a result of processing xforms-model-construct-done or xforms-ready, or from the xxf:default MIP.
xxf:get-request-header()
The xxf:get-request-header() function returns the value(s) of the given request HTTP header.
This function can be used even after page initialization, and can be used everywhere other XPath functions are supported.
NOTE: With Orbeon Forms 3.8 and 3.9, this function can only be called during page initialization, otherwise it will throw an error. We recommend you use it only within event handlers called as a result of processing xforms-model-construct-done or xforms-ready, or from the xxf:default MIP.
xxf:get-request-method()
[SINCE Orbeon Forms 4.2]
Return the current HTTP method.
Return the HTTP method of the current request, such as GET, POST, etc.
xxf:get-request-parameter()
The xxf:get-request-parameter() function returns the value(s) of the given request parameter.
This function can be used even after page initialization, and can be used everywhere other XPath functions are supported.
NOTE: With Orbeon Forms 3.8 and 3.9, this function can only be called during page initialization, otherwise it will throw an error. We recommend you use it only within event handlers called as a result of processing xforms-model-construct-done or xforms-ready, or from the xxf:default MIP.
NOTE: By default, most if not all servlet containers do not use the UTF-8 encoding but use ISO-8859-1 instead to decode URL parameters. You can configure your servlet container to support UTF-8 instead. See the following resources:
xxf:get-request-path()
The xxf:get-request-path() function returns the path of the incoming HTTP request (without the Java servlet context if any).
This function can be used even after page initialization, and can be used everywhere other XPath functions are supported.
NOTE: With Orbeon Forms 3.8 and 3.9, this function can only be called during page initialization, otherwise it will throw an error. We recommend you use it only within event handlers called as a result of processing xforms-model-construct-done or xforms-ready, or from the xxf:default MIP.
xxf:get-session-attribute()
The xxf:get-session-attribute() function returns the value of the given session attribute.
The types of attribute objects supported are the same [types supported by the Scope generator][3], plus types stored with xxf:set-session-attribute().
If present, the second parameter can specify the text/plain content type. In that case, if a String object is retrieved, it is return as an xs:string instead of being parsed as XML.
xxf:get-window-state()
[SINCE Orbeon Forms 4.2]
Return the portlet window state.
If running within a portlet context, return the window state (e.g. normal, minimized, maximized), otherwise return the empty sequence.
NOTE: This function only works with the full portlet. The proxy portlet is not supported.
xxf:is-user-in-role()
Returns true if and only if the container recognizes that the current user of the application has the specified role. Roles will be typically known by the container when users are logged in using either BASIC or FORM-based authentication.
xxf:set-request-attribute()
The xxf:set-request-attribute() function stores the given value as a request attribute.
xxf:set-session-attribute()
The xxf:set-session-attribute() function stores the given value as a session attribute.
xxf:user-ancestor-organizations()
[SINCE Orbeon Forms 2016.3]
Return the current user's organizations which are the ancestors of the leaf organization passed if any, from leaf to root. The leaf organization itself is not returned.
Say you have:
Then:
returns:
This:
returns:
This function only works with the header-driven method. See Form Runner Access Control Setup.
xxf:user-group()
[SINCE Orbeon Forms 4.9]
Return the current user's group if available. This function works with container- and header-driven methods. See Form Runner Access Control Setup.
xxf:user-organizations()
[SINCE Orbeon Forms 2016.3]
Return the current user's leaf organizations if any.
Say you have these organizations:
xxf:user-organizations() returns:
This function only works with the header-driven method. See Form Runner Access Control Setup.
xxf:user-roles()
[SINCE Orbeon Forms 4.9]
Return the current user's groups if available. This function works with container- and header-driven methods. See Form Runner Access Control Setup.
xxf:username()
[SINCE Orbeon Forms 4.9]
Return the current user's username if available. This function works with container- and header-driven methods. See Form Runner Access Control Setup.
Last updated