Skip to content

Commit

Permalink
COLDBOX-538 #resolve
Browse files Browse the repository at this point in the history
Alises in module models aren't picked up
  • Loading branch information
lmajano committed Sep 15, 2016
1 parent db83f12 commit eeae549
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 30 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[![Build Status](https://travis-ci.org/ColdBox/coldbox-platform.svg?branch=development)](https://travis-ci.org/ColdBox/coldbox-platform)``` ____ ____ _____ ______ ______ ____ __ __ / ___) / __ \ (_ _) (_ __ \ (_ _ \ / __ \ (_ \ / _) / / / / \ \ | | ) ) \ \ ) (_) ) / / \ \ \ \_/ / ( ( ( () () ) | | ( ( ) ) \ _/ ( () () ) \ / ( ( ( () () ) | | __ ) ) ) ) / _ \ ( () () ) / _ \ \ \___ \ \__/ / __| |___) ) / /__/ / _) (_) ) \ \__/ / _/ / \ \_ \____) \____/ \________/ (______/ (______/ \____/ (__/ \__) ```Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corpwww.coldbox.org | www.ortussolutions.com----Because of God's grace, this project exists. If you don't like this, then don't read it, its not for you.>"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ:By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God.And not only so, but we glory in tribulations also: knowing that tribulation worketh patience;And patience, experience; and experience, hope:And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5----# Welcome to ColdBoxColdBox is a conventions modular MVC development platform for ColdFusion (CFML).## LicenseApache License, Version 2.0.>The ColdBox Websites, logo and content have a separate license and they are a separate entity.## VersioningColdBox is maintained under the Semantic Versioning guidelines as much as possible.Releases will be numbered with the following format:```<major>.<minor>.<patch>```And constructed with the following guidelines:* Breaking backward compatibility bumps the major (and resets the minor and patch)* New additions without breaking backward compatibility bumps the minor (and resets the patch)* Bug fixes and misc changes bumps the patch## Important LinksSource Code- https://github.com/coldbox/coldbox-platformContinuous Integration- http://jenkins.staging.ortussolutions.com/job/OS-ColdBoxPlatform%20BE/Bug Tracking/Agile Boards- https://ortussolutions.atlassian.net/browse/COLDBOX- https://ortussolutions.atlassian.net/browse/WIREBOX- https://ortussolutions.atlassian.net/browse/LOGBOX- https://ortussolutions.atlassian.net/browse/CACHEBOXDocumentation- http://coldbox.ortusbooks.com- http://wiki.coldbox.org (Legacy)Blog- http://blog.coldbox.orgOfficial Site- http://www.ortussolutions.com/products/coldbox- http://www.coldbox.org## System Requirements- Lucee 4.5+- Railo 4+ (Deprecated)- ColdFusion 9.02+## Quick InstallationPlease go to our [documentation](http://coldbox.ortusbooks.com) for expanded instructions. **CommandBox (Recommended)**We recommend you use [CommandBox](http://www.ortussolutions.com/products/commandbox), our CFML CLI and package manager, to install ColdBox.**Stable Release**`box install coldbox`**Bleeding Edge Release**`box install coldbox-be`**Simple Install**Unzip the download into a folder called `coldbox` in your webroot or place outside of the webroot and create a per-application mapping `/coldbox` that points to it.**Bleeding Edge Downloads**You can always leverage our bleeding edge artifacts server to download ColdBox: http://integration.stg.ortussolutions.com/artifacts/ortussolutions/coldbox/## CollaborationIf you want to develop and hack at the source, you will need to download [CommandBox](http://www.ortussolutions.com/products/commandbox) first. Then in the root of this project, type `box install`. This will download the necessary dependencies to develop and test the core. You can then go ahead and start an embedded server `box server start` and start hacking around. For running our test suites you will need 2 more steps, so please refer to the [Readme](tests/readme.md) in the tests folder.--- ###THE DAILY BREAD > "I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
[![Build Status](https://travis-ci.org/ColdBox/coldbox-platform.svg?branch=development)](https://travis-ci.org/ColdBox/coldbox-platform)``` ____ ____ _____ ______ ______ ____ __ __ / ___) / __ \ (_ _) (_ __ \ (_ _ \ / __ \ (_ \ / _) / / / / \ \ | | ) ) \ \ ) (_) ) / / \ \ \ \_/ / ( ( ( () () ) | | ( ( ) ) \ _/ ( () () ) \ / ( ( ( () () ) | | __ ) ) ) ) / _ \ ( () () ) / _ \ \ \___ \ \__/ / __| |___) ) / /__/ / _) (_) ) \ \__/ / _/ / \ \_ \____) \____/ \________/ (______/ (______/ \____/ (__/ \__) ```Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corpwww.coldbox.org | www.ortussolutions.com----Because of God's grace, this project exists. If you don't like this, then don't read it, its not for you.>"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ:By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God.And not only so, but we glory in tribulations also: knowing that tribulation worketh patience;And patience, experience; and experience, hope:And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5----# Welcome to ColdBoxColdBox is a conventions modular MVC development platform for ColdFusion (CFML).## LicenseApache License, Version 2.0.>The ColdBox Websites, logo and content have a separate license and they are a separate entity.## VersioningColdBox is maintained under the Semantic Versioning guidelines as much as possible.Releases will be numbered with the following format:```<major>.<minor>.<patch>```And constructed with the following guidelines:* Breaking backward compatibility bumps the major (and resets the minor and patch)* New additions without breaking backward compatibility bumps the minor (and resets the patch)* Bug fixes and misc changes bumps the patch## Important LinksSource Code- https://github.com/coldbox/coldbox-platformContinuous Integration- http://jenkins.staging.ortussolutions.com/job/OS-ColdBoxPlatform%20BE/Bug Tracking/Agile Boards- https://ortussolutions.atlassian.net/browse/COLDBOX- https://ortussolutions.atlassian.net/browse/WIREBOX- https://ortussolutions.atlassian.net/browse/LOGBOX- https://ortussolutions.atlassian.net/browse/CACHEBOXDocumentation- http://coldbox.ortusbooks.com- http://wiki.coldbox.org (Legacy)Blog- http://blog.coldbox.orgOfficial Site- http://www.ortussolutions.com/products/coldbox- http://www.coldbox.org## System Requirements- Lucee 4.5+- ColdFusion 9.02+- Railo 4+ (Deprecated)## Quick InstallationPlease go to our [documentation](https://coldbox.ortusbooks.com) for expanded instructions. **CommandBox (Recommended)**We recommend you use [CommandBox](http://www.ortussolutions.com/products/commandbox), our CFML CLI and package manager, to install ColdBox.**Stable Release**`box install coldbox`**Bleeding Edge Release**`box install coldbox-be`**Simple Install**Unzip the download into a folder called `coldbox` in your webroot or place outside of the webroot and create a per-application mapping `/coldbox` that points to it.**Bleeding Edge Downloads**You can always leverage our bleeding edge artifacts server to download ColdBox: https://integration.stg.ortussolutions.com/artifacts/ortussolutions/coldbox/## CollaborationIf you want to develop and hack at the source, you will need to download [CommandBox](http://www.ortussolutions.com/products/commandbox) first. Then in the root of this project, type `box install`. This will download the necessary dependencies to develop and test the core. You can then go ahead and start an embedded server `box server start` and start hacking around. For running our test suites you will need 2 more steps, so please refer to the [Readme](tests/readme.md) in the tests folder.--- ###THE DAILY BREAD > "I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
Expand Down
9 changes: 3 additions & 6 deletions system/ioc/config/Binder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -982,16 +982,13 @@ Description :
<!--- processMappings --->
<cffunction name="processMappings" output="false" access="public" returntype="any" hint="Process all registered mappings, called by injector when ready to start serving requests">
<cfscript>
var key = "";
var thisMapping = "";

// iterate over declared mappings,process, announce, eager and the whole nine yards
for(key in instance.mappings){
thisMapping = instance.mappings[key];
for( var key in instance.mappings ){
var thisMapping = instance.mappings[ key ];
// has it been discovered yet?
if( NOT thisMapping.isDiscovered() ){
// process the metadata
thisMapping.process(binder=this,injector=instance.injector);
thisMapping.process( binder=this, injector=instance.injector );
// is it eager?
if( thisMapping.isEagerInit() ){
instance.injector.getInstance( thisMapping.getName() );
Expand Down
60 changes: 37 additions & 23 deletions system/web/services/ModuleService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,16 @@ I oversee and manage ColdBox modules
<cfscript>
var modules = controller.getSetting( "modules" );
var iData = {};
var y = 1;
var key = "";
var interceptorService = controller.getInterceptorService();
var wirebox = controller.getWireBox();

// If module not registered, throw exception
if( NOT structKeyExists( modules, arguments.moduleName ) ){
throw( message="Cannot activate module: #arguments.moduleName#",
detail="The module has not been registered, register the module first and then activate it.",
type="ModuleService.IllegalModuleState" );
throw(
message = "Cannot activate module: #arguments.moduleName#",
detail = "The module has not been registered, register the module first and then activate it.",
type = "ModuleService.IllegalModuleState"
);
}

// Check if module already activated
Expand All @@ -384,29 +384,34 @@ I oversee and manage ColdBox modules
var mConfig = modules[ arguments.moduleName ];

// Do we have dependencies to activate first
if( arrayLen( mConfig.dependencies ) ){
for( var thisDependency in mConfig.dependencies ){
if( instance.logger.canDebug() ){
instance.logger.debug( "Activating #arguments.moduleName# requests dependency activation: #thisDependency#" );
}
// Activate dependency first
activateModule( thisDependency );
for( var thisDependency in mConfig.dependencies ){
if( instance.logger.canDebug() ){
instance.logger.debug( "Activating #arguments.moduleName# requests dependency activation: #thisDependency#" );
}
// Activate dependency first
activateModule( thisDependency );
}

// lock and load baby
lock name="module.#getController().getAppHash()#.activation.#arguments.moduleName#" type="exclusive" timeout="20" throwontimeout="true"{
lock name="module.#getController().getAppHash()#.activation.#arguments.moduleName#"
type="exclusive"
timeout="20"
throwontimeout="true"
{

// preModuleLoad interception
iData = { moduleLocation=mConfig.path,moduleName=arguments.moduleName };
var iData = { moduleLocation=mConfig.path, moduleName=arguments.moduleName };
interceptorService.processState( "preModuleLoad", iData );

// Register handlers
mConfig.registeredHandlers = controller.getHandlerService().getHandlerListing( mconfig.handlerPhysicalPath );
mConfig.registeredHandlers = arrayToList( mConfig.registeredHandlers );

// Register the Config as an observable also.
interceptorService.registerInterceptor( interceptorObject=instance.mConfigCache[ arguments.moduleName ], interceptorName="ModuleConfig:#arguments.moduleName#" );
interceptorService.registerInterceptor(
interceptorObject = instance.mConfigCache[ arguments.moduleName ],
interceptorName = "ModuleConfig:#arguments.moduleName#"
);

// Register Models if it exists
if( directoryExists( mconfig.modelsPhysicalPath ) and mConfig.autoMapModels ){
Expand All @@ -418,21 +423,30 @@ I oversee and manage ColdBox modules
// just register with no namespace
wirebox.getBinder().mapDirectory( packagePath=packagePath );
}
wirebox.getBinder().processMappings();
}

// Register Interceptors with Announcement service
for( y=1; y lte arrayLen( mConfig.interceptors ); y++ ){
interceptorService.registerInterceptor( interceptorClass=mConfig.interceptors[ y ].class,
interceptorProperties=mConfig.interceptors[ y ].properties,
interceptorName=mConfig.interceptors[ y ].name);
for( var y=1; y lte arrayLen( mConfig.interceptors ); y++ ){
interceptorService.registerInterceptor(
interceptorClass = mConfig.interceptors[ y ].class,
interceptorProperties = mConfig.interceptors[ y ].properties,
interceptorName = mConfig.interceptors[ y ].name
);
// Loop over module interceptors to autowire them
wirebox.autowire( target=interceptorService.getInterceptor( mConfig.interceptors[ y ].name, true ),
targetID=mConfig.interceptors[ y ].class );
wirebox.autowire(
target = interceptorService.getInterceptor( mConfig.interceptors[ y ].name, true ),
targetID= mConfig.interceptors[ y ].class
);
}

// Register module routing entry point pre-pended to routes
if( controller.settingExists( 'sesBaseURL' ) AND len( mConfig.entryPoint ) AND NOT find( ":", mConfig.entryPoint ) ){
interceptorService.getInterceptor( "SES", true ).addModuleRoutes( pattern=mConfig.entryPoint, module=arguments.moduleName, append=false );
if( controller.settingExists( 'sesBaseURL' ) AND
len( mConfig.entryPoint ) AND NOT
find( ":", mConfig.entryPoint )
){
interceptorService.getInterceptor( "SES", true )
.addModuleRoutes( pattern=mConfig.entryPoint, module=arguments.moduleName, append=false );
}

// Call on module configuration object onLoad() if found
Expand Down

0 comments on commit eeae549

Please sign in to comment.