-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleConfig.cfc
109 lines (98 loc) · 3.7 KB
/
ModuleConfig.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* 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 = "cbDashboard";
this.author = "Dan Card";
this.webURL = "";
this.description = "";
this.version = "0.0.1";
// 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 = "cbDashboard";
// Inherit Entry Point
this.inheritEntryPoint = false;
// Model Namespace
this.modelNamespace = "cbDashboard";
// CF Mapping
this.cfmapping = "cbDashboard";
// Auto-map models
this.autoMapModels = true;
// Module Dependencies
this.dependencies = [ "UIME" ];
/**
* Configure the module
*/
function configure(){
// parent settings
parentSettings = { defaultEvent : "cbDashboard:homepage.index" };
// module settings - stored in modules.name.settings
// Layout Settings
layoutSettings = { defaultLayout : "" };
// Custom Declared Points
interceptorSettings = { customInterceptionPoints : [] };
// Custom Declared Interceptors
interceptors = [
{
class : "cbDashboard.interceptors.cbDashboard", // by default this should be interceptors.yourcfcname
name : "cbDashboard",
properties : {
// configuration
}
}
];
// 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(){
}
}