[[Dashboard | << Back to Dashboard ]]
{|align="right"
| __TOC__
|}
= ColdBox Configuration File =
== Overview ==
The ColdBox configuration file is the heart of your ColdBox application. It contains the initialization variables for your application and extra information used by the ColdBox software aspects and how your application boots up. Below is an overview of every section of the file and how to configure an application. To provide code hinting and simple validation, I have included a ''config.xsd'' file for your usage. This file can be found at '''/coldbox/system/config/config.xsd'''. You can then use any of the tools below to help you get coding hints, color coding and validation.
'''XML & ColdFusion Tools'''
* [http://www.eclipse.org Eclipse]
** '''Plugins'''
*** [http://www.cfeclipse.org CFEclipse]
*** [http://www.eclipse.org/webtools/ Web Tools Project]
*** [http://www.xmlbuddy.com/ XMLBuddy]
*** [http://www.oxygenxml.com/ Oxygen XML]
* [http://www.altova.com/products/xmlspy/xml_editor.html Altova's XML Spy]
* [http://www.adobe.com Dreamweaver]
* Good Old Notepad.
'''FWSetting''' = Use the framework settings structure instead of the application settings structure=== Code Samples ===
| Setting | Description | Type | Required | Default |
| AppMapping: | The path of your application either relative from the web root or cfmx mapping. Very Important to set this setting if using the coldbox proxy or remote operations, instead of letting the framework auto calculate it for you. | String | FALSE | [Auto Calculated] |
| AppName: | The unique name of your application. | String | TRUE | n/a |
| ApplicationStartHandler | The name of the onApplicationStart handler to run: ehGeneral.onAppStart, leave blank if not used. To trigger again this handler, you must reinitialize the framework: fwreinit=1 | String | FALSE | blank |
| CustomErrorTemplate | ColdBox comes with its own error template for exceptions and bug reports. However, if you wish to customize your errors and bug reports, which you should, then just place the location of your custom error template. For example: includes/errorpage.cfm or /mymapping/templates/error.cfm Then in order to retrieve the error, you will need to get the Exception Bean from the request collection: getValue("ExceptionBean"). You can then use this bean to render your error page. Please look at the API to get a better understanding of the bean. | String | FALSE | blank |
| CustomEmailBugReport | ColdBox comes with its own template for bug reporting. However, you can override it and use your own. For example: includes/bugreport.cfm or /mymapping/templates/bugreport.cfm Then in order to retrieve the error, you will need to get the Exception Bean from the request collection: getValue("ExceptionBean"). You can then use this bean to render your error page. Please look at the API to get a better understanding of the bean. | String | FALSE | blank |
| ColdboxLogsLocation | The logation of the ColdBox logs. Relative if using a directory within the application. Absolute location if outside of the application. | String (Path) | FALSE | logs |
| ConfigAutoReload | This is a flag mostly used during development. It will reload your config file settings, clear the cache, reset the app to first request state, on every request. Else you will have to manually reload the structures using fwreinit=1. Be careful when using this as performance decreases. | Boolean | FALSE | FALSE |
| DebugMode | Enable/Disable ColdBox debugging mode application wide. | Boolean | FALSE | FALSE |
| DebugPassword | The password you would like to use to go into debugmode. You will need to pass this string as a URL param combined with the DebugMode. | String | FALSE | blank |
| DefaultEvent: | The name of the event handler for the default event to run: General.dspHome | String | TRUE | n/a |
| DefaultLogLevel: | The default log level to use when logging to log files.0-fatal,1-error,2-warning,3-information,4-debug | numeric (0-4) | false | 4 |
| EventName | The name of the event variable to use in the URL/FORM, default is 'event'. | String | FALSE | event (or framework wide setting) |
| ExceptionHandler | The custom exception handler to run on all framework exceptions. You decide what to do, YOU HAVE THE POWER! | String | FALSE | blank |
| EnableBugReports: | Enable/Disable the emailing of bug reports to the emails in the BugReports element. | Boolean | FALSE | TRUE |
| EnableColdfusionLogging | Enable/Disable Coldfusion Error Logs. | Boolean | FALSE | FALSE |
| EnableDumpVar | Enable/Disable the use of the URL action to dump variables in debug mode. | Boolean | FALSE | TRUE |
| EnableColdboxLogging | Enable/Disable Coldbox Logging facilities. | Boolean | FALSE | FALSE |
| EventCaching | Enable/Disable Event Caching | Boolean | FALSE | TRUE |
| FlashURLPersistScope | The storage location of the flash RAM the framework uses. Available possibilities are session and client. | String | FALSE | session (or framework wide settings) |
| HandlersIndexAutoReload | This is a flag mostly used during development. ColdBox onApplication Start will read your handlers directory and store the names of the available handlers. When requests are made and handlers get instantiated, they are instantiated using the internal syntax. Thus, if you are developing and are adding handlers, with this flag set to TRUE, then ColdBox will reload the list. Else, you will have to manually reload the structures using the fwreinit=1 url action | Boolean | FALSE | FALSE |
| HandlersExternalLocation | This is the base instantiation path for an external location for event handlers. The framework will read all the handlers from that directory and register them as external events. This should be a dot formatted path: myMapping.externalHandlers.blog | String | FALSE | blank |
| HandlerCaching | This is useful to be set to false in development and true in production. This tells the framework to cache your event handlers. If you do not specify this setting or leave it blank, then the framework will use the default value of TRUE |
boolean | FALSE | TRUE |
| IOCFramework | This setting is used if you will be using an IoC framework like coldspring or lightwire. The only possible values are "coldspring" and "lightwire" |
String | FALSE | blank |
| IOCFrameworkReload | This setting is used to tell the framework to reload the entire IOC Framework on every request. Great for development. |
Boolean | FALSE | false |
| IOCDefinitionFile | This is the path to the main configuration file for your IoC framework. This can either be relative to the root of your application or an absolute path. |
String (path) | FALSE | blank |
| IOCObjectCaching | This boolean variable tells the IoC plugin to cache objects created by the IoC framework in the ColdBox Cache. |
boolean | FALSE | FALSE |
| MessageboxStyleOverride | Whether you want to override the messagebox's css or not. | boolean | FALSE | FALSE |
| ModelsExternalLocation | The instantiation base path of the location of external model objects | string | FALSE | blank |
| ModelsObjectCaching | Setting that tells the bean factory to persist model objects or not. Great for development. | Boolean | FALSE | true |
| ModelsSetterInjection | Use setter injection alongside metadata injection | Boolean | FALSE | false |
| ModelsDebugMode | Logs model creation and injections | Boolean | FALSE | false |
| ModelsDICompleteUDF | The global name of the UDF to call after injections (if found in cfc) | string | FALSE | onCompleteDI |
| ModelsStopRecursion | A comma-delimmitted list of class names where the factory should stop recursion. Ex: transfer.com.TransferDecorator | string | FALSE | blank |
| MyPluginsLocation | Declare the custom plugins base invocation path, if used. You have to use dot notation.
Example: mymapping.myplugins, myapplication.customplugins. |
String | FALSE | blank |
| onInvalidEvent | The event to execute if an invalid event is detected by the framework. For example, if garbage is sent in the event variable, then the event registered here will fire instead. | String | FALSE | blank |
| OwnerEmail: | The email that will be used to send all email communications by the framework. | String | TRUE | n/a |
| ProxyReturnCollection | A boolean flag that tells the ColdBox proxy to return the entire request collection structure or what the event handlers return | boolean | FALSE | FALSE |
| RequestStartHandler: | The name of the onRequestStart handler to run: ehGeneral.onRequestStart, leave blank if not used. | String | FALSE | blank |
| RequestEndHandler: | The name of the onRequestEnd handler to run: ehGeneral.onRequestEnd, leave blank if not used | String | FALSE | blank |
| RequestContextDecorator | The instantiation path to the request context decorator you would like to use. | String | FALSE | blank |
| ReinitPassword | The password you would like to use to reinitialize the framework using the fwreinit URL Action. | String | FALSE | blank |
| SessionStartHandler: | The name of the onSessionStart handler to run: ehGeneral.onSessionStart, leave blank if not used. | String | FALSE | blank |
| SessionEndHandler: | The name of the onRequestEnd handler to run: ehGeneral.onSessionEnd, leave blank if not used | String | FALSE | blank |
| UDFLibraryFile | The location of your UDF library if in use, else leave blank.ColdBox will first look in your includes directory, so you can just place the name of the UDF here, or the full path you write including CFMX Mappings. Ex: /ColdBoxSamples/includes/udf.cfm | String | FALSE | blank |
| ViewsExternalLocation | The external location to use for view renderings. This location will be checked second for views to render by using the renderView() commands or setting a view. This is a great way to declare a repository of views for rendering. | String | FALSE | blank |
http://myapp.com/index.cfm?dumpvar=myvariable,sessionColdBox will dump the the myvariable variable, and the session scope. '''It is recommended to have this setting set to FALSE in production''' === EnableColdboxLogging === The '''EnableColdboxLogging''' setting is a boolean setting that tells the framework to log all types of errors and exceptions in the location specified by the '''ColdBoxLogsLocation''' element (Discussed below). You can then use the ''logEntry()'' method found in the '''logger''' plugin, to log entries to this facility. You can also use the '''logError() and logErrorWithBean()''' methods, also found in the logger plugin. This is ColdBox's AOP Error Logging. See [http://www.coldbox.org/api CFC API] So now you have full control of your logging per application. Not only that, using the settings.xml of the framework, you can control the maximum size in kbytes for each log file. Once this limit is reached, ColdBox auto-archives your log files and creates a new archive. You can choose the file encoding of the log files and the maximum number of archives to keep in rotation. Well ladies and gentlemen, isn't that easy. Two values to fill out and you have logging supported in your application. You can then use the following methods to interact with the logs. However, I encourage you to view the full API of the logger plugin to understand the full power you have. * '''logErrorWithBean'''( exceptionBean ) * '''logError'''( Message, [ExceptionStruct (Coldfusion cfcatch structure)], [ExtraInfo (Anthing you like to log extra)]) * '''logEntry'''( Severity=['error','information','warning','fatal'], Message, [ExtraInfo (Simple Value extra to log)] ) === EventCaching === A simple boolean variable that tells the framework to activate event caching or not. === FlashURLPersistScope === This is a simple setting that tells the framework where to store the flash RAM data it uses. The only possible options right now are: * session * client If you do not have this setting defined, the framework will look for the default in its internal settings. === HandlersIndexAutoReload === The '''HandlersIndexAutoReload''' is a developer tool to facilitate the developer from constantly using the '''fwreinit=1''' action flag. When ColdBox initialized the application, it introspects your handlers for metadata. It then creates an internal registry of each handler. This way, only registered handlers can be called, and with the correct syntax for any operating system. However, when you are developing, you are constantly adding/removing/editing methods inside of these handlers or even adding new handlers. That is why you can get the Event Handler Not registered exceptions. So set this flag to true, to reload the index on every request. This is done incredibly fast, so don't worry about performance hits on development.
fwreinit=mypass=== SessionStartHandler === The '''SessionStartHandler''' is where you declare the event handler and method combination that will be invoked at the start of every user session. This simulates the Application.cfc onSessionStart method, but enclosed within the framework. You can use this for security, variable settings, etc. === SessionEndHandler === The '''SessionEndHandler''' is where you declare the event handler and method combination that will be invoked at the end of every user session. This simulates the onSessionEnd method, but enclosed within the framework. You will receive a copy of the session structure in the request collection called: '''sessionReference''' === UDFLibraryFile === The '''UDFLibraryFile''' is a cool setting where you can declare the path to a UDF template to load for usage in views, layouts and event handlers. You can use relative path's to your applications root or ColdFusion mappings. So for example if I have my udf template called udf.cfm in my includes directory under my application root, I would use: ''value="includes/udf.cfm"'' , if I have them in a mapping called: myudfs, then I would use:'' value="/myudfs/udf.cfm"''. Your very own runtime method injection mechanism. You can also do runtime mixins by using the '''includeUDF()''' method in your handlers/plugins/interceptors/views/layouts. === ViewsExternalLocation === This setting determines a location of where you want to have external views. So when you do a renderView() or setView() methods, the framework will search first your default convention for the view, if it cannot find it there, it will look in this external location and render it for you. This is a great way to create modules or extensible applications. ==
{name}_{java standard locale}.properties
=== Locale Storage ===
The third element is '''!LocaleStorage''' and you have three possibilities:
* session
* client
* cookie
This tells ColdBox in what scope to store the locale of each user, not THE APPLICATION. This way, you can have a users running the application in different locales (languages)
=== Unknown Translation ===
The fourth element is '''!UnknownTranslation''' which is used by the resource bundle plugin whenever a translation cannot be found. Instead of returning the default bogus '''_UNKNOWN''', you can choose your own.
There is no big deal about resource bundles, they are files that have key-value pairs, look at the example below:
help_button=Help close=Close Me relocate_button=Relocate Now! intro_message=Welcome to my website. search_button=Search It! search_test=Search for postings now.So how do I change from one locale to another? look at the sample below: