Skip to content

Commit 544e4b8

Browse files
committed
finalized skeletons
1 parent 7810e98 commit 544e4b8

9 files changed

+129
-149
lines changed

skeletons/Coldbox.sublime-snippet

Lines changed: 53 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
<snippet>
22
<content><![CDATA[
33
/**
4-
* ColdBox Configuration File
5-
*/
4+
* ColdBox Configuration File
5+
*/
66
component{
77
8-
// Configure ColdBox Application
8+
/**
9+
* Configure the ColdBox Application
10+
*/
911
function configure(){
1012
1113
// coldbox directives
1214
coldbox = {
13-
//Application Setup
14-
appName = "${1:Your App Name}",
15-
eventName = "event",
16-
17-
//Development Settings
15+
// Application Setup
16+
appName = getSystemSetting( "APPNAME", "${1:Your App Name}" ),
17+
18+
// Development Settings
1819
reinitPassword = "",
1920
handlersIndexAutoReload = true,
2021
21-
//Implicit Events
22-
defaultEvent = "Main.index",
22+
// Implicit Events
23+
defaultEvent = "",
2324
requestStartHandler = "Main.onRequestStart",
2425
requestEndHandler = "",
2526
applicationStartHandler = "Main.onAppInit",
@@ -28,27 +29,28 @@ component{
2829
sessionEndHandler = "",
2930
missingTemplateHandler = "",
3031
31-
//Extension Points
32-
applicationHelper = "includes/helpers/ApplicationHelper.cfm",
33-
ViewsHelper = "",
34-
coldboxExtensionsLocation = "",
32+
// Extension Points
33+
applicationHelper = "includes/helpers/ApplicationHelper.cfm",
34+
viewsHelper = "",
3535
modulesExternalLocation = [],
36-
pluginsExternalLocation = "",
3736
viewsExternalLocation = "",
3837
layoutsExternalLocation = "",
3938
handlersExternalLocation = "",
4039
requestContextDecorator = "",
41-
controllerDecorator = "",
40+
controllerDecorator = "",
4241
43-
//Error/Exception Handling
44-
exceptionHandler = "",
45-
onInvalidEvent = "",
46-
customErrorTemplate = "",
42+
// Error/Exception Handling
43+
invalidHTTPMethodHandler = "",
44+
exceptionHandler = "main.onException",
45+
invalidEventHandler = "",
46+
customErrorTemplate = "",
4747
48-
//Application Aspects
48+
// Application Aspects
4949
handlerCaching = false,
5050
eventCaching = false,
51-
viewCaching = false
51+
viewCaching = false,
52+
// Will automatically do a mapDirectory() on your `models` for you.
53+
autoMapModels = true
5254
};
5355
5456
// custom settings
@@ -65,8 +67,6 @@ component{
6567
6668
// Module Directives
6769
modules = {
68-
//Turn to false in production
69-
autoReload = false,
7070
// An array of modules names to load, empty means all of them
7171
include = [],
7272
// An array of modules names to NOT load, empty means none
@@ -85,68 +85,54 @@ component{
8585
info = [ "coldbox.system" ]
8686
};
8787
88-
//Layout Settings
88+
/ Layout Settings
8989
layoutSettings = {
90-
defaultLayout = "Main.cfm",
90+
defaultLayout = "",
9191
defaultView = ""
9292
};
9393
94-
//Interceptor Settings
94+
// Interceptor Settings
9595
interceptorSettings = {
96-
throwOnInvalidStates = false,
9796
customInterceptionPoints = ""
9897
};
9998
100-
//Register interceptors as an array, we need order
99+
// Register interceptors as an array, we need order
101100
interceptors = [
102-
//SES
103-
{
104-
class="coldbox.system.interceptors.SES"
105-
}
106101
];
107102
108-
/*
109-
// flash scope configuration
110-
flash = {
111-
scope = "session,client,cluster,ColdboxCache,or full path",
112-
properties = {}, // constructor properties for the flash scope implementation
113-
inflateToRC = true, // automatically inflate flash data into the RC scope
114-
inflateToPRC = false, // automatically inflate flash data into the PRC scope
115-
autoPurge = true, // automatically purge flash data for you
116-
autoSave = true // automatically save flash scopes at end of a request and on relocations.
117-
};
103+
// Module Settings
104+
moduleSettings = {
118105
119-
//Register Layouts
120-
layouts = [
121-
{ name = "login",
122-
file = "Layout.tester.cfm",
123-
views = "vwLogin,test",
124-
folders = "tags,pdf/single"
125-
}
126-
];
127-
128-
//Conventions
129-
conventions = {
130-
handlersLocation = "handlers",
131-
pluginsLocation = "plugins",
132-
viewsLocation = "views",
133-
layoutsLocation = "layouts",
134-
modelsLocation = "model",
135-
eventAction = "index"
136106
};
137107
138-
//Datasources
139-
datasources = {
140-
mysite = {name="mySite", dbType="mysql", username="root", password="pass"},
141-
blog_dsn = {name="myBlog", dbType="oracle", username="root", password="pass"}
142-
};
108+
/*
109+
// flash scope configuration
110+
flash = {
111+
scope = "session,client,cluster,ColdboxCache,or full path",
112+
properties = {}, // constructor properties for the flash scope implementation
113+
inflateToRC = true, // automatically inflate flash data into the RC scope
114+
inflateToPRC = false, // automatically inflate flash data into the PRC scope
115+
autoPurge = true, // automatically purge flash data for you
116+
autoSave = true // automatically save flash scopes at end of a request and on relocations.
117+
};
118+
119+
//Conventions
120+
conventions = {
121+
handlersLocation = "handlers",
122+
pluginsLocation = "plugins",
123+
viewsLocation = "views",
124+
layoutsLocation = "layouts",
125+
modelsLocation = "model",
126+
eventAction = "index"
127+
};
128+
143129
*/
144130
145131
}
146132
147133
/**
148-
* Dev environment
149-
*/
134+
* Dev environment
135+
*/
150136
function development(){
151137
coldbox.customErrorTemplate = "/coldbox/system/includes/BugReport.cfm";
152138
}

skeletons/handler.sublime-snippet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<snippet>
22
<content><![CDATA[
33
/**
4-
* ${1:My Event Handler Hint}
5-
*/
4+
* ${1:My Event Handler Hint}
5+
*/
66
component extends="coldbox.system.EventHandler"{
77
88
// OPTIONAL HANDLER PROPERTIES
@@ -35,8 +35,8 @@ component extends="coldbox.system.EventHandler"{
3535
*/
3636
3737
/**
38-
* Index
39-
*/
38+
* Index
39+
*/
4040
any function index( event, rc, prc ){
4141
${0}
4242
}

skeletons/interceptor-point.sublime-snippet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<snippet>
22
<content><![CDATA[
33
/**
4-
* ${1} interception point
5-
*/
6-
function ${1}( required event, required interceptData, required buffer ){
4+
* ${1} interception point
5+
*/
6+
function ${1}( event, interceptData, buffer, rc, prc ){
77
${0}
88
}
99
]]></content>

skeletons/interceptor.sublime-snippet

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<snippet>
22
<content><![CDATA[
33
/**
4-
* ${1:My Interceptor Hint}
5-
*/
4+
* ${1:My Interceptor Hint}
5+
*/
66
component extends="coldbox.system.Interceptor"{
77
8-
// Configure Interceptor
8+
/**
9+
* Configure the interceptor
10+
*/
911
void function configure(){
1012
${0}
1113
}

skeletons/model.sublime-snippet

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<snippet>
22
<content><![CDATA[
33
/**
4-
* ${1:My Hint}
5-
*/
6-
component{
4+
* ${1:My Hint}
5+
*/
6+
component accessors="true"{
77
88
/**
9-
* Constructor
10-
*/
11-
any function init(){
9+
* Constructor
10+
*/
11+
function init(){
1212
${0}
1313
return this;
1414
}

skeletons/router.sublime-snippet

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<snippet>
2+
<content><![CDATA[
3+
component{
4+
5+
function configure(){
6+
// Set Full Rewrites
7+
setFullRewrites( true );
8+
9+
/**
10+
* --------------------------------------------------------------------------
11+
* App Routes
12+
* --------------------------------------------------------------------------
13+
*
14+
* Here is where you can register the routes for your web application!
15+
* Go get Funky!
16+
*
17+
*/
18+
19+
// A nice healthcheck route example
20+
route("/healthcheck",function(event,rc,prc){
21+
return "Ok!";
22+
});
23+
24+
// A nice RESTFul Route example
25+
route( "/api/echo", function( event, rc, prc ){
26+
return {
27+
"error" : false,
28+
"data" : "Welcome to my awesome API!"
29+
};
30+
} );
31+
32+
// Conventions based routing
33+
route( ":handler/:action?" ).end();
34+
}
35+
36+
}
37+
]]></content>
38+
<tabTrigger>router</tabTrigger>
39+
<scope>source,text</scope>
40+
<description>New ColdBox Router</description>
41+
</snippet>

skeletons/routes.sublime-snippet

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)