Skip to content

List of all variables.framework settings

atuttle edited this page Dec 31, 2012 · 15 revisions

Variables.framework supports the following settings, and these are their default values:

variables.framework = {
	reloadKey = "reload",
	reloadPassword = "true",
	reloadOnEveryRequest = false,

	representationClass = "taffy.core.nativeJsonRepresentation",

	dashboardKey = "dashboard",
	disableDashboard = false,

	unhandledPaths = "/flex2gateway",
	allowCrossDomain = false,
	globalHeaders = structNew(),
	debugKey = "debug",

	returnExceptionsAsJson = true,
	exceptionLogAdapter = "taffy.bonus.LogToEmail",
	exceptionLogAdapterConfig = {
		emailFrom = "[email protected]",
		emailTo = "[email protected]",
		emailSubj = "Exception Trapped in API",
		emailType = "html"
	},

	beanFactory = "",

	environments = {}
};

reloadKey

Type: String
Default: "reload"
Description: Name of the url parameter that requests the framework to be reloaded. Used in combination with the reload password (see: reloadPassword), the framework will re-initialize itself. During re-initialization, all configuration settings are re-applied and all cached objects are cleared and reloaded. If the value of the key does not match the reload password, a reload will not be performed. This allows you to set a secret password to restrict control of reloading your API to trusted parties.

reloadPassword

Type: String
Default: "true"
Description: Accepted value of the url parameter that requests the framework to be reloaded. Used in combination with the reload key (see: reloadKey), the framework will re-initialize itself. During re-initialization, all configuration settings are re-applied and all cached objects are cleared and reloaded. If the value of the key does not match the reload password, a reload will not be performed. This allows you to set a secret password to restrict control of reloading your API to trusted parties.

reloadOnEveryRequest

Type: Boolean
Default: False
Description: Flag that indicates whether Taffy should reload cached values and configuration on every request. Useful in development; set to FALSE in production.

representationClass

Type: String
Default: "taffy.core.nativeJsonRepresentation"
Description: The CFC dot-notation path, or bean name, of the representation class that your API will use to serialize returned data for the client.

dashboardKey

Type: String
Default: "dashboard"
Description: Name of the url parameter that displays the dashboard. The dashboard displays resources that your API is aware of, generates documentation about your API based on hint attributes, and contains a mock client to make testing your API easy.

disableDashboard

Type: Boolean
Default: False
Description: Whether or not Taffy will allow the dashboard to be displayed. If set to true, the dashboard key is simply ignored. You may wish to disable the dashboard in production, depending on whether or not you want customers/clients to be able to see it.

unhandledPaths

Type: String (Comma-delimited list)
Default: "/flex2gateway"
Description: Set a list of paths (usually subfolders of the API) that you do not want Taffy to interfere with. Unless listed here, Taffy takes over the request lifecycle and does not execute the requested ColdFusion template.

allowCrossDomain

Type: Boolean
Default: False
Description: Whether or not to allow cross-domain access to your API.

Turning this on adds the following headers:

<cfheader name="Access-Control-Allow-Origin" value="*" />
<cfheader name="Access-Control-Allow-Methods" value="#allowedVerbs#" />
<cfheader name="Access-Control-Allow-Headers" value="Content-Type" />

The allowed verbs, of course, are the ones allowed by the requested resource, as well as OPTIONS.

globalHeaders

Type: Structure
Default: {}
Description: A structure where each key is the name of a header you want to return, such as "X-MY-HEADER" and the structure value is the header value.

Global headers are static. You set them on application initialization and they do not change. If you need dynamic headers, you can add them to each response at runtime using withHeaders().

debugKey

Type: String
Default: "debug"
Description: Name of the url parameter that enables CF Debug Output.

returnExceptionsAsJson

Type: Boolean
Default: true
Description: When an error occurs that is not otherwise handled, this option tells Taffy to attempt to format the error information as JSON and return that (regardless of the requested return format).

exceptionLogAdapter

Type: String
Default: "taffy.bonus.LogToEmail"
Description: CFC dot-notation path to the exception logging adapter you want to use. Default adapter simply emails all exceptions. See Exception Logging Adapters for more details.

exceptionLogAdapterConfig

Type: Any
Default: See values at top of this page
Description: Configuration that your chosen logging adapter requires. Can be any data type. See Exception Logging Adapters for more details.

beanFactory

Type: Object Instance
Default: ""
Description: Already instantiated and cached (e.g. in Application scope) object instance of your external bean factory. Not required in order to use Taffy's built-in factory.

environments

Added in: Taffy 1.3
Type: Structure
Default: {}
Description: Environment-specific overrides to any framework settings. Applied after general variables.framework settings, and after configureTaffy() has been called. See Environment Specific Configuration for more details.

configureTaffy() -> (Deprecated)

Prior to version 1.2 of Taffy (in version 1.1 and earlier) the recommended practice for setting up this configuration was through the use of a method named configureTaffy and individual setter methods for each of the settings.

configureTaffy and its related setters have all been officially deprecated as of version 1.2, and is scheduled to be removed no earlier than version 2.0. Please make sure your code uses variables.framework instead.

Settings precedence when using variables.framework and configureTaffy()

As described above, configureTaffy is deprecated and will be going away in the future. For now it is still supported. Here's how precedence works if you find yourself using a mix of it and variables.framework:

  1. Default values are set into memory
  2. variables.framework is used to overwrite any default values that may be duplicated
  3. if defined, configureTaffy is run

Because of this, values set by configureTaffy currently take precedence over values in variables.framework.

Clone this wiki locally