-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
62 lines (55 loc) · 1.63 KB
/
Copy pathModuleConfig.cfc
File metadata and controls
62 lines (55 loc) · 1.63 KB
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
/**
* Copyright since 2020 by Ortus Solutions, Corp
* www.ortussolutions.com
* ---
*/
component {
// Module Properties
this.title = "validation"
this.author = "Luis Majano"
this.webURL = "https://www.ortussolutions.com"
this.description = "This module provides server-side validation to ColdBox applications"
this.version = "@build.version@+@build.number@"
// Model Namespace
this.modelNamespace = "cbvalidation"
// CF Mapping
this.cfmapping = "cbvalidation"
// Helpers
this.applicationHelper = [ "helpers/Mixins.cfm" ]
// Module Dependencies That Must Be Loaded First, use internal names or aliases
this.dependencies = [ "cbi18n" ]
variables.managerClass = "cbvalidation.models.ValidationManager"
/**
* Configure module
*/
function configure(){
// Mixin our own methods on handlers, interceptors and views via the ColdBox UDF Library File setting
variables.settings = {
// The default Validation manager
manager : variables.managerClass,
// Global constraints
sharedConstraints : {}
}
}
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
// Did you change the validation manager?
if ( variables.settings.manager != variables.managerClass ) {
binder
.map( alias = "validationManager@cbvalidation", force = true )
.to( variables.settings.manager )
.asSingleton()
}
// setup shared constraints
wirebox
.getInstance( "validationManager@cbvalidation" )
.setSharedConstraints( variables.settings.sharedConstraints )
}
/**
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
}
}