-
Notifications
You must be signed in to change notification settings - Fork 66
MVC: Overriding Roxy Options
Several aspects of Roxy can be configured via XML. The default configuration values for Roxy are located in /src/roxy/config/defaults.xqy
.
If you wish to override any of the values in defaults.xqy then you need to edit /src/app/config/config.xqy
.
Simply include the xml elements you wish to override in $ROXY-OPTIONS
.
declare variable $ROXY-OPTIONS := <options> <default-controller>mycontroller</default-controller> </options>;
declare variable $ROXY-OPTIONS := <options> <default-controller>mycontroller</default-controller> <default-function>myfunction</default-function> </options>;
declare variable $ROXY-OPTIONS := <options> <default-layouts> <layout format="html">three-column</layout> </default-layouts> </options>;
When making an MVC request (app-type = mvc or hybrid), the response type is based on the format of the request. For html, xml, json and text, the response type is the mime type associated with the format. For other formats, the response type is set to the format itself. If you want to override these types, or add additional formats with correct types, add a formats section to $ROXY-OPTIONS.
<options> <formats> <format name="foo" type="application/bar"/> </formats> </options>;
With these options in place, here are the response types for various formats:
- xml: application/xml
- foo: application/bar
- my-format: my-format