Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

MVC: Overriding Roxy Options

Geert edited this page Jun 8, 2017 · 1 revision

OVERRIDING DEFAULTS

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.

EXAMPLES

Changing the default controller

declare variable $ROXY-OPTIONS :=
  <options>
    <default-controller>mycontroller</default-controller>
  </options>;

Changing the default controller and function

declare variable $ROXY-OPTIONS :=
  <options>
    <default-controller>mycontroller</default-controller>
    <default-function>myfunction</default-function>
  </options>;

Changing the layout to three column

declare variable $ROXY-OPTIONS :=
  <options>
    <default-layouts>
      <layout format="html">three-column</layout>
    </default-layouts>
  </options>;

Adding or Overriding mime types

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