What's new with ColdBox 2.6.3
Introduction
ColdBox 2.6.3 is a maintenance release to capitalize on bug fixes and tightening of the 2.6.2 enhancements.
Bug Fixes
Please see here in our Milestone Report all of our Bug Fixes and enhancements
J2EE Enhancements
- Updated the ses interceptor to clean out j2ee page contexts in order to route correctly
- Updated the auto-detection mechanism of the application in order to work under ANY j2ee context without setting an app mapping.
SES Add Variables per Route
You can now add a new parameter to the addRoute() method called matchVariables. This is a simple string of name-value pairs that you can pass to the route definition. This basically tells the ses processor that if that specific route matches, then add those name-value pairs to the request collection. This is a great way to add YOUR OWN variables hidden from the URL/FORM.
Example:
<cfset addRoute(pattern="space/:space",handler="page",action="show",matchVariables="spaceUsed=true,foundAt=#now()#")>
Logger Plugin Updates
Log Levels
The logger plugin was updated with logging levels that would match for each severity. This allows for the user customization of what errors to log by using a new ColdBox Setting: DefaultLogLevel and setting it to an integer between 0 and 4. The default log level the logger uses is 4, which means it will log EVERYTHING. Please see the severity log levels table below:
| severity | log level |
| debug | 4 |
| information | 3 |
| warning | 2 |
| error | 1 |
| fatal | 0 |
So look at some setting examples below:
<!-- Log everything --> <Setting name="DefaultLogLevel" value="4" /> <!-- Log Errors and Fatal errors only --> <Setting name="DefaultLogLevel" value="1" />
Shorthand Utility Methods
Thanks to Paul Marcotte we have added some utility methods for logging:
- debug(message,ExtraInfo)
- info(message,ExtraInfo)
- warning(message,ExtraInfo)
- error(message,ExtraInfo)
- fatal(message,ExtraInfo)
All these methods internally call the main logEntry() method.
New Setting: IOCFrameworkReload
Are you in development and have to be constantly hitting the reinit button because you made changes to your ioc services? Look no further. This new setting will auto-reload the ioc factory on each development request so you know that you are getting the latest code changes produced for you. Of course, the default value is false.
<Setting name="IOCFrameworkReload" value="true" />
New Model Integration Settings
You can now use the following ColdBox settings to configure your application's model integration features.
| setting | type | default value | description |
| ModelsObjectCaching | boolean | true | Tells the bean factory to cache model objects if cache metadata is found |
| ModelsSetterInjection | boolean | false | Use setter injection alongside metadata injection |
| ModelsDebugMode | boolean | false | Logs model creation and injections |
| !ModelsDICompleteUDF | string | onCompleteDI | The global name of the UDF to call after injections (if found in cfc) |
| ModelsStopRecursion | string (list) | --- | A comma-delimmitted list of class names where the factory should stop recursion. Ex: transfer.com.TransferDecorator |
<Setting name="ModelsObjectCaching" value="true" /> <Setting name="ModelsSetterInjection " value="false" /> <Setting name="ModelsDebugMode" value="false" /> <Setting name="ModelsDICompleteUDF" value="onDIComplete" /> <Setting name="ModelsStopRecursion" value="transfer.com.TransferDecorator,model.base.BaseService" />
getModel() new argument: stopRecursion
You can now a-la-carte stop recursions of injectable properties by just passing in a comma-delimmitted list of class names to the getModel() method.
Utilities: sendFile() binary support
The new sendFile() method introduced in 2.6.2 now supports custom mime types and binary support.
Transfer Loader Updates
You can now tell the transfer loader interceptor to also load the coldbox transfer TDO bean injector alongside of it by using two properties:
- LoadBeanInjector : boolean (defaults to false)
- BeanInjectorProperties : JSON Structure
- useSetterInjection: boolean (true)
- debugMode : boolean (false)
- onDICompleteUDF : string (onDIComplete)
- stopRecursion: string (transfer.com.TransferDecorator)
Example:
<Property name="LoadBeanInjector">true</Property> <Property name="BeanInjectorProperties">{'useSetterInjection':'false','debugMode':'true'}</Property>
