TestBox 2.4.0

testbox.samples.resources.coldbox.system
Class FrameworkSupertype

railo-context.Component
        extended by testbox.samples.resources.coldbox.system.FrameworkSupertype

public class FrameworkSupertype
extends railo-context.Component

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com Base class for all things Box


Method Summary
 string addAsset(any asset)
          Add a js/css asset(s) to the html head section
 any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
          Announce an interception to the system
 any getCache([any name='default'])
          Get a named CacheBox Cache
 string getController()
 struct getDatasource(any alias)
          Get a datasource structure representation
 any getInstance([any name], [any dsl], [any initArguments='[runtime expression]'])
          Get a instance object from WireBox
 any getInterceptor(any interceptorName)
          Get an interceptor reference
 any getModel([any name], [any dsl], [any initArguments='[runtime expression]'])
          Get a model object
 struct getModuleConfig(any module)
          Get a module's configuration structure
 any getModuleSettings(any module, [any setting], [any defaultValue])
          Get a module's settings structure or a specific setting if the setting key is passed
 any getMyPlugin()
 any getPlugin()
          REMOVE THE FOLLOWING: JUST LEFT UNTIL COMPLETELY REMOVED ***
 any getRenderer()
          Retrieve the system web renderer
 struct getRequestCollection([boolean private='false'])
          Get the RC or PRC collection reference
 any getRequestContext()
          Retrieve the request context object
 any getSetting(any name, [boolean fwSetting='false'], [any defaultValue])
          Get a setting from the system
 any getSettingStructure([boolean fwSetting='false'], [boolean deepCopy='false'])
          DEPRECATED: Get all the settings structure
 any includeUDF(any udflibrary)
          Injects a UDF Library (*
 any loadApplicationHelpers()
          Load the global application helper libraries defined in the applicationHelper Setting of your application
 string locateDirectoryPath(any pathToCheck)
          Resolve a directory to be either relative or absolute in your application
 string locateFilePath(any pathToCheck)
          Resolve a file to be either relative or absolute in your application
 any persistVariables([any persist=''], [struct persistStruct='[runtime expression]'])
          Persist variables into the Flash RAM
 any populateModel(any model, [any scope=''], [boolean trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean composeRelationships='false'])
          Populate a model object from the request Collection
 any renderExternalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
          Renders an external view anywhere that cfinclude works
 any renderLayout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])
          Render a layout or a layout + view combo
 any renderView([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'])
          Render out a view
 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
 any setController(any controller)
 void setNextEvent([any event], [any URL], [any URI], [any queryString], [any persist], [struct persistStruct], [boolean addToken], [boolean ssl], [any baseURL], [boolean postProcessExempt], [numeric statusCode])
          Relocate the user to another location
 any setSetting(any name, any value)
          Set a new setting in the system
 boolean settingExists(any name, [boolean fwSetting='false'])
          Verify a setting from the system
 
Methods inherited from class railo-context.Component
 

Method Detail

addAsset

public string addAsset(any asset)
Add a js/css asset(s) to the html head section. You can also pass in a list of assets. This method keeps track of the loaded assets so they are only loaded once

Parameters:
asset - The asset(s) to load, only js or css files. This can also be a comma delimmited list.

announceInterception

public any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
Announce an interception to the system. If you use the asynchronous facilities, you will get a thread structure report as a result.

Parameters:
state - The event to announce
interceptData - A data structure used to pass intercepted information.
async - If true, the entire interception chain will be ran in a separate thread.
asyncAll - If true, each interceptor in the interception chain will be ran in a separate thread and then joined together at the end.
asyncAllJoin - If true, each interceptor in the interception chain will be ran in a separate thread and joined together at the end by default. If you set this flag to false then there will be no joining and waiting for the threads to finalize.
asyncPriority - The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMAL
asyncJoinTimeout - The timeout in milliseconds for the join thread to wait for interceptor threads to finish. By default there is no timeout.

getCache

public any getCache([any name='default'])
Get a named CacheBox Cache

Parameters:
name - The name of the cache to retrieve, if not passed, it used the 'default' cache.

getController

public string getController()


getDatasource

public struct getDatasource(any alias)
Get a datasource structure representation

Parameters:
alias - The alias of the datasource to get from the config structures

getInstance

public any getInstance([any name], [any dsl], [any initArguments='[runtime expression]'])
Get a instance object from WireBox

Parameters:
name - The mapping name or CFC path to retrieve
dsl - The DSL string to use to retrieve an instance
initArguments - The constructor structure of arguments to passthrough when initializing the instance

getInterceptor

public any getInterceptor(any interceptorName)
Get an interceptor reference

Parameters:
interceptorName - The name of the interceptor to retrieve

getModel

public any getModel([any name], [any dsl], [any initArguments='[runtime expression]'])
Get a model object

Parameters:
name - The mapping name or CFC path to retrieve
dsl - The DSL string to use to retrieve an instance
initArguments - The constructor structure of arguments to passthrough when initializing the instance

getModuleConfig

public struct getModuleConfig(any module)
Get a module's configuration structure

Parameters:
module - The module to retrieve the configuration structure from

getModuleSettings

public any getModuleSettings(any module, [any setting], [any defaultValue])
Get a module's settings structure or a specific setting if the setting key is passed

Parameters:
module - The module to retrieve the configuration settings from
setting - The setting to retrieve if passed
defaultValue - The default value to return if setting does not exist

getMyPlugin

public any getMyPlugin()


getPlugin

public any getPlugin()
REMOVE THE FOLLOWING: JUST LEFT UNTIL COMPLETELY REMOVED ***


getRenderer

public any getRenderer()
Retrieve the system web renderer


getRequestCollection

public struct getRequestCollection([boolean private='false'])
Get the RC or PRC collection reference

Parameters:
private - The boolean bit that says give me the RC by default or true for the private collection (PRC)

getRequestContext

public any getRequestContext()
Retrieve the request context object


getSetting

public any getSetting(any name, [boolean fwSetting='false'], [any defaultValue])
Get a setting from the system

Parameters:
name - The key of the setting
fwSetting - Retrieve from the config or fw settings, defaults to config
defaultValue - If not found in config, default return value

getSettingStructure

public any getSettingStructure([boolean fwSetting='false'], [boolean deepCopy='false'])
DEPRECATED: Get all the settings structure

Parameters:
fwSetting - Retrieve from the config or fw settings, defaults to config
deepCopy - Do a deep or shallow copy, shallow is default

includeUDF

public any includeUDF(any udflibrary)
Injects a UDF Library (*.cfc or *.cfm) into the target object. It does not however, put the mixins on any of the cfc scopes. Therefore they can only be called internally

Parameters:
udflibrary - The UDF library to inject

loadApplicationHelpers

public any loadApplicationHelpers()
Load the global application helper libraries defined in the applicationHelper Setting of your application. This is called by the framework ONLY! Use at your own risk


locateDirectoryPath

public string locateDirectoryPath(any pathToCheck)
Resolve a directory to be either relative or absolute in your application

Parameters:
pathToCheck - The file path to check

locateFilePath

public string locateFilePath(any pathToCheck)
Resolve a file to be either relative or absolute in your application

Parameters:
pathToCheck - The file path to check

persistVariables

public any persistVariables([any persist=''], [struct persistStruct='[runtime expression]'])
Persist variables into the Flash RAM

Parameters:
persist - A list of request collection keys to persist
persistStruct - A struct of key-value pairs to persist

populateModel

public any populateModel(any model, [any scope=''], [boolean trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean composeRelationships='false'])
Populate a model object from the request Collection

Parameters:
model - The name of the model to get and populate or the acutal model object. If you already have an instance of a model, then use the populateBean() method
scope - Use scope injection instead of setters population. Ex: scope=variables.instance.
trustedSetter - If set to true, the setter method will be called even if it does not exist in the object
include - A list of keys to include in the population
exclude - A list of keys to exclude in the population
ignoreEmpty - Ignore empty values on populations, great for ORM population
nullEmptyInclude - A list of keys to NULL when empty
nullEmptyExclude - A list of keys to NOT NULL when empty
composeRelationships - Automatically attempt to compose relationships from memento

renderExternalView

public any renderExternalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
Renders an external view anywhere that cfinclude works.

Parameters:
view - The the view to render
args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
cache - Cached the view output or not, defaults to false
cacheTimeout - The time in minutes to cache the view
cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
cacheSuffix - The suffix to add into the cache entry for this view rendering
cacheProvider - The provider to cache this view in, defaults to 'template'

renderLayout

public any renderLayout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])
Render a layout or a layout + view combo

Parameters:
layout - The layout to render out
module - The module to explicitly render this layout from
view - The view to render within this layout
args - An optional set of arguments that will be available to this layouts/view rendering ONLY
viewModule - The module to explicitly render the view from
prePostExempt - If true, pre/post layout interceptors will not be fired. By default they do fire

renderView

public any renderView([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'])
Render out a view

Parameters:
view - The the view to render, if not passed, then we look in the request context for the current set view.
args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
module - The module to render the view from explicitly
cache - Cached the view output or not, defaults to false
cacheTimeout - The time in minutes to cache the view
cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
cacheSuffix - The suffix to add into the cache entry for this view rendering
cacheProvider - The provider to cache this view in, defaults to 'template'
collection - A collection to use by this Renderer to render the view as many times as the items in the collection (Array or Query)
collectionAs - The name of the collection variable in the partial rendering. If not passed, we will use the name of the view by convention
collectionStartRow - The start row to limit the collection rendering with
collectionMaxRows - The max rows to iterate over the collection rendering with
collectionDelim - A string to delimit the collection renderings by
prePostExempt - If true, pre/post view interceptors will not be fired. By default they do fire

runEvent

public 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.

Parameters:
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 false
private - Execute a private event if set, else defaults to public events
defaultEvent - The flag that let's this service now if it is the default event running or not. USED BY THE FRAMEWORK ONLY
eventArguments - A collection of arguments to passthrough to the calling event handler method
cache - 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 results
cacheLastAccessTimeout - The time in minutes the results will be removed from cache if idle or requested
cacheSuffix - The suffix to add into the cache entry for this event rendering
cacheProvider - The provider to cache this event rendering in, defaults to 'template'

setController

public any setController(any controller)

Parameters:
controller

setNextEvent

public void setNextEvent([any event], [any URL], [any URI], [any queryString], [any persist], [struct persistStruct], [boolean addToken], [boolean ssl], [any baseURL], [boolean postProcessExempt], [numeric statusCode])
Relocate the user to another location

Parameters:
event - The name of the event to run, if not passed, then it will use the default event found in your configuration file
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'
queryString - The query string to append, if needed. If in SES mode it will be translated to convention name value pairs
persist - What request collection keys to persist in flash ram
persistStruct - A structure key-value pairs to persist in flash ram
addToken - Wether to add the tokens or not. Default is false
ssl - Whether to relocate in SSL or not
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
statusCode - The status code to use in the relocation

setSetting

public any setSetting(any name, any value)
Set a new setting in the system

Parameters:
name - The key of the setting
value - The value of the setting

settingExists

public boolean settingExists(any name, [boolean fwSetting='false'])
Verify a setting from the system

Parameters:
name - The key of the setting
fwSetting - Retrieve from the config or fw settings, defaults to config

TestBox 2.4.0