Created
May 27, 2016 20:41
-
-
Save gpickin/56b972e46bb4d158f46f3f77a6b65934 to your computer and use it in GitHub Desktop.
Module Config generated by Commandbox create module command
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
/** | |
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 | |
- datasources : struct (will append and override parent) | |
- 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) | |
- routes : array Allowed keys are same as the addRoute() method of the SES interceptor. | |
- 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 = "customModule2"; | |
this.author = "Gavin Pickin"; | |
this.webURL = "http://www.gpickin.com"; | |
this.description = "Custom Module 2"; | |
this.version = "1.2.3"; | |
// 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 = "customModule2"; | |
// Model Namespace | |
this.modelNamespace = "customModuleName"; | |
// CF Mapping | |
this.cfmapping = "customModule2Mapping"; | |
// Auto-map models | |
this.autoMapModels = true; | |
// Module Dependencies | |
this.dependencies = []; | |
function configure(){ | |
// parent settings | |
parentSettings = { | |
}; | |
// module settings - stored in modules.name.settings | |
settings = { | |
}; | |
// Layout Settings | |
layoutSettings = { | |
defaultLayout = "" | |
}; | |
// datasources | |
datasources = { | |
}; | |
// SES Routes | |
routes = [ | |
// Module Entry Point | |
{ pattern="/", handler="home", action="index" }, | |
// Convention Route | |
{ pattern="/:handler/:action?" } | |
]; | |
// Custom Declared Points | |
interceptorSettings = { | |
customInterceptionPoints = "" | |
}; | |
// Custom Declared Interceptors | |
interceptors = [ | |
]; | |
// Binder Mappings | |
// binder.map("Alias").to("#moduleMapping#.model.MyService"); | |
} | |
/** | |
* Fired when the module is registered and activated. | |
*/ | |
function onLoad(){ | |
} | |
/** | |
* Fired when the module is unregistered and unloaded | |
*/ | |
function onUnload(){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment