-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
ModuleConfig.cfc
112 lines (102 loc) · 4.37 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
110
111
112
/**
* Copyright Ortus Solutions, Corp
* www.ortussolutions.com
* ---
* This module connects your application to Amazon S3
**/
component {
// Module Properties
this.title = "Amazon S3 SDK";
this.author = "Ortus Solutions, Corp";
this.webURL = "https://www.ortussolutions.com";
this.description = "This SDK will provide you with Amazon S3 connectivity for any ColdFusion (CFML) application.";
// Module Entry Point
this.entryPoint = "s3sdk";
// Model Namespace
this.modelNamespace = "s3sdk";
// CF Mapping
this.cfmapping = "s3sdk";
// Auto-map models
this.autoMapModels = false;
/**
* Configure
*/
function configure(){
// Settings
variables.settings = {
accessKey : "",
autoContentType : false,
autoMD5 : false,
awsDomain : "amazonaws.com",
awsRegion : "us-east-1",
debug : false,
defaultACL : "public-read",
defaultBucketName : "",
defaultCacheControl : "no-store, no-cache, must-revalidate",
defaultDelimiter : "/",
defaultStorageClass : "STANDARD",
defaultTimeOut : 300,
encryptionCharset : "utf-8",
retriesOnError : 3,
secretKey : "",
serviceName : "s3",
signatureType : "V4",
ssl : true,
throwOnRequestError : true,
defaultEncryptionAlgorithm : "",
defaultEncryptionKey : "",
defaultObjectOwnership : "ObjectWriter",
defaultBlockPublicAcls : false,
defaultIgnorePublicAcls : false,
defaultBlockPublicPolicy : false,
defaultRestrictPublicBuckets : false,
urlStyle : "path"
};
}
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
binder
.map( "AmazonS3@s3sdk" )
.to( "#moduleMapping#.models.AmazonS3" )
.initArg( name = "accessKey", value = variables.settings.accessKey )
.initArg( name = "secretKey", value = variables.settings.secretKey )
.initArg( name = "awsDomain", value = variables.settings.awsDomain )
.initArg( name = "awsRegion", value = variables.settings.awsregion )
.initArg( name = "encryptionCharset", value = variables.settings.encryptionCharset )
.initArg( name = "signatureType", value = variables.settings.signatureType )
.initArg( name = "ssl", value = variables.settings.ssl )
.initArg( name = "defaultTimeOut", value = variables.settings.defaultTimeOut )
.initArg( name = "defaultDelimiter", value = variables.settings.defaultDelimiter )
.initArg( name = "defaultBucketName", value = variables.settings.defaultBucketName )
.initArg( name = "defaultCacheControl", value = variables.settings.defaultCacheControl )
.initArg( name = "defaultStorageClass", value = variables.settings.defaultStorageClass )
.initArg( name = "defaultACL", value = variables.settings.defaultACL )
.initArg( name = "throwOnRequestError", value = variables.settings.throwOnRequestError )
.initArg( name = "autoContentType", value = variables.settings.autoContentType )
.initArg( name = "autoMD5", value = variables.settings.autoMD5 )
.initArg( name = "serviceName", value = variables.settings.serviceName )
.initArg( name = "debug", value = variables.settings.debug )
.initArg( name = "defaultEncryptionAlgorithm", value = variables.settings.defaultEncryptionAlgorithm )
.initArg( name = "defaultEncryptionKey", value = variables.settings.defaultEncryptionKey )
.initArg( name = "defaultObjectOwnership", value = variables.settings.defaultObjectOwnership )
.initArg( name = "defaultBlockPublicAcls", value = variables.settings.defaultBlockPublicAcls )
.initArg( name = "defaultIgnorePublicAcls", value = variables.settings.defaultIgnorePublicAcls )
.initArg( name = "defaultBlockPublicPolicy", value = variables.settings.defaultBlockPublicPolicy )
.initArg(
name = "defaultRestrictPublicBuckets",
value = variables.settings.defaultRestrictPublicBuckets
).initArg(
name = "urlStyle",
value = variables.settings.urlStyle
);
binder.map( "Sv4Util@s3sdk" ).to( "#moduleMapping#.models.AmazonS3" );
binder.map( "Sv2Util@s3sdk" ).to( "#moduleMapping#.models.AmazonS3" );
}
/**
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
}
}