railo-context.Component coldbox.system.web.Controller
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com Manages a ColdBox application, dispatches events and acts as an overall front controller.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
appHash
ColdBox application unique hash key. |
true
|
false
|
|
any
|
appKey
ColdBox application key. |
true
|
false
|
|
any
|
appRootPath
ColdBox application root path. |
true
|
false
|
|
any
|
cachebox
The reference to CacheBox. |
true
|
false
|
|
any
|
CFMLEngine
The CFML engine helper. |
true
|
false
|
|
boolean
|
coldboxInitiated
ColdBox initiation flag. |
true
|
false
|
|
struct
|
coldboxSettings
The internal ColdBox settings structure. |
true
|
false
|
|
struct
|
configSettings
The application configuration settings structure. |
true
|
false
|
|
any
|
log
The controller logger object. |
true
|
false
|
|
any
|
logbox
The reference to LogBox. |
true
|
false
|
|
any
|
services
Container for all internal services (LinkedHashMap). |
true
|
false
|
|
any
|
util
The system utility object. |
true
|
false
|
|
any
|
wirebox
The reference to WireBox. |
true
|
false
|
Constructor Summary | |
---|---|
init(any appRootPath, [any appKey='cbController'])
Constructor. |
Method Summary | |
---|---|
private any
|
_runEvent([any event=''], [boolean prePostExempt='false'], [boolean private='false'], [boolean defaultEvent='false'], [struct eventArguments='[runtime expression]'])
Executes events with full life-cycle methods and returns the event results if any were returned. |
string
|
getAppHash()
get: ColdBox application unique hash key. |
string
|
getAppKey()
get: ColdBox application key. |
string
|
getAppRootPath()
get: ColdBox application root path. |
any
|
getCache(any cacheName='default')
Get a Cache provider from CacheBox. |
string
|
getCachebox()
get: The reference to CacheBox. |
string
|
getCFMLEngine()
get: The CFML engine helper. |
string
|
getColdboxInitiated()
get: ColdBox initiation flag. |
string
|
getColdboxSettings()
get: The internal ColdBox settings structure. |
string
|
getConfigSettings()
get: The application configuration settings structure. |
any
|
getDataMarshaller()
Get the system data marshaller, you can also retreive it from wirebox via dataMarshaller@coldbox. |
any
|
getHandlerService()
Get the handler service. |
any
|
getInterceptorService()
Get the interceptor service. |
any
|
getLoaderService()
Get the loader service. |
string
|
getLog()
get: The controller logger object. |
string
|
getLogbox()
get: The reference to LogBox. |
any
|
getMemento()
Get controller memento, used only by decorator only. |
any
|
getModuleService()
Get the module service. |
any
|
getPlugin()
DEPRECATED. |
any
|
getRenderer()
Get the system web renderer, you can also retreive it from wirebox via renderer@coldbox. |
any
|
getRequestService()
Get the request service. |
string
|
getServices()
get: Container for all internal services (LinkedHashMap). |
any
|
getSetting(any name, [boolean fwSetting='false'], [any defaultValue])
Get a setting from a configuration structure. |
struct
|
getSettingStructure([boolean fwSetting='false'], [boolean deepCopyFlag='false'])
DEPRECATED: Convenience method to retrieve the config or coldbox settings. |
string
|
getUtil()
get: The system utility object. |
string
|
getWirebox()
get: The reference to WireBox. |
private any
|
invoker(any target, any method, [struct argCollection='[runtime expression]'], [boolean private='false'])
Invoke private/public event handler methods. |
private any
|
loadColdBoxSettings()
Load the internal ColdBox settings. |
any
|
locateDirectoryPath(any pathToCheck)
Locate the real path location of a directory in a coldbox application. |
any
|
locateFilePath(any pathToCheck)
Locate the real path location of a file in a coldbox application. |
private any
|
persistVariables([any persist=''], [struct persistStruct='[runtime expression]'])
Internal helper to flash persist elements. |
any
|
runEvent([any event=''], [boolean prePostExempt='false'], [boolean private='false'], [boolean defaultEvent='false'], [struct eventArguments='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
Executes events with full life-cycle methods and returns the event results if any were returned. |
private any
|
sendRelocation(any URL, [boolean addToken='false'], [any statusCode='0'])
Send a CF relocation. |
any
|
setAppHash(any appHash)
set: ColdBox application unique hash key. |
any
|
setAppKey(any appKey)
set: ColdBox application key. |
any
|
setAppRootPath(any appRootPath)
set: ColdBox application root path. |
any
|
setCachebox(any cachebox)
set: The reference to CacheBox. |
any
|
setCFMLEngine(any CFMLEngine)
set: The CFML engine helper. |
any
|
setColdboxInitiated(boolean coldboxInitiated)
set: ColdBox initiation flag. |
any
|
setColdboxSettings(struct coldboxSettings)
set: The internal ColdBox settings structure. |
any
|
setConfigSettings(struct configSettings)
set: The application configuration settings structure. |
any
|
setLog(any log)
set: The controller logger object. |
any
|
setLogbox(any logbox)
set: The reference to LogBox. |
any
|
setNextEvent([any event='[runtime expression]'], [any queryString=''], [boolean addToken='false'], [any persist=''], [struct persistStruct='[runtime expression]'], [any baseURL=''], [boolean postProcessExempt='false'], [any URL], [any URI], [numeric statusCode='0'])
Set the next event to run and relocate the browser to that event. |
any
|
setServices(any services)
set: Container for all internal services (LinkedHashMap). |
any
|
setSetting(any name, any value)
Set a value in the application configuration settings. |
boolean
|
settingExists(any name, [boolean fwSetting='false'])
Check if a value exists in a configuration structure. |
any
|
setUtil(any util)
set: The system utility object. |
any
|
setWirebox(any wirebox)
set: The reference to WireBox. |
private string
|
updateSSL(any inURL, any ssl)
Update SSL or not on a request string. |
private boolean
|
validateAction(any action, [any inclusion=''], [any exclusion=''])
Checks if an action can be executed according to inclusion/exclusion lists. |
Methods inherited from class railo-context.Component |
---|
None |
Constructor Detail |
---|
Constructor
appRootPath
- The application root pathappKey
- The application registered application keyProperty Detail |
---|
ColdBox application unique hash key
required
- falseserializable
- trueColdBox application key
required
- falseserializable
- trueColdBox application root path
required
- falseserializable
- trueThe reference to CacheBox
required
- falseserializable
- trueThe CFML engine helper
required
- falseserializable
- trueColdBox initiation flag
required
- falseserializable
- trueThe internal ColdBox settings structure
required
- falseserializable
- trueThe application configuration settings structure
required
- falseserializable
- trueThe controller logger object
required
- falseserializable
- trueThe reference to LogBox
required
- falseserializable
- trueContainer for all internal services (LinkedHashMap)
required
- falseserializable
- trueThe system utility object
required
- falseserializable
- trueThe reference to WireBox
required
- falseserializable
- trueMethod Detail |
---|
Executes events with full life-cycle methods and returns the event results if any were returned
event
- The event string to execute, if nothing is passed we will execute the application's default event.prePostExempt
- If true, pre/post handlers will not be fired. Defaults to falseprivate
- Execute a private event if set, else defaults to public eventsdefaultEvent
- The flag that let's this service now if it is the default event running or not. USED BY THE FRAMEWORK ONLYeventArguments
- A collection of arguments to passthrough to the calling event handler methodget: ColdBox application unique hash key
get: ColdBox application key
get: ColdBox application root path
Get a Cache provider from CacheBox
cacheName
- The name of the cache to retrieve, or it defaults to the 'default' cache.get: The reference to CacheBox
get: The CFML engine helper
get: ColdBox initiation flag
get: The internal ColdBox settings structure
get: The application configuration settings structure
Get the system data marshaller, you can also retreive it from wirebox via dataMarshaller@coldbox
Get the handler service
Get the interceptor service
Get the loader service
get: The controller logger object
get: The reference to LogBox
Get controller memento, used only by decorator only.
Get the module service
DEPRECATED
Get the system web renderer, you can also retreive it from wirebox via renderer@coldbox
Get the request service
get: Container for all internal services (LinkedHashMap)
Get a setting from a configuration structure
name
- The name of the settingfwSetting
- Switch to get the coldbox or config settings, defaults to config settingsdefaultValue
- The default value to use if setting does not existDEPRECATED: Convenience method to retrieve the config or coldbox settings.
fwSetting
- Switch to get the coldbox or config settings, defaults to config settingsdeepCopyFlag
- Do a deep or reference returnget: The system utility object
get: The reference to WireBox
Invoke private/public event handler methods
target
method
argCollection
private
Load the internal ColdBox settings
Locate the real path location of a directory in a coldbox application. 3 checks: 1) inside of coldbox app, 2) expand the path, 3) Absolute location. If path not found, it returns an empty path
pathToCheck
- The relative or absolute directory path to verify and locateLocate the real path location of a file in a coldbox application. 3 checks: 1) inside of coldbox app, 2) expand the path, 3) Absolute location. If path not found, it returns an empty path
pathToCheck
- The relative or absolute file path to verify and locateInternal helper to flash persist elements
persist
persistStruct
Executes events with full life-cycle methods and returns the event results if any were returned.
event
- The event string to execute, if nothing is passed we will execute the application's default event.prePostExempt
- If true, pre/post handlers will not be fired. Defaults to falseprivate
- Execute a private event if set, else defaults to public eventsdefaultEvent
- The flag that let's this service now if it is the default event running or not. USED BY THE FRAMEWORK ONLYeventArguments
- A collection of arguments to passthrough to the calling event handler methodcache
- Cached the output of the runnable execution, defaults to false. A unique key will be created according to event string + arguments.cacheTimeout
- The time in minutes to cache the resultscacheLastAccessTimeout
- The time in minutes the results will be removed from cache if idle or requestedcacheSuffix
- The suffix to add into the cache entry for this event renderingcacheProvider
- The provider to cache this event rendering in, defaults to 'template'Send a CF relocation
URL
addToken
statusCode
set: ColdBox application unique hash key
appHash
set: ColdBox application key
appKey
set: ColdBox application root path
appRootPath
set: The reference to CacheBox
cachebox
set: The CFML engine helper
CFMLEngine
set: ColdBox initiation flag
coldboxInitiated
set: The internal ColdBox settings structure
coldboxSettings
set: The application configuration settings structure
configSettings
set: The controller logger object
log
set: The reference to LogBox
logbox
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
event
- The name of the event to relocate to, 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 pairsaddToken
- Wether to add the tokens or not to the relocation. Default is falsepersist
- What request collection keys to persist in flash RAM automatically for youpersistStruct
- A structure of key-value pairs to persist in flash RAM automatically for youbaseURL
- 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.cfmpostProcessExempt
- Do not fire the postProcess interceptors, by default it doesURL
- 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 relocationset: Container for all internal services (LinkedHashMap)
services
Set a value in the application configuration settings
name
- The name of the settingvalue
- The value to setCheck if a value exists in a configuration structure
name
- The name of the settingfwSetting
- Switch to get the coldbox or config settings, defaults to config settingsset: The system utility object
util
set: The reference to WireBox
wirebox
Update SSL or not on a request string
inURL
ssl
Checks if an action can be executed according to inclusion/exclusion lists
action
- The action to validateinclusion
- The list of inclusionsexclusion
- The list of exclusions