of 3

Cold Box Cheatsheet

Published on March 2020 | Categories: Documents | Downloads: 15 | Comments: 0

Comments

Content

DEFAULT CACHE SETTINGS

FRAMEWORK DEFAULTS

CORE PLUGINS

 Default Timeout = 60 min ! Last Access Timeout = 30 min ! Reap Frequency = 1 min ! Max Objects = 100 ! JVM Threshold = 0 (Unlimited) ! Eviction Policy = LRU ! useLastAccess = True

!

LogFileEncoding = ISO-8859-1 !LogFileMaxSize = 5000kb !LogsMaxArchives = 5 !DefaultFileCharSet = ISO-8859-1 !DefaultLogDirectory = logs !Default Event Name = event MessageboxStorage = session !MessageboxStorage FlashURLPersistScope = session !FlashURLPersistScope

!

!

PLUGINS-INTERCEPTORS-HANDLER

CONTROLLER COMMON METHODS

announceInterception(state,[ announceInterception (state,[interceptData interceptData]) ]) getColdBoxOCM() getColdBoxOCM() () () !getController  getDatasource(alias) !getDatasource(alias) getDebugMode() !getDebugMode() getfwLocale() !getfwLocale() (interceptorClass) (interceptorClass) !getInterceptor  getModel(model,[useSetterInjection],[onCompleteDIUDF], !getModel(model,[useSetterInjection],[onCompleteDIUDF], [debugmode] getMailSettings() !getMailSettings() getMyPlugin(plugin,[newinstance newinstance]) ]) !getMyPlugin(plugin,[ getPlugin(plugin,[customPlugin customPlugin],[ ],[newInstance newInstance]) ]) !getPlugin(plugin,[ getResource(resource) !getResource(resource) getSetting(name, [fwSetting  [fwSetting ]) ]) !getSetting(name, getSettingsBean() !getSettingsBean() getSettingStructure([fwSetting  fwSetting ],[DeepCopyFlag  ],[DeepCopyFlag ]) ]) !getSettingStructure([ htmlhead(content) !htmlhead(content) Include(template) !Include(template) includeUDF(udfLibrary) !includeUDF(udfLibrary) populateModel(model,scope,trustedSetter) !populateModel(model,scope,trustedSetter) persistVariables(persist,[varStruct]) !persistVariables(persist,[varStruct]) relocate(url,[addToken addToken]) ]) !relocate(url,[ renderExternalView(view) !renderExternalView(view) renderView([view],[cache],[Timeout],[LastAccessTimeout]  view],[cache],[Timeout],[LastAccessTimeout] ) !renderView([ runEvent(event,[ prepostExempt   prepostExempt ],[ ],[ private])  private]) !runEvent(event,[ setDebugMode(mode) !setDebugMode(mode) setNextEvent(event,[queryString  queryString ],[addToken ],[addToken],[ ],[ persist   persist ],[varStruct]) ],[varStruct]) !setNextEvent(event,[ setNextRoute(route,[ persist   persist ],[varStruct]) ],[varStruct]) !setNextRoute(route,[ setSetting(name,value) !setSetting(name,value) settingExists(name, [fwSetting  [fwSetting ]) ]) !settingExists(name, throw(message,[detail  detail ],[type ],[type]) ]) !throw(message,[ dump(var, abort), abort), abort() abort() !dump(var,

getAppRootPath() getColdboxOCM() getColdboxOCM() getColdboxSettings() () !getColdboxSettings getConfigSettings() !getConfigSettings() getPlugin(plugin,[customPlugin customPlugin],[ ],[newInstance newInstance]) ]) !getPlugin(plugin,[ getRequestService() !getRequestService() getInterceptorService() () !getInterceptorService getDebuggerService() () !getDebuggerService getExceptionService() () !getExceptionService getSettingStructure([fwSetting  fwSetting ],[DeepCopyFlag  ],[DeepCopyFlag ]) ]) !getSettingStructure([ getSetting(name, [fwSetting  [fwSetting ]) ]) !getSetting(name, persistVariables(persist,[varStruct]) !persistVariables(persist,[varStruct]) runEvent(event,[ prepostExempt   prepostExempt ],[ ],[ private])  private]) !runEvent(event,[ settingExists(name, [fwSetting  [fwSetting ]) ]) !settingExists(name, setSetting(name,value) !setSetting(name,value) setNextEvent(event,[queryString  queryString ],[addToken ],[addToken],[ ],[ persist   persist ],[varStruct]) ],[varStruct]) !setNextEvent(event,[ setNextRoute(route,[ persist   persist ],[varStruct]) ],[varStruct]) !setNextRoute(route,[

!

!

!

!

CUSTOM PLUGIN METHODS

Init() getPluginPath

! !

CUSTOM PLUGIN PROPERTIES (ALL HAVE GET/SET)

pluginName pluginDescription !pluginVersion ! !

COLDBOX CACHE COMMON METHODS

clearAllEvents([ clearAllEvents([async  async ]) ]) clearAllView([ clearAllView([async  async ]) ]) clearByKeySnippet(keySnippet,[regex  regex ],[async  ],[async ]) ]) !clearByKeySnippet(keySnippet,[ clearEvent(eventSnippet,[queryString  queryString ],[async  ],[async ]) ]) !clearEvent(eventSnippet,[ clearKey(objectKey), !clearKey(objectKey), clearKeyMulti(keys,[prefix]) !clearKeyMulti(keys,[prefix]) clearView(viewSnippet,[async  async ]) ]) !clearView(viewSnippet,[ expireAll([async  async ]) ]) !expireAll([ expireByKeySnippet(keySnippet,[ (keySnippet,[regex  regex ],[async  ],[async ]) ]) !expireByKeySnippet expireKey(objectKey) !expireKey(objectKey) get(objectKey), !get(objectKey), getMulti(keys,[prefix]) !getMulti(keys,[prefix]) getCachedObjectMetadata(objectKey) (objectKey) !getCachedObjectMetadata getCachedObjectMetadataMulti(keys,[prefix]) (keys,[prefix]) !getCachedObjectMetadataMulti getCacheStats() !getCacheStats() getItemTypes () !getItemTypes() getObjectPool() !getObjectPool() getpool_metadata() !getpool_metadata() getSize() !getSize() lookup(objectKey) !lookup(objectKey) set(objectKey,MyObject,[Timeout  Timeout ],[LastAccessTimeout  ],[LastAccessTimeout ]) ]) !set(objectKey,MyObject,[ !setMulti(mapping,[timeout],[LastAccessTimeout],[prefix]) reap() !reap() ! !

 AntiSamy  applicationstorage ! beanFactory ! cfcViewer  ! clientstorage ! cookiestorage ! i18n ! ioc ! JavaLoader  ! logger  ! messagebox ! methodInjector  ! MTLogger  ! queryHelper  ! renderer  ! resourceBundle ! sessionstorage ! StringBuffer  ! timer  ! Utilities ! webservices ! XMLParser  ! zip !

CORE INTERCEPTORS

 autowire  Deploy ! environmentControl ! executionTracer  ! ses ! security ! !

URL ACTIONS (INDEX.CFM?)

 fwreinit=1 fwreinit={reinitPassword} fwreinit={reinitPassword} ! debugmode=true debugpass={DebugPass} s} ! debugpass={DebugPas  fwcache=anything ! ! dumpvar=varlist ! debugpanel={panel} ! !

DEBUG PANELS

 cache  cacheviewer  ! profiler  ! !

INTERCEPTOR METHODS

INTERCEPTION POINTS

!

Configure() Configure() getProperties(properties) getProperties(properties) setProperties() !setProperties() getProperty(name) !getProperty(name) setProperty(name, value) !setProperty(name, propertyExists(name) !propertyExists(name) Unregister(state) !Unregister(state) () () , appendToBuffer (string) appendToBuffer (string) !clearBuffer  getBufferString(), getBufferObject() getBufferObject() !getBufferString(),

!

!

!

afterConfigurationLoad, afterAspectsLoad sessionStart, SessionEnd !preProcess, postProcess !preEvent, postEvent preRender, postRender  !preRender, !afterHandlerCreation (handlerPath,oHandler) !afterPluginCreation(pluginPath,oPlugin) afterCacheElementInsert(cacheObjectKey ObjectKey,cacheObjectTimeou ,cacheObjectTimeout) t) !afterCacheElementInsert(cache !afterCacheElementRemoved(cacheObjectKey)

SES ROUTES

:handler/:action?/:id? Tips !? = optional !:var-numeric Numeric Route !:var Alphanumeric Route /package/handler/action ! /package/handler/action ! !

REQUEST CONTEXT COMMON METHODS (RECEIVED AS EVENT)

buildLink(linkto) buildLink(linkto) clearCollection() clearCollection() collectionAppend(collection,[overwrite overwrite]) ]) !collectionAppend(collection,[ getCollection([DeepCopyFlag  DeepCopyFlag ]) ]) !getCollection([ getCurrentAction() !getCurrentAction() getCurrentEvent() !getCurrentEvent() () () !getCurrentHandler  getCurrentLayout() !getCurrentLayout() getCurrentView() !getCurrentView() getDefaultLayout() !getDefaultLayout() getDefaultView() !getDefaultView() getEventName() !getEventName() getFolderLayouts() !getFolderLayouts() () () !getSelf  getSESBaseURL() !getSESBaseURL() getSize() !getSize()

getValue(name,[ getValue (name,[default  default ]) ]) getTrimValue(name,[ getTrimValue (name,[default  default ]) ]) getViewLayouts() !getViewLayouts() isProxyRequest() !isProxyRequest() () () !isNoRender  isSES() !isSES() NoRender ([remove remove]) ]) !NoRender ([ overrideEvent(event) !overrideEvent(event) paramValue (name, value) !paramValue(name, !renderData( type, data, contentType ) removeValue (name) !removeValue(name) setLayout(name) !setLayout(name) setValue(name, value) !setValue(name, setView(name,[noLayout  noLayout ],[cache ],[cache],[ ],[cacheTimeout  cacheTimeout ],[cacheLastAccessTimeout  ],[cacheLastAccessTimeout ]) !setView(name,[ valueExists(name) !valueExists(name) !showDebugPanel (boolean)

!

!

!

!

 Version 2.6.3 © Copyright Ortus Solutions, Corp & Luis Majano ( www.coldboxframework.com )

CACHE CONFIG ELEMENTS

ObjectDefaultTimeout = Minutes ! ObjectDefaultLastAccessTimeout = Minutes ! UseLastAccessTimeouts = Boolean ! MaxObject = Integer (0 = Unlimited) ! ReapFrequency = Minutes ! FreeMemoryPercentageThreshold = Integer Percentage (0 = Unlimited) ! EvictionPolicy = LFU or LRU or FIFO !

 APPLICATION,SESSION,CLIENT STORAGE PLUGINS

clearAll() * deleteVar (name) !exists(name) !getStorage() * !getVar (name, [default ]) !setVar (name, value)

JAVALOADER PLUGIN

create(className) getURLClassLoader () !getVersion() !setup(loadPaths,[loadColdfusionClassPath=false], [ parentClassLoader=])

!

!

!

!

* Clientstorage excluded

JSON PLUGIN

decode(data) encode(data,[queryFormat],[queryKeyCase],[stringNumbers], [formatDate],[columnListFormat] !

BEANFACTORY PLUGIN

create(bean, [callInitFlag=false]) getModel(model) !populateModel(model) !populateBean(FormBean) !populateFromJson(FormBean, JSONString) !populateFromStruct(FormBean, memento) !populateFromQuery(FormBean,qry,RowNumber) !Autowire(target,[useSetterInjection],[annotationCheck], [onDICompleteUDF],[debugmode])

!

! !

LOGGER & MTLOGGER PLUGIN

logEntry(Severity,Message,[ExtraInfo]) logError (Message,[ExceptionStruct ],[ExtraInfo]) !removeLogFile() (message, [extraInfo]) !tracer  !getValidSeverities() ! !

CFC VIEWER

MESSAGEBOX PLUGIN

buildLink(package) buildRootLink() !getaCFC() !getaPacks() !getCFCMetaData(cfcName) !getDirPath() !getLinkBaseURL() !getLinkString() !getLinkType() !getLstAccessTypes() !getRenderingTemplate() !getRootPath() !getStyleSheet() !renderit() !setup(dirpath,[accessTypeFilter ],[dirLink],[jsLink], [RenderingTemplate],[LinkBaseURL])

!

! !

COOKIESTORAGE PLUGIN

setVar (name, value, [expires=1]) !deleteVar (name) !exists(name) !get/setEncryption() !get/setEncryptionAlgorithm() !get/setEncryptionEncoding() !get/setEncriptionKey() !getVar (name, [default]) !setVar (name, value, [expires] !

Append(message), appendArray(messageArray) clearMessage(), getMessage(), isEmpty() !renderIt([clearFlag] ) !setMessage(type,[message],[messageArray ]) !

METHODINJECTOR PLUGIN

injectMixin(UDF) injectPropertyMixin(propertyName,propertyValue,[scope]) !invokerMixin(method,[argCollection],[argList] !removeMixin(UDFName) !removePropertyMixin(propertyName, [scope]) !start(CFC), stop(cfc) ! !

CONFIG SETTINGS

 AppMapping Appname  ApplicationStartHandler  ! !CustomErrorTemplate !CustomEmailBugReport !ColdboxLogsLocation !ConfigAutoReload !DebugMode !DebugPassword !DefaultEvent !EventName !ExceptionHandler  !EnableBugReports !EnableColdfusionLogging !EnableDumpVar  !EnableColdboxLogging !EventCaching !HandlersIndexAutoReload !HandlersExternalLocation !HandlerCaching !IOCFramework !IOCFrameworkReload !IOCDefinitionFile !IOCObjectCaching !MessageboxStyleOverride !ModelsObjectCaching !ModelsSetterInjection !ModelsDICompleteUDF !ModelsDebugMode !ModelsStopRecursion !MyPluginsLocation !onInvalidEvent !OwnerEmail !ProxyReturnCollection !RequestStartHandler  !RequestEndHandler  !RequestContextDecorator  !ReinitPassword !SessionStartHandler  !SessionEndHandler  !UDFLibraryFile !FlashURLPersistScope !BOLD = Required  ! !

QUERYHELPER PLUGIN

HANDLER PROPERTIES doInnerJoin/doLeftOuterJoin(qryLeft,qryRight,LeftJoinColumn, RightJoinColumn,OrderByElement,[caseSensitive]) !doQueryAppend(qryFrom,qryTo) !filterQuery(qry,field,value,cfsqltype) !getColumnArray(qry,columnName) !getCountDistinct(qry,columnName) (qry,columnValue,ColumnName) !getRowNumber  !sortQuery(qry,sortBy,sortOrder) !

This scope properties EVENT_CACHE_SUFFIX !PREHANDLER_ONLY !PREHANDLER_EXCEPT !POSTHANDLER_ONLY !POSTHANDLER_EXCEPT ! !

RENDERER PLUGIN

purgeView(view) renderExternalView(view) !renderLayout() !renderView([view ],[cache],[cacheTimeout], [cacheLastAccessTimeout]) !

IOC PLUGIN

!

configure() getBean(beanName) !getExpandedIOCDefinitionFile() !getIOCDefinitionFile() !getIOCFactory() !getIOCFramework() !reloadDefinitionFile() ! !

TIMER PLUGIN

getTimerScope() logTime(label, tickcount) !Start(label) !Stop(label) ! !

RESOURCEBUNDLE PLUGIN

formatRBString(rbString, substituteValues) getRBKeys( rbFile, [rbLocale]) !getRBString(rbFile,rbKey,[rbLocale]) !getResource(resource) !getResourceBundle(rbFile, [rbLocale]) !loadBundle(rbFile, [rbLocale]) !messageFormat(thisPattern, args, [thisLocale]) !setupInstance() !verifyPattern(pattern) ! !

WEBSERVICES PLUGIN

getWS(name) getWSObj(name) !refreshWS(webservice) ! !

 Version 2.6.3 © Copyright Ortus Solutions, Corp & Luis Majano ( www.coldboxframework.com )

DEBUGGER ELEMENTS

CFECLIPSE SNIPPETS

PersistentRequestProfiler = true !maxPersistentRequestProfilers = 10 !maxRCPanelQueryRows = 50 !InfoPanel @show=true @expanded=true !TracerPanel @show=true @expanded=true !CachePanel @show=true @expanded=false !RCPanel @show=true @expanded=false

!

!

UTILITIES PLUGIN

isCFUUID(inStr) isEmail(str) !isURL(str) (milliseconds) !Sleeper  !createArray(str) !createStruct(str) () !getOSFileSeparator  () !getOSPathSeparator  !getOSName() !getInetHost() !checkCharSet(charset)

getIPAddress() getJavaRuntime() !getJavaVersion() !getJVMFreeMemory() !getJVMTotalMemory() !FileLastModified(filename) !ripExtension(filename) !createFile(filename) !FileCanWrite(filename) !FileCanRead(filename) !isFile(filename)

appendFile(file,contents,[charset ],[checkCharSet ]) FileSize(filename,sizeFormat) !readFile(file,[binary ],[charset ],[checkCharSet ]) !saveFile(file,contents,[charset ],[checkCharSet ]) !removeFile(filename) !isDirectory(filename) !getAbsolutePath(path) !isSSL()

!

!

!

!

!

!

STRINGBUFFER PLUGIN

Append(strIn) Capacity() !Delete(startPos,endPost) !getString() () !getStringBuffer  (inStr,fromPos) !indexOf  (offset,inStr) !insertStr  (inStr,fromPos) !lastIndexOf  !Length() (startPos,endPos, inStr) !replaceStr  () !reverseStr  !setLength(newLength) !Setup(strIn,BufferLen) !subString(startPos,endPos) !

SES INTERCEPTOR PROPERTIES

configFIle : relative or absolute routes file

!

!

ZIP PLUGIN

SES ROUTES

setEnabled( true or false ) : [default=true] setUniqueURLs( true or false ) : [default=false] !setBaseURL( url ) !addCourse(pattern, [handler ],[action],[matchVariables]) ! !

:varname = alphanumeric route :varname-numeric = numeric route !/blog/entry/:year-numeric/:month-numeric !/wiki/:pagename ! !

 AUTOWIRE INTERCEPTOR PROPERTIES

AddFiles( zipFilePath, [files],[directory],[filter],[recurse], [compression],[savePaths]) !DeleteFiles(zipFilePath, files) !Extract( zipFilePath, [ extractPath],[extractFiles],[useFolderNames], [overwriteFiles] !FileList[directory, [filter], [recurse]) !gzipAddFile(gzipFilePath, filePath) !gzipExtract(gzipFilePath, [extractPath]) !List(zipFilePath) !PathFormat(path) !

debugMode : [boolean=false] completeDIMethodName : [string=onDIComplete]

! !

ENVIRONMENTCONTROL INTERCEPTOR PROPERTIES

configFile : relative or absolute file location fireOnInit : [boolean=true]

! !

SECURITY INTERCEPTOR PROPERTY 

useRegex : [boolean=true] useRoutes : [boolean = false] !debugMode : [boolean=false] !rulesSource : [string=xml, db, ioc, ocm] !queryChecks : [boolean=true]  : [classpath] !validator  !validatorIOC : [bean name] ! !

REQUESTSERVICE

getContext()

!

INTERCEPTORSERVICE MODELMAPPINGS

processState(state,interceptData) !registerInterceptor([interceptorClass],[interceptorObject[, [interceptorProperties], [customPoints]) !getInterceptor(InterceptorClass) !appendInterceptionPoints(customPoints) !getInterceptionPoints() !getInterceptionStates() !getStateContainer(state) !Unregister(interceptorClass, state)

buildlink cfcunittest !configcache !controller  !Customplugin !ehm (event handler method) !exists !filterquery !get !getbean !getc - getcollection !getd - getdatasource !getm - getMyPlugin !getp - getPlugin !getr - getResource !gets - getSetting !getself  !getsesbase !Intercept - announceIntercept !loge - logerror  !logentry !logtime !mbclear - messagebox !mbget - messagebox !mbisempty - messagebox !mbrender -messagebox !mbset - messagebox !mxunittest !newconfig !newevent !newhandler  !newinterceptor  !newtest !next - setnextevent !Nextroute - setnextroute !ocm !over - override event !param !persist !Popbean -populatebean !rc !rce - rc external !rem - removeValue !ren - renderview !run - run event !sesbase !set !setl - setlayout !sets - set setting !settinge - setting exists !setv - set view !sortquery !timerstart !timerstop !tracer  !wsget !wsrefresh !

!

addModelMapping(alias,model)

!

This has to be a file named: modelMappings.cfm in your config folder  !

IMPLICIT EVENTS

 preHandler   postHandler  ! onDIComplete ! onMissingAction ! !

DEBUGGERSERVICE

getDebugMode() setDebugMode(debugMode)

! !

 Version 2.6.3 © Copyright Ortus Solutions, Corp & Luis Majano ( www.coldboxframework.com )

Sponsor Documents

Hide

Forgot your password?

Or register your new account on INBA.INFO

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close