-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#162 CBWIRE is unable to load wires located in an external module loc…
…ation
- Loading branch information
1 parent
f047d9a
commit 4a09564
Showing
10 changed files
with
254 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
test-harness/modules_external/ExternalModule/ModuleConfig.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/** | ||
* Module Directives as public properties | ||
* | ||
* this.title = "Title of the module"; | ||
* this.author = "Author of the module"; | ||
* this.webURL = "Web URL for docs purposes"; | ||
* this.description = "Module description"; | ||
* this.version = "Module Version"; | ||
* this.viewParentLookup = (true) [boolean] (Optional) // If true, checks for views in the parent first, then it the module.If false, then modules first, then parent. | ||
* this.layoutParentLookup = (true) [boolean] (Optional) // If true, checks for layouts in the parent first, then it the module.If false, then modules first, then parent. | ||
* this.entryPoint = "" (Optional) // If set, this is the default event (ex:forgebox:manager.index) or default route (/forgebox) the framework will use to create an entry link to the module. Similar to a default event. | ||
* this.cfmapping = "The CF mapping to create"; | ||
* this.modelNamespace = "The namespace to use for registered models, if blank it uses the name of the module." | ||
* this.dependencies = "The array of dependencies for this module" | ||
* | ||
* structures to create for configuration | ||
* - parentSettings : struct (will append and override parent) | ||
* - settings : struct | ||
* - interceptorSettings : struct of the following keys ATM | ||
* - customInterceptionPoints : string list of custom interception points | ||
* - interceptors : array | ||
* - layoutSettings : struct (will allow to define a defaultLayout for the module) | ||
* - wirebox : The wirebox DSL to load and use | ||
* | ||
* Available objects in variable scope | ||
* - controller | ||
* - appMapping (application mapping) | ||
* - moduleMapping (include,cf path) | ||
* - modulePath (absolute path) | ||
* - log (A pre-configured logBox logger object for this object) | ||
* - binder (The wirebox configuration binder) | ||
* - wirebox (The wirebox injector) | ||
* | ||
* Required Methods | ||
* - configure() : The method ColdBox calls to configure the module. | ||
* | ||
* Optional Methods | ||
* - onLoad() : If found, it is fired once the module is fully loaded | ||
* - onUnload() : If found, it is fired once the module is unloaded | ||
**/ | ||
component { | ||
|
||
// Module Properties | ||
this.title = "ExternalModule"; | ||
this.author = ""; | ||
this.webURL = ""; | ||
this.description = ""; | ||
this.version = "1.0.0"; | ||
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa | ||
this.viewParentLookup = true; | ||
// If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa | ||
this.layoutParentLookup = true; | ||
// Module Entry Point | ||
this.entryPoint = "ExternalModule"; | ||
// Inherit Entry Point | ||
this.inheritEntryPoint = false; | ||
// Model Namespace | ||
this.modelNamespace = "ExternalModule"; | ||
// CF Mapping | ||
this.cfmapping = ""; | ||
// Auto-map models | ||
this.autoMapModels = true; | ||
// Module Dependencies | ||
this.dependencies = []; | ||
|
||
/** | ||
* Configure the module | ||
*/ | ||
function configure(){ | ||
// parent settings | ||
parentSettings = {}; | ||
|
||
// module settings - stored in modules.name.settings | ||
settings = {}; | ||
|
||
// Layout Settings | ||
layoutSettings = { defaultLayout : "" }; | ||
|
||
// Custom Declared Points | ||
interceptorSettings = { customInterceptionPoints : [] }; | ||
|
||
// Custom Declared Interceptors | ||
interceptors = []; | ||
|
||
// Binder Mappings | ||
// binder.map("Alias").to("#moduleMapping#.models.MyService"); | ||
} | ||
|
||
/** | ||
* Fired when the module is registered and activated. | ||
*/ | ||
function onLoad(){ | ||
} | ||
|
||
/** | ||
* Fired when the module is unregistered and unloaded | ||
*/ | ||
function onUnload(){ | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
test-harness/modules_external/ExternalModule/config/Router.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Module Router | ||
* https://coldbox.ortusbooks.com/the-basics/routing/routing-dsl | ||
*/ | ||
component{ | ||
|
||
function configure(){ | ||
|
||
route( "/", "Home.index" ); | ||
|
||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
test-harness/modules_external/ExternalModule/config/Scheduler.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Module Task Scheduler | ||
* https://coldbox.ortusbooks.com/digging-deeper/scheduled-tasks | ||
*/ | ||
component { | ||
|
||
function configure(){ | ||
|
||
/* task( "photoNumbers" ) | ||
.call( () => { | ||
var random = getInstance( "PhotoService" ).getRandom(); | ||
writeDump( var="xxxxxxx> Photo numbers: #random#", output="console" ); | ||
return random; | ||
} ) | ||
.every( 15, "seconds" ) | ||
.delay( 60, "seconds" ) | ||
.onEnvironment( "development" ); */ | ||
|
||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
test-harness/modules_external/ExternalModule/handlers/Home.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* The main module handler | ||
*/ | ||
component{ | ||
|
||
/** | ||
* Module EntryPoint | ||
*/ | ||
function index( event, rc, prc ){ | ||
event.setView( "home/index" ); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
test-harness/modules_external/ExternalModule/views/home/index.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<cfoutput> | ||
<h1>Welcome to my cool module page!</h1> | ||
</cfoutput> |
11 changes: 11 additions & 0 deletions
11
test-harness/modules_external/ExternalModule/wires/should_load_external_modules.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<cfoutput> | ||
<div> | ||
<h1>External Module Loaded</h1> | ||
</div> | ||
</cfoutput> | ||
|
||
<cfscript> | ||
// @startWire | ||
// @endWire | ||
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters