Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Apr 9, 2021
2 parents f637be6 + eaea017 commit 1ab1e72
Show file tree
Hide file tree
Showing 95 changed files with 559 additions and 417 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ notifications:
env:
global:
# TARGET RELEASE VERSION: BUMP AS NEEDED
- COLDBOX_VERSION=6.3.0
- COLDBOX_VERSION=6.4.0
- COLDBOX_PRERELEASE=false
matrix:
- ENGINE=lucee@5 # Build Entire Frameworks
Expand Down
2 changes: 1 addition & 1 deletion apidocs/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ component{

// Core Mappings
this.mappings[ "/docbox" ] = API_ROOT & "docbox";

// Standlone mappings
this.mappings[ "/coldbox" ] = ( structKeyExists( url, "coldbox_root" ) ? url.coldbox_root : COLDBOX_ROOT );
this.mappings[ "/cachebox" ] = ( structKeyExists( url, "cachebox_root" ) ? url.cachebox_root : COLDBOX_ROOT );
Expand Down
41 changes: 13 additions & 28 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----

## [6.2.2] => 2021-JAN-12
## [6.4.0] => 2021-APR-09

### ColdBox HMVC Core

#### Bugs

* [COLDBOX-963] - Use Java URI for more resiliant getFullURL to avoid double slashes
- [COLDBOX-991](https://ortussolutions.atlassian.net/browse/COLDBOX-991) Fixes issues with Adobe losing App Context in Scheduled Tasks
- [COLDBOX-988](https://ortussolutions.atlassian.net/browse/COLDBOX-988) When running scheduled tasks in ACF loading of contexts produce a null pointer exception
- [COLDBOX-981](https://ortussolutions.atlassian.net/browse/COLDBOX-981) DataMarshaller no longer accepts 'row', 'column' or 'struct' as a valid argument.

----

### WireBox

### Bug

* [WIREBOX-107] - wirebox metadata caching broken
* [WIREBOX-109] - Standalone event pool interceptData -> data not backwards compat

### Improvement

* [WIREBOX-108] - WireBox not handling cachebox, logbox, and asynmanager instances properly


----

### CacheBox

#### Improvement

* [CACHEBOX-65] - CacheBox not handling wirebox, logbox, and asynmanager instances properly

----
#### Improvements

### LogBox
- [COLDBOX-989](https://ortussolutions.atlassian.net/browse/COLDBOX-989) Add more debugging when exceptions occur when loading/unloading thread contexts
- [COLDBOX-971](https://ortussolutions.atlassian.net/browse/COLDBOX-971) Implement caching strategy for application helper lookups into the `default` cache

#### Improvement
#### New Features

* [LOGBOX-60] - Ignore interrupted exceptions from appenders' scheduler pool
- [COLDBOX-990](https://ortussolutions.atlassian.net/browse/COLDBOX-990) Allow structs for query strings when doing relocations
- [COLDBOX-987](https://ortussolutions.atlassian.net/browse/COLDBOX-987) Encapsulate any type of exception in the REST Handler in a onAnyOtherException\(\) action
- [COLDBOX-986](https://ortussolutions.atlassian.net/browse/COLDBOX-986) Add registration and activation timestamps to the a module configuration object
- [COLDBOX-985](https://ortussolutions.atlassian.net/browse/COLDBOX-985) Rename renderLayout\(\) to just layout\(\) and deprecate it for v7
- [COLDBOX-984](https://ortussolutions.atlassian.net/browse/COLDBOX-984) Rename renderView\(\) to just view\(\) and deprecate it for v7
2 changes: 1 addition & 1 deletion system/Bootstrap.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ component serializable="false" accessors="true" {
}

/**
* ON applicaiton end
* ON application end
*/
function onApplicationEnd( struct appScope ){
var cbController = arguments.appScope[ locateAppKey() ];
Expand Down
103 changes: 99 additions & 4 deletions system/FrameworkSupertype.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ component serializable="false" accessors="true"{
/**
* Render out a view
*
* @deprecated Use view() instead
*
* @view The the view to render, if not passed, then we look in the request context for the current set view.
* @args A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
* @module The module to render the view from explicitly
Expand Down Expand Up @@ -166,9 +168,52 @@ component serializable="false" accessors="true"{
return variables.controller.getRenderer().renderView( argumentCollection=arguments );
}

/**
* Render out a view
*
* @view The the view to render, if not passed, then we look in the request context for the current set view.
* @args A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
* @module The module to render the view from explicitly
* @cache Cached the view output or not, defaults to false
* @cacheTimeout The time in minutes to cache the view
* @cacheLastAccessTimeout The time in minutes the view will be removed from cache if idle or requested
* @cacheSuffix The suffix to add into the cache entry for this view rendering
* @cacheProvider The provider to cache this view in, defaults to 'template'
* @collection A collection to use by this Renderer to render the view as many times as the items in the collection (Array or Query)
* @collectionAs The name of the collection variable in the partial rendering. If not passed, we will use the name of the view by convention
* @collectionStartRow The start row to limit the collection rendering with
* @collectionMaxRows The max rows to iterate over the collection rendering with
* @collectionDelim A string to delimit the collection renderings by
* @prePostExempt If true, pre/post view interceptors will not be fired. By default they do fire
* @name The name of the rendering region to render out, Usually all arguments are coming from the stored region but you override them using this function's arguments.
*
* @return The rendered view
*/
function view(
view="",
struct args={},
module="",
boolean cache=false,
cacheTimeout="",
cacheLastAccessTimeout="",
cacheSuffix="",
cacheProvider="template",
collection,
collectionAs="",
numeric collectionStartRow="1",
numeric collectionMaxRows=0,
collectionDelim="",
boolean prePostExempt=false,
name
){
return variables.controller.getRenderer().renderView( argumentCollection=arguments );
}

/**
* Renders an external view anywhere that cfinclude works.
*
* @deprecated Use `externalView()` instead
*
* @view The the view to render
* @args A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
* @cache Cached the view output or not, defaults to false
Expand All @@ -191,9 +236,36 @@ component serializable="false" accessors="true"{
return variables.controller.getRenderer().renderExternalView( argumentCollection=arguments );
}

/**
* Renders an external view anywhere that cfinclude works.
*
* @view The the view to render
* @args A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
* @cache Cached the view output or not, defaults to false
* @cacheTimeout The time in minutes to cache the view
* @cacheLastAccessTimeout The time in minutes the view will be removed from cache if idle or requested
* @cacheSuffix The suffix to add into the cache entry for this view rendering
* @cacheProvider The provider to cache this view in, defaults to 'template'
*
* @return The rendered view
*/
function externalView(
required view,
struct args={},
boolean cache=false,
cacheTimeout="",
cacheLastAccessTimeout="",
cacheSuffix="",
cacheProvider="template"
){
return variables.controller.getRenderer().renderExternalView( argumentCollection=arguments );
}

/**
* Render a layout or a layout + view combo
*
* @deprecated Use `layout()` instead
*
* @layout The layout to render out
* @module The module to explicitly render this layout from
* @view The view to render within this layout
Expand All @@ -214,6 +286,29 @@ component serializable="false" accessors="true"{
return variables.controller.getRenderer().renderLayout( argumentCollection=arguments );
}

/**
* Render a layout or a layout + view combo
*
* @layout The layout to render out
* @module The module to explicitly render this layout from
* @view The view to render within this layout
* @args An optional set of arguments that will be available to this layouts/view rendering ONLY
* @viewModule The module to explicitly render the view from
* @prePostExempt If true, pre/post layout interceptors will not be fired. By default they do fire
*
* @return The rendered layout
*/
function layout(
layout,
module="",
view="",
struct args={},
viewModule="",
boolean prePostExempt=false
){
return variables.controller.getRenderer().renderLayout( argumentCollection=arguments );
}

/**
* Get an interceptor reference
*
Expand Down Expand Up @@ -386,7 +481,7 @@ component serializable="false" accessors="true"{
* @event The name of the event to run, if not passed, then it will use the default event found in your configuration file
* @URL The full URL you would like to relocate to instead of an event: ex: URL='http://www.google.com'
* @URI The relative URI you would like to relocate to instead of an event: ex: URI='/mypath/awesome/here'
* @queryString The query string to append, if needed. If in SES mode it will be translated to convention name value pairs
* @queryString The query string or struct to append, if needed. If in SES mode it will be translated to convention name value pairs
* @persist What request collection keys to persist in flash ram
* @persistStruct A structure key-value pairs to persist in flash ram
* @addToken Wether to add the tokens or not. Default is false
Expand Down Expand Up @@ -540,7 +635,7 @@ component serializable="false" accessors="true"{
* Add a js/css asset(s) to the html head section. You can also pass in a list of assets. This method
* keeps track of the loaded assets so they are only loaded once
*
* @asset The asset(s) to load, only js or css files. This can also be a comma delimmited list.
* @asset The asset(s) to load, only js or css files. This can also be a comma delimited list.
*/
string function addAsset( required asset ){
return getInstance( "@HTMLHelper" ).addAsset( argumentCollection=arguments );
Expand All @@ -557,10 +652,10 @@ component serializable="false" accessors="true"{
*/
any function includeUDF( required udflibrary ){
// Init the mixin location and caches reference
var templateCache = getCache( "template" );
var defaultCache = getCache( "default" );
var mixinLocationKey = hash( variables.controller.getAppHash() & arguments.udfLibrary );

var targetLocation = templateCache.getOrSet(
var targetLocation = defaultCache.getOrSet(
// Key
"includeUDFLocation-#mixinLocationKey#",
// Producer
Expand Down
65 changes: 43 additions & 22 deletions system/RestHandler.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,18 @@ component extends="EventHandler" {
catch ( "PermissionDenied" e ) {
arguments.exception = e;
this.onAuthorizationFailure( argumentCollection = arguments );
}
}
// Record Not Found
catch ( "RecordNotFound" e ) {
arguments.exception = e;
this.onEntityNotFoundException( argumentCollection = arguments );
} catch ( Any e ) {
// Log Exception
log.error(
"Error calling #arguments.event.getCurrentEvent()#: #e.message# #e.detail#",
{
"_stacktrace" : e.stacktrace,
"httpData" : getHTTPRequestData( false )
}
);

// Setup General Error Response
arguments.prc.response
.setError( true )
.addMessage( "General application error: #e.message#" )
.setStatusCode( arguments.event.STATUS.INTERNAL_ERROR )
.setStatusText( "General application error" );

// If in development, let's show the error template
if ( getSetting( "environment" ) eq "development" ) {
rethrow;
}
arguments.exception = e;
this.onAnyOtherException( argumentCollection = arguments );
// If in development, let's show the error template
if ( getSetting( "environment" ) eq "development" ) {
rethrow;
}
}

// Development additions
Expand Down Expand Up @@ -543,6 +529,41 @@ component extends="EventHandler" {
.addMessage( "The resource requested (#event.getCurrentRoutedURL()#) could not be found" );
}

/**
* Action for 'any' exceptions, ie when not caught by previous catch statements
*
* @event The request context
* @rc The rc reference
* @prc The prc reference
* @eventArguments The original event arguments
* @exception The thrown exception
*/
function onAnyOtherException(
event,
rc,
prc,
eventArguments,
exception
){

// Log Exception
log.error(
"Error calling #arguments.event.getCurrentEvent()#: #arguments.exception.message# #arguments.exception.detail#",
{
"_stacktrace" : arguments.exception.stacktrace,
"httpData" : getHTTPRequestData( false )
}
);

// Setup General Error Response
arguments.prc.response
.setError( true )
.addMessage( "General application error: #arguments.exception.message#" )
.setStatusCode( arguments.event.STATUS.INTERNAL_ERROR )
.setStatusText( "General application error" );

}

/**
* Utility method for when an expectation of the request fails ( e.g. an expected parameter is not provided )
* - It will output a 417 status code (event.STATUS.EXPECTATION_FAILED)
Expand All @@ -552,7 +573,7 @@ component extends="EventHandler" {
* @event The request context
* @rc The rc reference
* @prc The prc reference
* @message The failure message sent in the request packge
* @message The failure message sent in the request package
*
* @returns 417:Expectation Failed
*/
Expand Down
4 changes: 2 additions & 2 deletions system/aop/Matcher.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ component accessors="true"{
*/
property name="instanceOf";
/**
* Matchin regex
* Matching regex
*/
property name="regex";
/**
* Mathching method names
* Matching method names
*/
property name="methods";
/**
Expand Down
2 changes: 1 addition & 1 deletion system/aop/MethodInterceptor.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ interface{
* @invocation.doc_generic coldbox.system.aop.methodInvocation
*/
function invokeMethod( required invocation ) output="false";

}
2 changes: 1 addition & 1 deletion system/aop/MethodInvocation.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* a `invokeMethod()` and receive this object as an argument.
* You can then use any of the properties in this object to construct your advice.
* Please see the property documentation below to understand each of the properties.
* Just remember that in order to continue the execution of the Adviced method you will need to call `proceed()`
* Just remember that in order to continue the execution of the Advised method you will need to call `proceed()`
*/
component accessors="true"{

Expand Down
4 changes: 2 additions & 2 deletions system/aop/Mixer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ component accessors="true"{
}

/**
* Executes our AOP mixer after variabless are created and autowired
* Executes our AOP mixer after variables are created and autowired
*/
function afterInstanceAutowire( required data ){
var mapping = arguments.data.mapping;
Expand Down Expand Up @@ -273,7 +273,7 @@ component accessors="true"{
* @target The incoming target
* @mapping The incoming target mapping
* @jointPoint The jointpoint to proxy
* @jointPointMD The jointpoint metdata to proxy
* @jointPointMD The jointpoint metadata to proxy
* @aspects The aspects to weave into the jointpoint
*
*/
Expand Down
2 changes: 1 addition & 1 deletion system/aop/aspects/CFTransaction.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ component implements="coldbox.system.aop.MethodInterceptor"

} catch( any e ){
structDelete( request, "cbox_aop_transaction" );
log.error( "An exception ocurred in the AOPed transactio for target: #arguments.invocation.getTargetName()#, method: #arguments.invocation.getMethod()#: #cfcatch.message# #cfcatch.detail#", cfcatch );
log.error( "An exception occurred in the AOPed transaction for target: #arguments.invocation.getTargetName()#, method: #arguments.invocation.getMethod()#: #cfcatch.message# #cfcatch.detail#", cfcatch );
rethrow;
}

Expand Down
Loading

0 comments on commit 1ab1e72

Please sign in to comment.