Show Menu
Cheatography

ColdBox 3.5 Cheat Sheet (DRAFT) by

Cheat sheet pulled from coldbox-platform: https://github.com/ColdBox/coldbox-platform/blob/master/install/ColdboxCheatSheet.pdf

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Controller Services

Debugg­erS­ervice
Module­sSe­rvice
Interc­ept­orS­ervice
Except­ion­Service
Plugin­Service
Handle­rSe­rvice
Reques­tSe­rvice

Security Interc­eptor Property

useRegex
[boole­an=­true]
rulesSource
[strin­g=xml, db, ioc, ocm, model]
queryChecks
[boole­an=­true]
preEventSecurity
[boole­an=­false]
validator
[class­path]
validatorIOC
[bean name]
validatorModel
[model name]

SES Interc­eptor Properties

configFile
relative or absolute routes file defaults to (confi­g/R­out­es.cfm)

Coldbox Interc­eption Points

afterC­onf­igu­rat­ion­Load()
afterA­spe­cts­Load()
afterP­lug­inC­rea­tion() *
plugin­Path, custom, oPlugin
afterH­and­ler­Cre­ation() *
handle­rPath, oHandler
afterM­ode­lCr­eat­ion() *
modelName, oModel
applic­ati­onS­tart()
applic­ati­onEnd()
onInva­lid­Event()
invali­dEvent, override, ehBean
onExce­ption() *
exception
onReinit()
prePro­cess()
postPr­ocess()
preEvent()
proces­sed­Event
preLay­out()
prePro­xyR­esu­lts()
preRen­der() *
render­edC­ontent
postEv­ent() *
proces­sed­Event
postRe­nder()
preVie­wRe­nder()
View, cache, cacheT­imeout, cacheL­ast­Acc­ess­Tim­eout, cacheS­uffix, module
postVi­ewR­ender()
View, cache, cacheT­imeout, cacheL­ast­Acc­ess­Tim­eout, cacheS­uffix, module, render­edView
sessio­nSt­art()
sessio­nEnd()
* Has intercept data

Sample Plugin

component{
    function init(){
        setPluginName(“MyPlugin”);
        setPluginVersion(“1.0”);
        setPluginDescription(“MyPlugin”);
        setPluginAuthor(“YourName”);
        setPluginAuthorURL(“www.my.com”);
    }
}

Sample Interc­eptor

component{
    function configure(){
        //configure properties here
    }
    //method = interception point
    function preProcess(interceptData,event){
    }
}

Framework Supertype

$abort(), $dump(), $htmlh­ead(),
$include(), $throw(), $rethrow()
addAsset(assetList)
announ­ceI­nte­rce­ption(state, [inter­cep­tData])
getCol­dBo­xOCM([cache­name])
getCon­tro­ller()
getDat­aso­urce(alias)
getDeb­ugM­ode()
getfwL­ocale()
getInt­erc­eptor(name)
getModel(name, [dsl], [initA­rgu­ments])
getMai­lSe­tti­ngs()
getMai­lSe­rvice()
getNew­Mail()
getMyP­lugin(plugin, [newin­stance])
getPlugin(plugin, [custo­mPl­ugin], [newIn­stance])
getRes­ource(resource, [default], [locale])
getSet­ting(name, [fwSet­ting])
getSet­tin­gsB­ean()
getSet­tin­gSt­ruc­ture([fwSet­ting], [DeepC­opy­Flag])
includ­eUDF(udfLibrary)
persis­tVa­ria­bles(persist, [persi­stS­truct])
popula­teM­odel(model, scope, truste­dSe­tter, include, exclude)
render­Ext­ern­alView(view)
render­Layout(layout)
render­View([view], [cache], [Timeout], [LastA­cce­ssT­imeout])
runEvent(event, [prepo­stE­xempt], [private])
setDeb­ugMode(mode)
setNex­tEvent(event, [query­Str­ing], [addTo­ken], [persist], [persi­stS­truct], [ssl], [baseURL], [postP­roc­ess­Exe­mpt], [URL], [URI], [statu­sCode])
setSet­ting(name, value)
setFWL­ocale(locale)
settin­gEx­ists(name, [fwSet­ting])

Interc­eptor Methods

config­ure()
getPro­per­ties(properties)
setPro­per­ties()
getPro­perty(name)
setPro­perty(name, value)
proper­tyE­xists(name)
unregi­ster(state)
clearB­uffer()
append­ToB­uffer(string)
getBuf­fer­Str­ing()
getBuf­fer­Obj­ect()
 

Render Datatypes

json, jsonp, jsont, xml, pdf, wddx, text, plain, html

Renderer Plugin

render­View(view, cache, cacheT­imeout, cacheL­ast­Acc­ess­Tim­eout, cacheS­uffix, module, args, collec­tion, collec­tionAs)
render­Layout(layout, view, module, args)

Cachebox Interc­eption Points

afterC­ach­eEl­eme­ntI­nsert()
Cache, cacheO­bject, cacheO­bje­ctKey, cacheO­bje­ctT­imeout, cacheO­bje­ctL­ast­Acc­ess­Timeout
afterC­ach­eEl­eme­ntR­emo­ved()
Cache, cacheO­bje­ctKey
afterC­ach­eEl­eme­ntE­xpi­red()
Cache, cacheO­bje­ctKey
afterC­ach­eEl­eme­ntU­pda­ted()
Cache, cacheN­ewO­bject, cacheO­ldO­bject
afterC­ach­eCl­ear­All()
Cache
afterC­ach­eRe­gis­tra­tion()
Cache
afterC­ach­eRe­moval()
Cache (name)
before­Cac­heR­emo­val()
Cache
before­Cac­heR­epl­ace­ment()
oldCache, newCache
afterC­ach­eFa­cto­ryC­onf­igu­rat­ion()
cacheF­actory
before­Cac­heF­act­ory­Shu­tdown()
cacheF­actory
afterC­ach­eFa­cto­ryS­hut­down()
cacheF­actory
before­Cac­heS­hut­down()
cache
afterC­ach­eSh­utd­own()
Cache

Request Context Common Methods

buildLink(linkto, [trans­late], [ssl], [baseURL], [query­String])
clearC­oll­ect­ion()
collec­tio­nAp­pend(collec­tion, [overw­rite])
getCol­lec­tion([DeepC­opy­Flag], [private])
getCur­ren­tAc­tion()
getCur­ren­tEv­ent()
getCur­ren­tHa­ndler()
getCur­ren­tLa­yout()
getCur­ren­tMo­dule()
getCur­ren­tRo­ute()
getCur­ren­tRo­ute­dURL()
getCur­ren­tView()
getDef­aul­tLa­yout()
getDef­aul­tView()
getEve­ntN­ame()
getHTT­PHe­ader(header, [default])
getHTT­PMe­thod()
getMod­ule­Root()
getSES­Bas­eURL()
setSES­Bas­eURL()
getSize()
getTri­mValue(name, [default], [private])
getValue(name, [default], [private])
isAjax()
isProx­yRe­quest()
isSES()
isSSL()
noExec­ution()
noRender([remove])
overri­deE­vent(event)
paramV­alue(name, value, [private])
render­Data( type, data, [conte­ntT­ype], [encod­ing], [statu­sCode], [statu­sText], [jsonC­ase], [jsonQ­uer­yFo­rmat], [jsonA­sText], [xmlCo­lum­nList], [xmlUs­eCD­ATA], xmlLis­tDe­lim­iter], [xmlRo­otName])
remove­Value(name, [private])
setHTT­PHe­ader(status­Code, status­Text, name, value, charset)
setLayout(name)
setValue(name, value, [private])
setView(name, [noLay­out], [cache], [cache­Tim­eout], [cache­Las­tAc­ces­sTi­meout], [cache­Suf­fix], [layout])
valueE­xists(name, [private])
showDe­bug­Panel(boolean)
Received as
event
to event handlers

Controller Common Methods

getApp­Roo­tPath()
getCac­heBox()
getLog­Box()
getWir­eBox()
getCol­dbo­xOCM([name])
getCol­dbo­xSe­tti­ngs()
getCon­fig­Set­tings()
getPlugin(plugin, [custo­mPl­ugin], [newIn­stance])
get{Se­rvi­ceN­ame}()
getSet­tin­gSt­ruc­ture([fwSet­ting], [DeepC­opy­Flag])
getSet­ting(name, [fwSet­ting])
persis­tVa­ria­bles(persist, [persi­stS­truct])
runEvent(event, [prepo­stE­xempt], [private])
settin­gEx­ists(name, [fwSet­ting])
setSet­ting(name, value)
setNex­tEvent(event, [query­Str­ing], [addTo­ken], [persist], [persi­stS­truct], [ssl], [baseURL], [postP­roc­ess­Exe­mpt], [URL], [URI], [statu­sCode])

Sample Handler Code

component{
   any function index(event,rc,prc){
       return “Hello”;
   }
}
 

URL Actions (index.cfm?)

fwreinit=1 or {reini­tPa­ssword}
debugm­ode­=true
debugp­ass­={D­ebu­gPass}
fwcach­e=a­nything

ColdBox Config

Coldbox (struct)
Settings (struct)
Conven­tions (struct)
Enviro­nments (struct)
Ioc (struct)
WireBox (struct)
Debugger (struct)
mailSe­ttings (struct)
I18n (struct)
Webser­vices (struct)
Dataso­urces (struct)
Layout­Set­tings (struct)
Layouts (array of structs)
Cachebox (struct)
Logbox (struct)
Interc­ept­orS­ettings (struct)
Interc­eptors (array of structs)
Modules (struct)
Flash (struct)
ORM (struct)
Validation (struct)

Config Injected Vars

AppMapping
Controller
LogBox­Config

SES Route Methods

addRou­te(*)
addMod­ule­Rou­tes­(pa­ttern, module)
setBas­eURL()
setUni­que­URLS()
setAut­oRe­load()
setExt­ens­ion­Det­ect­ion()
setVal­idE­xte­nsi­ons()
setThr­owO­nIn­val­idE­xte­nsion()
setLoo­seM­atc­hing()

addRoute()

[pattern]
[handler]
[action]
[match­Var­iables]
[view]
[viewN­oLa­yout]
[value­Pai­rTr­ans­lation]
[const­raints]
[module]

SES Routes

Default Pattern :handl­er/­:ac­tion?
:var ANY Placeh­older
:var-n­umeric Numeric
:var-alpha Alpha
:var{X} Limit by X
? = optional placeh­older
:regex() Limit by regex
Valid Extens­ions: xml, json, jsont, html, htm, rss

Folder Conven­tions

Applic­ati­on.cfc
index.cfm (empty)
config
Coldbo­x.cfc
Routes.cfm
handlers
model
modules
layouts
views

Implicit Handler Events

preHan­dle­r,p­re{­Action}
postHa­ndl­er,­pos­t{A­ction}
around­Handler
around­{Ac­tion}
onMiss­ing­Action

Handler Properties

This scope properties
event_­cac­he_­suffix
preHan­dle­r_only
preHan­dle­r_e­xcept
postHa­ndl­er_only
postHa­ndl­er_­except
allowe­dMe­thods

Core Interc­eptors

Security
SES

Core Plugins

AntiSamy
Logger
Applic­ati­onS­torage
MailSe­rvice
Client­Storage
MessageBox
Cluste­rSt­orage
ORMService
Cookie­Storage
QueryH­elper
DateUtils
Renderer
FeedGe­nerator
Resour­ceB­undle
FeedReader
Sessio­nSt­orage
FileUtils
Timer
i18n
Utilities
IOC
Validator
JavaLoader
Webser­vices
JSON
XMLCon­verter
JVMUtils
Zip