ColdBox Platform v3.8.0

coldbox.system.web
Class Controller

WEB-INF.cftags.component
        extended by coldbox.system.web.Controller
Direct Known Subclasses:
MockController , ControllerDecorator

public class Controller
extends WEB-INF.cftags.component

This is the ColdBox Front Controller that dispatches events and manages your ColdBox application.

Constructor Summary
init(any appRootPath, any appKey)
          Constructor
 
Method Summary
 any getAppHash()
          Get AppHash
 any getAppKey()
          Get this application's key in memory space (application scope)
 any getAppRootPath()
          Get this application's physical path
 any<boolean> getAspectsInitiated()
          Get AspectsInitiated
 any getCFMLEngine()
          Get the CFMLEngine utility(coldbox
 any<CacheFactory> getCacheBox()
          Get the application's CacheBox instance as coldbox
 any getColdboxInitiated()
          Get ColdboxInitiated: Boolean
 any<IColdboxApplicationCache> getColdboxOCM([any cacheName='default'])
          Get ColdboxOCM: coldbox
 any<struct> getColdboxSettings()
          I retrieve the ColdBox Settings Structure by Reference
 any<struct> getConfigSettings()
          I retrieve the Config Settings Structure by Reference
 any getDebuggerService()
          Get DebuggerService: coldbox
 any getExceptionService()
          Get ExceptionService: coldbox
 any getHandlerService()
          Get HandlerService: coldbox
 any getInterceptorService()
          Get interceptorService: coldbox
 any getLoaderService()
          Get LoaderService: coldbox
 any<coldbox.system.logging.LogBox> getLogBox()
          Get the application's LogBox instance
 any getMemento()
          Get the controller's internal state
 any getModuleService()
          Get ModuleService: coldbox
 any getPlugin(any plugin, [any customPlugin='false'], [any newInstance='false'], [any module=''], [any init='true'])
          I am the Plugin cfc object factory
 any getPluginService()
          Get PluginService: coldbox
 any getRequestService()
          Get RequestService: coldbox
 any<coldbox.system.web.coldbox> getServices()
          Get all the registered services structure
 any getSetting([any name], [any FWSetting='false'], [any defaultValue])
          I get a setting from the FW Config structures
 any<struct> getSettingStructure([any FWSetting='false'], [any deepCopyFlag='false'])
          Compatability & Utility Method
private any<coldbox.system.core.util.Util> getUtil()
          Create and return a util object
 any getValidationManager()
          Get the validation manager for the application
 any<coldbox.system.logging.LogBox> getWireBox()
          Get the application's LogBox instance
private any invoker(any target, any method, [any argCollection='[runtime expression]'], [any private='false'])
          Method Invoker
 any persistVariables([any persist=''], [any<struct> persistStruct])
          @deprecated DO NOT USE ANYMORE
private any pushTimers()
          Push timers into stack
 any runEvent([any event=''], [any<boolean> prepostExempt='false'], [any<boolean> private='false'], [any<boolean> default='false'], [any<struct> eventArguments='[runtime expression]'])
          I am an event handler runnable factory
private any sendRelocation(any url, [any<boolean> addtoken='false'], [any<numeric> statusCode='0'])
          Send a CF relocation via ColdBox
 any setAppHash(any appHash)
          Set AppHash
 any setAppRootPath(any appRootPath)
          Set this application's physical path
 any setAspectsInitiated(any aspectsInitiated)
          Set AspectsInitiated
 any setCacheBox(any<CacheFactory> cacheBox)
          Set the application's CacheBox instance
 any setColdboxInitiated(any coldboxInitiated)
          Set ColdboxInitiated
 any setColdboxOCM(any coldboxOCM)
          Set ColdboxOCM
 any setColdboxSettings(any<struct> coldboxSettings)
          Set ColdboxSettings
 any setConfigSettings(any<struct> configSettings)
          Set ConfigSettings
 any setDebuggerService(any debuggerService)
          Set DebuggerService
 any setHandlerService(any handlerService)
          Set HandlerService
 any setInterceptorService(any interceptorService)
          Set interceptorService
 any setLoaderService(any loaderService)
          Set LoaderService
 any setLog(any logger)
          Set the class logger object
 any setLogBox(any<coldbox.system.logging.LogBox> logBox)
          Set the logBox instance
 any setModuleService(any moduleService)
          Set ModuleService
 any setNextEvent([string event='[runtime expression]'], [string queryString=''], [boolean addToken='false'], [string persist=''], [struct persistStruct='[runtime expression]'], [boolean ssl], [string baseURL=''], [boolean postProcessExempt='false'], [string URL], [string URI], [numeric statusCode='0'])
          I Set the next event to run and relocate the browser to that event
 any setPluginService(Any pluginService)
          Set PluginService
 any setRequestService(any requestService)
          Set RequestService
 any setSetting([any name], [any value])
          I set a Global Coldbox setting variable in the configstruct, if it exists it will be overrided
 any setValidationManager(any validationManager)
          Store the validation manager for the application
 any setWireBox(any<coldbox.system.ioc.Injector> wireBox)
          Set the WireBox instance
 any<boolean> settingExists(any name, [any FWSetting='false'])
          I Check if a value exists in the configstruct or the fwsettingsStruct
private any updateSSL(any inURL, any ssl)
          Update SSL or not on a request string
private any validateAction(any action='', [any inclusion=''], [any exclusion=''])
          Checks if an action can be executed according to inclusion/exclusion lists
 
Methods inherited from class WEB-INF.cftags.component
None
 

Constructor Detail

init

public init(any appRootPath, any appKey)
Constructor

Parameters:
appRootPath - The application root path
appKey - The application registered application key
Method Detail

getAppHash

public any getAppHash()
Get AppHash


getAppKey

public any getAppKey()
Get this application's key in memory space (application scope)


getAppRootPath

public any getAppRootPath()
Get this application's physical path


getAspectsInitiated

public any<boolean> getAspectsInitiated()
Get AspectsInitiated


getCFMLEngine

public any getCFMLEngine()
Get the CFMLEngine utility(coldbox.system.core.util.CFMLEngine)


getCacheBox

public any<CacheFactory> getCacheBox()
Get the application's CacheBox instance as coldbox.system.cache.CacheFactory


getColdboxInitiated

public any getColdboxInitiated()
Get ColdboxInitiated: Boolean


getColdboxOCM

public any<IColdboxApplicationCache> getColdboxOCM([any cacheName='default'])
Get ColdboxOCM: coldbox.system.cache.CacheManager or new CacheBox providers coldbox.system.cache.IColdboxApplicationCache

Parameters:
cacheName - The cache name to retrieve

getColdboxSettings

public any<struct> getColdboxSettings()
I retrieve the ColdBox Settings Structure by Reference


getConfigSettings

public any<struct> getConfigSettings()
I retrieve the Config Settings Structure by Reference


getDebuggerService

public any getDebuggerService()
Get DebuggerService: coldbox.system.web.services.DebuggerService


getExceptionService

public any getExceptionService()
Get ExceptionService: coldbox.system.web.services.ExceptionService


getHandlerService

public any getHandlerService()
Get HandlerService: coldbox.system.web.services.HandlerService


getInterceptorService

public any getInterceptorService()
Get interceptorService: coldbox.system.web.services.InterceptorService


getLoaderService

public any getLoaderService()
Get LoaderService: coldbox.system.web.services.LoaderService


getLogBox

public any<coldbox.system.logging.LogBox> getLogBox()
Get the application's LogBox instance


getMemento

public any getMemento()
Get the controller's internal state


getModuleService

public any getModuleService()
Get ModuleService: coldbox.system.web.services.ModuleService


getPlugin

Public any getPlugin(any plugin, [any customPlugin='false'], [any newInstance='false'], [any module=''], [any init='true'])
I am the Plugin cfc object factory.

Parameters:
plugin - The Plugin object's name to instantiate
customPlugin - Used internally to create custom plugins. Boolean
newInstance - If true, it will create and return a new plugin. No caching or persistance.
module - The module to retrieve the plugin from
init - Auto init() the plugin upon construction, Boolean

getPluginService

public any getPluginService()
Get PluginService: coldbox.system.web.services.PluginService


getRequestService

public any getRequestService()
Get RequestService: coldbox.system.web.services.RequestService


getServices

public any<coldbox.system.web.coldbox> getServices()
Get all the registered services structure


getSetting

public any getSetting([any name], [any FWSetting='false'], [any defaultValue])
I get a setting from the FW Config structures. Use the FWSetting boolean argument to retrieve from the fwSettingsStruct.

Parameters:
name - Name of the setting key to retrieve
FWSetting - Boolean Flag. If true, it will retrieve from the fwSettingsStruct else from the configStruct. Default is false.
defaultValue - Default value to return if not found.

getSettingStructure

public any<struct> getSettingStructure([any FWSetting='false'], [any deepCopyFlag='false'])
Compatability & Utility Method. By default I retrieve the Config Settings. You can change this by using the FWSetting flag.

Parameters:
FWSetting - Boolean Flag. If true, it will retrieve from the fwSettingsStruct else the configStruct. Default is false.
deepCopyFlag - Default is false. True, creates a deep copy of the structure.

getUtil

private any<coldbox.system.core.util.Util> getUtil()
Create and return a util object


getValidationManager

public any getValidationManager()
Get the validation manager for the application


getWireBox

public any<coldbox.system.logging.LogBox> getWireBox()
Get the application's LogBox instance


invoker

private any invoker(any target, any method, [any argCollection='[runtime expression]'], [any private='false'])
Method Invoker

Parameters:
target -
method -
argCollection - The argument collection to pass
private - Private method or not? Boolean

persistVariables

public any persistVariables([any persist=''], [any<struct> persistStruct])
@deprecated DO NOT USE ANYMORE. Persist variables for flash redirections, it can use a structure of name-value pairs or keys from the request collection. Use the flash object instead, this method will auto-save all persistence automatically.

Parameters:
persist - What request collection keys to persist in the relocation. Keys must exist in the relocation
persistStruct - A structure of key-value pairs to persist.

pushTimers

private any pushTimers()
Push timers into stack


runEvent

Public any runEvent([any event=''], [any<boolean> prepostExempt='false'], [any<boolean> private='false'], [any<boolean> default='false'], [any<struct> eventArguments='[runtime expression]'])
I am an event handler runnable factory. If no event is passed in then it will run the default event from the config file.

Parameters:
event - The event to run as a string. If no current event is set, use the default event from the config.xml. This is a string
prepostExempt - If true, pre/post handlers will not be fired. Boolean
private - Execute a private event or not, default is false. Boolean
default - The flag that let's this service now if it is the default set event running or not. USED BY THE FRAMEWORK ONLY. Boolean
eventArguments - A collection of arguments to passthrough to the calling event handler method. Struct

sendRelocation

private any sendRelocation(any url, [any<boolean> addtoken='false'], [any<numeric> statusCode='0'])
Send a CF relocation via ColdBox

Parameters:
url - The URL to relocate to
addtoken - Add the CF tokens or not
statusCode - The status code to use

setAppHash

public any setAppHash(any appHash)
Set AppHash

Parameters:
appHash

setAppRootPath

public any setAppRootPath(any appRootPath)
Set this application's physical path.

Parameters:
appRootPath

setAspectsInitiated

public any setAspectsInitiated(any aspectsInitiated)
Set AspectsInitiated

Parameters:
aspectsInitiated

setCacheBox

public any setCacheBox(any<CacheFactory> cacheBox)
Set the application's CacheBox instance

Parameters:
cacheBox - As coldbox.system.cache.CacheFactory

setColdboxInitiated

public any setColdboxInitiated(any coldboxInitiated)
Set ColdboxInitiated

Parameters:
coldboxInitiated

setColdboxOCM

public any setColdboxOCM(any coldboxOCM)
Set ColdboxOCM

Parameters:
coldboxOCM - coldbox.system.cache.CacheManager

setColdboxSettings

public any setColdboxSettings(any<struct> coldboxSettings)
Set ColdboxSettings

Parameters:
coldboxSettings

setConfigSettings

public any setConfigSettings(any<struct> configSettings)
Set ConfigSettings

Parameters:
configSettings

setDebuggerService

public any setDebuggerService(any debuggerService)
Set DebuggerService

Parameters:
debuggerService

setHandlerService

public any setHandlerService(any handlerService)
Set HandlerService

Parameters:
handlerService

setInterceptorService

public any setInterceptorService(any interceptorService)
Set interceptorService

Parameters:
interceptorService

setLoaderService

public any setLoaderService(any loaderService)
Set LoaderService

Parameters:
loaderService

setLog

public any setLog(any logger)
Set the class logger object

Parameters:
logger

setLogBox

public any setLogBox(any<coldbox.system.logging.LogBox> logBox)
Set the logBox instance

Parameters:
logBox - The logBox instance

setModuleService

public any setModuleService(any moduleService)
Set ModuleService

Parameters:
moduleService

setNextEvent

public any setNextEvent([string event='[runtime expression]'], [string queryString=''], [boolean addToken='false'], [string persist=''], [struct persistStruct='[runtime expression]'], [boolean ssl], [string baseURL=''], [boolean postProcessExempt='false'], [string URL], [string URI], [numeric statusCode='0'])
I Set the next event to run and relocate the browser to that event. If you are in SES mode, this method will use routing instead. You can also use this method to relocate to an absolute URL or a relative URI

Parameters:
event - The name of the event to run, if not passed, then it will use the default event found in your configuration file.
queryString - The query string to append, if needed. If in SES mode it will be translated to convention name value pairs
addToken - Wether to add the tokens or not. Default is false
persist - What request collection keys to persist in flash ram
persistStruct - A structure key-value pairs to persist in flash ram.
ssl - Whether to relocate in SSL or not. You need to explicitly say TRUE or FALSE if going out from SSL. If none passed, we look at the even's SES base URL (if in SES mode)
baseURL - Use this baseURL instead of the index.cfm that is used by default. You can use this for ssl or any full base url you would like to use. Ex: https://mysite.com/index.cfm
postProcessExempt - Do not fire the postProcess interceptors
URL - The full URL you would like to relocate to instead of an event: ex: URL='http://www.google.com'
URI - The relative URI you would like to relocate to instead of an event: ex: URI='/mypath/awesome/here'
statusCode - The status code to use in the relocation

setPluginService

public any setPluginService(Any pluginService)
Set PluginService

Parameters:
pluginService

setRequestService

public any setRequestService(any requestService)
Set RequestService

Parameters:
requestService

setSetting

public any setSetting([any name], [any value])
I set a Global Coldbox setting variable in the configstruct, if it exists it will be overrided. This only sets in the ConfigStruct

Parameters:
name - The name of the setting
value - The value of the setting (Can be simple or complex)

setValidationManager

public any setValidationManager(any validationManager)
Store the validation manager for the application

Parameters:
validationManager

setWireBox

public any setWireBox(any<coldbox.system.ioc.Injector> wireBox)
Set the WireBox instance

Parameters:
wireBox - The WireBox instance

settingExists

public any<boolean> settingExists(any name, [any FWSetting='false'])
I Check if a value exists in the configstruct or the fwsettingsStruct.

Parameters:
name - Name of the setting to find.
FWSetting - Boolean Flag. If true, it will retrieve from the fwSettingsStruct else from the configStruct. Default is false.

updateSSL

private any updateSSL(any inURL, any ssl)
Update SSL or not on a request string

Parameters:
inURL
ssl

validateAction

private any validateAction(any action='', [any inclusion=''], [any exclusion=''])
Checks if an action can be executed according to inclusion/exclusion lists. Boolean

Parameters:
action - The action to check
inclusion - inclusion list
exclusion - exclusion list

ColdBox Platform v3.8.0