Application Configuration
All configuration is currently contained within <jarvis><app>
XML body.
Only one application is defined per configuration file. The name of the application is defined by the name of the application configuration file. For example, an application named “test” must be defined by a configuration file named:
/etc/jarvis/test.xml
The <app>
tag may have the following attributes.
Note: Throughout this configuration file all “boolean” attributes interpret yes
, true
, on
or 1
to indicate true. All other values mean false.
Attribute | Default | Notes |
---|---|---|
format |
json |
Default format for returned content. Valid configuration options are: json , json.array , json.rest , xml , csv , or xlsx .The content of client POST requests is also either JSON or XML, but does not need to match the returned format. |
retain_null |
yes (for JSON)no (for XML) |
Requests that fields with a null value be completely removed from JSON or XML fetch row results. • The default for XML is to remove null values. • The default for JSON is to retain null values. If the notnull transform (if enabled) will replace all fetched null values with empty strings prior to this processing, meaning that they will not be removed. |
debug |
no |
This will enable additional debug output to STDERR, which will appear in your Apache error log. |
dump |
no |
Identical to debug, the dump flag enables additional debug including a full dump of all requests and returned content. |
require_https |
no |
Require all connections for this application to use HTTPS. |
log_format |
See Notes | Specifies the format template to use for debug, dump and log output. Default is [%P/%A/%U/%D][%R] %M . See following log_format section for description of available fields. |
error_response_format |
See Notes | Specifies the format template to use for error responses to the client. Default is [%T][%R] %M . |
http_code_on_store_error |
no |
If no , then a database error on a dataset store (insert/update/delete/merge) will have Jarvis return structured data in a HTTP 200 result describing the failure.If yes , then a database error under these circumstances will instead return a HTTP 500 error, and the error_response_format will be used to determine how much information is returned. |
page_limit_param |
page_limit |
Name of the CGI parameter for the page size for server-side paging (performed after fetching). |
page_start_param |
page_start |
Name of the CGI parameter for the start row number for server-side paging (performed after fetching). |
sort_field_param |
sort_field |
Name of the CGI parameter which will be used column name for server-side sorting (performed after fetching). CGI parameter with this name should match a returned column name. |
sort_dir_param |
sort_dir |
Name of the CGI parameter which will be used column name for server-side sorting (after fetching). CGI parameter with this name should have value ASC or DESC . |
method_param |
_method |
Name of the CGI parameter which may over-ride the request method for RESTful updates. Required for Flex which restricts requests to GET and POST only. |
dataset_dir |
(none) | Defines a directory to contain dataset definition files. Multiple dataset_dir entries may be defined. |
router |
(none) | Router configuration allows the use of named RESTful parameters within the URL. It also gives explicit control over URL pattern mapping to datasets (including plugin and execs). |
dataset_route |
no |
This controls the behaviour in the case where one or more routes is configured, but the requested URI does not match any configured route. If this flag is yes , Jarvis will fallback to the behaviour applied when no routes are present – i.e. the first slash-separated part of the URI is treated as the dataset name. |
default_libs |
(none) | This element allows a list of zero or more directories to be defined which will then be added to the @INC path when loading plugin modules to execute. |
default_parameters |
(none) | Defines values which are supplied as default user parameters on all requests. |
login |
(none) | This sub-element defines and configures the login mechanism to be used for this application. At most one instance of this should be defined. If none is defined, users will never be logged in, and datasets must use ** as their access group parameter. |
database |
(none) | Defines the database connection parameters for the database(s) you intend to access. If there is more than one, they should have unique name parameters. The default name is default . |
sessiondb |
(none) | This defines the configuration for the cookie store. If this is omitted, then Jarvis will not maintain a login session cookie. Instead it will perform a full login check for every request. This can make sense in some situations. |
exec |
(none) | One or more optional sub-elements of this name may define an exec action (spawn a sub-process running a separate program). |
plugin |
(none) | One or more optional sub-elements of this name may define a plugin action (dynamically load a Perl module and execute the do method on that module). |
hook |
(none) | One or more optional custom Perl modules on which we call specially named methods at key points in the Jarvis processing. |
habitat |
(none) | Optional single sub-element containing configuration which will be passed to the application on request. |
csrf_protection |
(none) | Enable CSRF checking for each non-special access restricted request. The client will be responsible for parsing the generated CSRF cookie and including the token in the header for each XHR request. |
csrf_cookie |
XSRF-TOKEN |
If csrf_protection is enabled specifies the name of the CSRF cookie served to the client. |
xsrf_protection |
(none) | Enable XSRF protection for all JSON responses. All responses sent to the client will be prefixed with )]}',\n .The client is expected to remove all invalid prefix characters before attempting to parse the JSON content. |
cross_origin_protection |
(none) | Enable cross origin checking for each request sent to Jarvis. |
json_string_only |
no |
This will cause JSON responses to always return columns as string type. By default, if we can detect that the underlying column type is Boolean, Integer, Float, or JSON, then we will use the proper JSON encoding for the returned column value. |