ColdBox HMVC Documentation
DocsSourceSupportTraining
7.x
7.x
  • Introduction
    • Contributing Guide
    • Release History
      • What's New With 7.4.0
      • What's New With 7.3.x
      • What's New With 7.2.0
      • What's New With 7.1.0
      • What's New With 7.0.0
        • Release Notes
    • Upgrading to ColdBox 7
    • What is ColdBox
    • What is MVC
    • About This Book
      • Author
  • For Newbies
    • 60 Minute Quick Start
      • Installing ColdBox
      • My First ColdBox Application
      • My First Handler & View
      • Linking Events Together
      • Working with Events
      • Adding A Layout
      • Adding A Model
      • RESTFul Data
      • Next Steps
    • Getting Started Guide
  • Getting Started
    • Installation
    • Application Templates
    • Conventions
    • Configuration
      • ColdBox.cfc
        • Configuration Directives
          • CacheBox
          • ColdBox
          • Conventions
          • Environments
          • Flash
          • InterceptorSettings
          • Interceptors
          • Layouts
          • LayoutSettings
          • LogBox
          • Modules
          • ModuleSettings
          • Settings
          • WireBox
        • System Settings (Java Properties and Environment Variables)
      • Using Settings
      • Bootstrapper - Application.cfc
  • The Basics
    • Request Context
    • Routing
      • Requirements
        • Rewrite Rules
      • Application Router
      • Routing DSL
        • Routing By Convention
        • Pattern Placeholders
        • Routing Methods
        • Resourceful Routes
        • Named Routes
        • Routing Groups
        • Routing Namespaces
      • Building Routable Links
      • RESTFul Extension Detection
      • HTTP Method Spoofing
      • HTML Base Tag
      • Pathinfo Providers
    • Event Handlers
      • How are events called?
      • Getting & Setting Values
      • Setting Views
      • Relocating
      • Rendering Data
      • Sending Files
      • Interception Methods
        • Pre Advices
        • Post Advices
        • Around Advices
      • Model Integration
        • Model Data Binding
      • HTTP Method Security
      • Implicit Methods
      • Executing Events
      • Executing Routes
      • Viewlets - Reusable Events
      • Event Caching
      • Validation
    • Layouts & Views
      • Views
        • Rendering Views
        • Rendering External Views
        • Rendering With Local Variables
        • Rendering Collections
        • View Caching
        • View Helpers
        • View Events
      • Layouts
        • Basic Layouts
        • Default Layout
        • Nested Layouts
        • Overriding Layouts
        • Layouts From A Module
        • Layout Helpers
        • Layout Events
      • Implicit Layout-View Declarations
      • Helpers UDF's
      • ColdBox Elixir
    • Models
      • Domain Modeling
        • Service Layer
        • Data Layers
        • Book
      • Conventions Location
      • WireBox Binder
      • Super Type Usage Methods
      • Injection DSL
        • ColdBox Namespace
        • CacheBox Namespace
        • EntityService Namespace
        • Executor Namespace
        • Java Namespace
        • LogBox Namespace
        • Models Namespace
        • Provider Namespace
        • WireBox Namespace
      • Object Scopes
      • Coding: Solo Style
        • Datasource
        • Contact.cfc
        • ContactDAO.cfc
        • ContactService.cfc
        • Contacts Handler
      • Coding: ActiveEntity Style
        • ORM
        • Contact.cfc
        • Contacts Handler
        • Views
      • Coding: Virtual Service Layer
        • ORM
        • Contacts.cfc
        • Contacts Handler
        • Views
      • Coding: ORM Scaffolding
        • ORM
        • Contacts.cfc
        • Scaffold
    • Interceptors
      • How do they work?
        • Conventions
      • Interceptor Declaration
      • Interceptor Registration
      • Dynamic Registration
      • Core Interception Points
        • Application Life Cycle Events
        • Object Creating Events
        • Layout-View Events
        • Module Events
        • CacheBox Events
      • Restricting Execution
      • Interceptor Output Buffer
      • Custom Events
        • Configuration Registration
        • Programmatic Registration
        • Listening
        • Announcing Interceptions
      • Unregistering Interceptors
      • Reporting Methods
      • Interceptor Asynchronicity
        • Async Announcements
        • Async Listeners With Join
        • Async Listeners No Join
        • Asynchronous Annotations
  • HMVC
    • Modules
      • Core Modules
      • Locations
      • Parent Configuration
      • Module Layout
        • Changing The Module Layout
      • Module Service
        • Module Lifecycle
        • Module Registration
        • Module Activation
        • Module Unloading
        • Common Methods
        • Loading New Modules
        • Loading A-la-carte Modules
        • Module Events
      • ModuleConfig
        • Public Module Properties
        • The Decorated Variables
        • The configure() Method
        • Module Settings
        • Environment Control
        • Interceptor Events
      • Module Event Executions
      • URL Routing
        • Default Route Execution
        • Module Routes Files
      • Module Async Scheduling
      • Request Context Module Methods
      • Layout and View Renderings
        • Layout/View Discovery
        • Overriding Views
        • Overriding Layouts
        • Default Module Layout
        • Explicit Module Renderings
      • Models
      • Module CF Mappings
      • Module Dependencies
      • Module Helpers
      • Module Bundles
      • Module Inception
  • Testing
    • Testing Quick Start
    • Testing ColdBox Applications
      • Test Harness
      • ColdBox Testing Classes
      • Testing Methods
      • Integration Testing
        • Test Annotations
        • Life-Cycle Events
        • Request Setup()
        • The execute() Method
        • HTTP Testing Methods
        • Testing Without Virtual Application
      • Interceptor Testing
      • Model Object Testing
      • Tips & Tricks
  • Digging Deeper
    • Async Programming
      • Async Pipelines & Futures
      • Parallel Computations
      • Executors
      • Scheduled Tasks
    • ColdBox Proxy
      • Getting Started
      • The Base Proxy Object
      • The Event Handlers
        • Distinguishing Request Types
        • RenderData()
      • Proxy Events
      • Standard Return Types
      • Caveats & Gotchas
    • Controller Decorator
    • ColdBox Scheduled Tasks
    • Flash RAM
      • Flash Storage
      • Using Flash RAM
      • Creating Your Own Flash Scope
    • HTML Helper
    • REST Handler
    • Request Context Decorator
    • Recipes
      • Building REST APIs
      • ColdBox Exception Handling
      • Debugging ColdBox Apps
      • Clearing the View Cache
      • Basic HTTP Authentication Interceptor
  • Architecture Concepts
    • How ColdBox Works
Powered by GitBook
On this page
  • ColdBox Updates
  • SchemaInfo Helper
  • Async allApply() error handlers
  • Scheduled Task Groups
  • New everySecond() period
  • Task Results Are Optionals
  • Task Get Last Result
  • DateTimeHelper Updates
  • WireBox Updates
  • AOP Auto Mixer
  • CacheBox Updates
  • New Struct Literal Config
  • LogBox Updates
  • New Struct Literal Config
  • Category Appender Excludes
  • New Event Listeners
  • processQueueElement receives the queue
  • New Archive Layouts
  • Release Notes

Was this helpful?

Edit on GitHub
Export as PDF
  1. Introduction
  2. Release History

What's New With 7.2.0

November 18, 2023

Last updated 15 days ago

Was this helpful?

Welcome to ColdBox 7.2.0, which packs a big punch on stability and tons of new features.

ColdBox Updates

SchemaInfo Helper

A new helper has been born that assists you with dealing with Database Schema-related methods that are very common and core to ColdBox and supporting modules. This will grow as needed and be decoupled to its own module later.

  • hasTable()

  • hasColumn()

  • getDatabaseInfo()

  • getTextColumnType()

  • getDateTimeColumnType()

  • getQueryParamDateTimeType()

Async allApply() error handlers

The allApply() is great when dealing with async operations on arrays or collections of objects. However, if something blows up, it would blow up with no way for you to log in or know what happened. However, now you can pass an errorHandler argument which is a UDF/closure that will be attached to the onException() method of the future object. This way, you can react, log, or recover.

results = asyncManager.newFuture().allApply(
	items : data,
	fn : ( record ) => {
		var thisItem = new tests.tmp.User();
		thisItem.injectState = variables.injectState;

		// Inject Both States
		thisItem.injectState( protoTypeState );
		thisItem.injectState( record );

		return thisItem;
	},
	errorHandler : ( e ) => systemOutput( "error: #e.message#" )
)

Scheduled Task Groups

All scheduled tasks now have a group property so you can group your tasks. This is now available when creating tasks or setting them manually.

task( "email-notifications" )
  .setGroup( "admin" )
  .call( () => getInstance( "UserService" ).sendNotifications() )
  .everyDayAt( "13:00" )

You can then get the group using the getGroup() method or it will be added to all task metadata and stats.

New everySecond() period

A new period method shortcut: everySecond(). Very useful so you can fill up your logs with data.

task( "heartbeat" )
    .call( () => systemOutput( "data" ) )
    .everySecond()

Task Results Are Optionals

All task results, if any, are now stored in a ColdBox Optional. Which is a class that can deal with nulls gracefully and it's very fluent:

A container object which may or may not contain a non-null value. If a value is present, isPresent() will return true and get() will return the value. Additional methods that depend on the presence or absence of a contained value are provided, such as orElse() (return a default value if value not present) and ifPresent() (execute a block of code if the value is present). See https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html

Task Get Last Result

New method to get the last result, if any, from a task via the getLastResult() method.

var result = task.getLastResult().orElse( "nada" )

DateTimeHelper Updates

Lot's of great new methods and goodies so you can deal with date and times and timezones Oh My!

  • now( [timezone] )

  • getSystemTimezoneAsString()

  • getLastBusinessDayOfTheMonth()

  • getFirstBusinessDayOfTheMonth()

  • dateTimeAdd()

  • timeUnitToSeconds()

  • validateTime()

  • getIsoTime()

  • toInstant()

  • toLocalDateTime()

  • parse()

  • toLocalDate()

  • getTimezone()

  • getSystemTimezone()

  • toJavaDate()

  • duration()

  • period()

WireBox Updates

AOP Auto Mixer

If in your binder you declare aspects or AOP bindings. Then WireBox will automatically detect it and load the AOP Mixer listener for you. You no longer have to declare it manually.

CacheBox Updates

New Struct Literal Config

new cachebox.system.cache.CacheFactory( {
	// LogBox Configuration file
	logBoxConfig      : "coldbox.system.cache.config.LogBox",
	// Scope registration, automatically register the cachebox factory instance on any CF scope
	// By default it registers itself on server scope
	scopeRegistration : {
		enabled : true,
		scope   : "application", // the cf scope you want
		key     : "cacheBox"
	},
	// The defaultCache has an implicit name of "default" which is a reserved cache name
	// It also has a default provider of cachebox which cannot be changed.
	// All timeouts are in minutes
	// Please note that each object store could have more configuration properties
	defaultCache : {
		objectDefaultTimeout           : 120,
		objectDefaultLastAccessTimeout : 30,
		useLastAccessTimeouts          : true,
		reapFrequency                  : 2,
		freeMemoryPercentageThreshold  : 0,
		evictionPolicy                 : "LRU",
		evictCount                     : 1,
		maxObjects                     : 300,
		objectStore                    : "ConcurrentSoftReferenceStore",
		// This switches the internal provider from normal cacheBox to coldbox enabled cachebox
		coldboxEnabled                 : false
	}
} );

LogBox Updates

New Struct Literal Config

var logBox = new logbox.system.logging.LogBox(
   {
	appenders : { myConsoleLiteral : { class : "ConsoleAppender" } },
	root      : { levelmax : "FATAL", appenders : "*" },
	info      : [ "hello.model", "yes.wow.wow" ],
	warn      : [ "hello.model", "yes.wow.wow" ],
	error     : [ "hello.model", "yes.wow.wow" ]
   }
);

Category Appender Excludes

When you declare categories in LogBox you usually choose the appenders to send messages to, but you could never exclude certain ones. Now you can use the exclude property:

root : { levelmax : "INFO", appenders : "*", exclude: "slackAppender" },
categories = {
    "coldbox.system" = { levelmax="WARN", appenders="*", exclude: "slackAppender" },
    "coldbox.system.web.services.HandlerService" = { levelMax="FATAL", appenders="*", exclude: "slackAppender" },
    "slackLogger" = { levelmax="WARN", appenders="slackAppender", exclude: "slackAppender" }
}

New Event Listeners

You now have two new event listeners that all LogBox appenders can listen to:

  • preProcessQueue( queue, context ) : Fires before a log queue is processed element by element.

  • postProcessQueue( queue, context ) : After the log queue has been processed and after the listener has slept.

processQueueElement receives the queue

The processQueueElement( data, context, queue ) now receives the entire queue as well as the queue third argument.

New Archive Layouts

If you use the RollingFileAppender the default layout format of the archive package was static and you could not change it. The default is:

#filename#-#yyy-mm-dd#-#hh-mm#-#archiveNumber#

Now you have the power. You can set a property for the appender called archiveLayout which maps to a closure/UDF that will build out the layout of the file name.


appenders : {
  files : {
      class : "RollingFileAppender",
      properties : {
          archiveLayout : variables.getDefaultArchiveLayout
      }
  }
}

function getDefaultArchiveLayout( required filename, required archiveCount ){
    return arguments.fileName &
    "-" &
    dateFormat( now(), "yyyy-mm-dd" ) &
    "-" &
    timeFormat( now(), "HH-mm" ) &
    "-#arguments.archiveCount + 1#";
}

Release Notes

The full release notes per library can be found below. Just click on the library tab and explore their release notes:

New Feature

Improvement

Bug

New Feature

Improvement

New Feature

Bug

Improvement

Task

You can now configure CacheBox by just passing a struct of config data:

You can now configure LogBox by just passing a struct of config data:

Scheduled tasks now get a `group` property so you can use it for grouping purposes

New `now()` method in the DateTmeHelper with optional TimeZone

New datetimehelper method: getSystemTimezoneAsString()

New ScheduledTask helper: getLastResult() to get the latest result

LastResult is now a cbproxies Optional to denote a value or not (COMPAT)

new scheduledTask method: isEnabled() to verify if the task is enabled

Complete rewrite of Scheduled Task setNextRuntime() calculations to account for start end running scenarios

new ScheduledTask period : everySecond()

New SchemaInfo helper to help interrogate databases for metadata

Add an errorHandler to the allApply method so you can attach your own error handler to each future computation

casting to long instead of int when using LocalDateTime and plus methods to avoid casting issues.

Do not expose restful handler exception data unless you are in debug mode

RestHandler.cfc should catch NotAuthorized exception

getFirstBusinessDayOfTheMonth(), getLastBusinessDayOfTheMonth() now refactored to the dateTimeHelper

validateTime() is now a helper method in the DateTimeHelper

Migration of old tasks to new task syntax of task()

Scheduled Task Stats "NextRun", "Created", "LastRun" Using Wrong Timezones

onSessionEnd Error when using Coldbox_App_Key

Scheduled task isConstrainted() on day of the month was calculating the days in month backwards

set next run time when using first or last business day was not accounting times

Make wirebox.system.aop.Mixer listener load automatically if any aspects are defined/mapped

Support ad-hoc struct literal of CacheBox DSL to configure CacheBox

New listeners for all appenders: preProcessQueue() postProcessQueue()

Add the queue as an argument to the processQueueElement() method

new rolling appender property archiveLayout which is a closure that returns the pattern of the archive layout

Unhandled race conditions in FileRotator lead to errors and potential log data loss

log rotator was not checking for file existence and 1000s of errors could be produced

Support ad-hoc struct literal of LogBox DSL to configure LogBox

Add `Exclude` key to Logbox Categories to Easily Exclude Appenders

shutdown the appenders first instead of the executors to avoid chicken and egg issues

Change fileMaxArchives default from 2 to 10

Removal of instance approach in preferences to accessors for the LogBoxConfig

CacheBox DSL
https://cachebox.ortusbooks.com/configuration/cachebox-configuration
LogBox DSL
https://logbox.ortusbooks.com/configuration/configuring-logbox
COLDBOX-1248
COLDBOX-1252
COLDBOX-1253
COLDBOX-1256
COLDBOX-1257
COLDBOX-1258
COLDBOX-1259
COLDBOX-1260
COLDBOX-1262
COLDBOX-1263
COLDBOX-1246
COLDBOX-1247
COLDBOX-1250
COLDBOX-1254
COLDBOX-1255
COLDBOX-1261
COLDBOX-1241
COLDBOX-1244
COLDBOX-1245
COLDBOX-1251
WIREBOX-61
CACHEBOX-70
LOGBOX-75
LOGBOX-76
LOGBOX-79
LOGBOX-73
LOGBOX-77
LOGBOX-62
LOGBOX-70
LOGBOX-74
LOGBOX-78
LOGBOX-72
Optional
API Docs
Version 7.2.0