Skip to content

Commit cc307cd

Browse files
committed
COLDBOX-1387 #resolve
Deprecate this.cfmapping on module configuration and use this.mapping instead.
1 parent 8f44357 commit cc307cd

18 files changed

Lines changed: 42 additions & 42 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The ColdBox framework includes several core services in `/system/web/services/`
6767
- **HandlerService.cfc**: Manages event handling, handler caching, event caching, and handler execution lifecycle
6868
- **InterceptorService.cfc**: Manages interception points, interceptor registration, and announcement of framework events
6969
- **LoaderService.cfc**: Responsible for loading and configuring a ColdBox application with all its services during startup
70-
- **ModuleService.cfc**: Oversees HMVC module management including registration, activation, and CF mapping management
70+
- **ModuleService.cfc**: Oversees HMVC module management including registration, activation, and Engine mapping management
7171
- **RequestService.cfc**: Handles request context preparation, FORM/URL processing, and flash scope management
7272
- **RoutingService.cfc**: Manages URL routing, route registration, and request-to-handler mapping via the Router component
7373
- **SchedulerService.cfc**: Manages application schedulers in an HMVC fashion for background task execution

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cfml.mappings": [
2+
"boxlang.cfml.mappings": [
33
{
44
"logicalPath": "/coldbox",
55
"directoryPath": ".",

system/Bootstrap.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ component serializable="false" accessors="true" {
149149
if (
150150
structKeyExists( application, appKey ) AND application[ appKey ].getColdboxInitiated() AND needReinit
151151
) {
152-
// Load Module CF Mappings so modules can unload properly
152+
// Load Module Engine Mappings so modules can unload properly
153153
application[ appKey ].getModuleService().loadMappings();
154154
// process preReinit interceptors
155155
application[ appKey ].getInterceptorService().announce( "preReinit" );

system/modules/HTMLHelper/ModuleConfig.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ component {
77
this.title = "HTML Helper";
88
// Model Namespace
99
this.modelNamespace = "HTMLHelper";
10-
// CF Mapping
11-
this.cfmapping = "HTMLHelper";
10+
// Engine Mapping
11+
this.mapping = "HTMLHelper";
1212
// Auto-map models
1313
this.autoMapModels = true;
1414
// Helpers
1515
this.applicationHelper = [ "helpers/Mixins.cfm" ];
1616

1717
function configure(){
1818
// module settings - stored in modules.name.settings
19-
settings = {
19+
variables.settings = {
2020
// The base path of JS assets
2121
js_path : "/includes/js/",
2222
// The base path of CSS assets

system/remote/ColdboxProxy.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ component serializable="false" accessors="true" {
4949
try {
5050
// Locate ColdBox Controller
5151
var cbController = getController();
52-
// Load Module CF Mappings
52+
// Load Module Engine Mappings
5353
cbController.getModuleService().loadMappings();
5454
// Create the request context
5555
var event = cbController.getRequestService().requestCapture( proxyCall: true );

system/testing/VirtualApp.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ component accessors="true" {
7373
overrideAppMapping = variables.appMapping,
7474
overrideWebMapping = variables.webMapping
7575
);
76-
// Load Module CF Mappings so modules can work properly
76+
// Load Module Engine Mappings so modules can work properly
7777
application.cbController.getModuleService().loadMappings();
7878
// back to the future!
7979
return application.cbController;

system/web/services/ModuleService.cfc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
334334
autoProcessModels : false,
335335
// Does the module belong to a bundle or not
336336
bundle : arguments.bundle,
337-
// ColdFusion mapping
338-
cfmapping : "",
337+
// Engine mapping
338+
mapping : "",
339339
// Child modules
340340
childModules : [],
341341
// Module Conventions
@@ -480,11 +480,10 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
480480
mConfig.schedulerInvocationPath &= ".#mConfig.conventions.schedulerLocation#";
481481
mConfig.schedulerPhysicalPath &= "/#mConfig.conventions.schedulerLocation.replace( ".", "/", "all" )#";
482482

483-
// Register CFML Mapping if it exists, for loading purposes
484-
// TODO: If a duplicate mapping is detected, warn it to logs
485-
if ( len( trim( mConfig.cfMapping ) ) ) {
486-
variables.util.addMapping( name = mConfig.cfMapping, path = mConfig.path );
487-
variables.mappingRegistry[ "/#mConfig.cfMapping#" ] = mConfig.path;
483+
// Register Engine Mapping if it exists, for loading purposes
484+
if ( len( trim( mConfig.mapping ) ) ) {
485+
variables.util.addMapping( name: mConfig.mapping, path: mConfig.path );
486+
variables.mappingRegistry[ "/#mConfig.mapping#" ] = mConfig.path;
488487
}
489488

490489
// Register Custom Interception Points
@@ -564,7 +563,7 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
564563
* Load all module mappings
565564
*/
566565
function loadMappings(){
567-
variables.util.addMapping( mappings = variables.mappingRegistry );
566+
variables.util.addMapping( mappings : variables.mappingRegistry );
568567
return this;
569568
}
570569

@@ -699,7 +698,7 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
699698

700699
// Add as a mapped directory with module name as the namespace with correct mapping path
701700
var packagePath = (
702-
len( mConfig.cfmapping ) ? mConfig.cfmapping & ".#mConfig.conventions.modelsLocation#" : mConfig.modelsInvocationPath
701+
len( mConfig.mapping ) ? mConfig.mapping & ".#mConfig.conventions.modelsLocation#" : mConfig.modelsInvocationPath
703702
);
704703

705704
// Module Injector : Map with no namespace in the local injector
@@ -1098,7 +1097,7 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
10981097
* @parent The parent that invoked the registration
10991098
* @parent The parent injector this module will be linked to
11001099
*
1101-
* @return struct : { config:cfc, injector:cfc }
1100+
* @return struct : { config:class, injector:class }
11021101
*/
11031102
struct function loadModuleConfiguration(
11041103
required struct config,
@@ -1147,9 +1146,10 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
11471146
// version
11481147
param results.config.version = "1.0.0";
11491148
mConfig.version = results.config.version;
1150-
// cf mapping
1149+
// engine mapping: cfmapping is deprecated but we check for it for backward compatibility
11511150
param results.config.cfmapping = "";
1152-
mConfig.cfmapping = results.config.cfmapping;
1151+
param results.config.mapping = "";
1152+
mConfig.mapping = len( results.config.mapping ) ? results.config.mapping : results.config.cfmapping;
11531153
// Module Injector
11541154
param results.config.moduleInjector = false;
11551155
mConfig.moduleInjector = results.config.moduleInjector;

test-harness/modules_app/Inception/ModuleConfig.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ component {
1616
this.modelNamespace = "";
1717
// Auto Map Models Directory
1818
this.autoMapModels = true;
19-
// CF Mapping
20-
this.cfmapping = "";
19+
// Engine Mapping
20+
this.mapping = "";
2121

2222
function configure(){
2323
// parent settings

test-harness/modules_app/Inception/modules/a-inception/ModuleConfig.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ component {
1616
this.modelNamespace = "";
1717
// Auto Map Models Directory
1818
this.autoMapModels = true;
19-
// CF Mapping
20-
this.cfmapping = "";
19+
// Engine Mapping
20+
this.mapping = "";
2121
this.dependencies = [ "Inception" ];
2222

2323
function configure(){

test-harness/modules_app/Inception/modules/inception-mod1/ModuleConfig.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ component {
1616
this.modelNamespace = "";
1717
// Auto Map Models Directory
1818
this.autoMapModels = true;
19-
// CF Mapping
20-
this.cfmapping = "";
19+
// Engine Mapping
20+
this.mapping = "";
2121

2222
function configure(){
2323
// parent settings

0 commit comments

Comments
 (0)