coldbox.system

Class FrameworkSupertype

WEB-INF.cftags.component
        extended by coldbox.system.FrameworkSupertype
Class Attributes:
  • serializable : false
  •  
  • output : false
  •  
    Direct Known Subclasses:
    EventHandler , Interceptor , Plugin

    This is the layer supertype cfc for all ColdBox related objects.

    Method Summary
    void $abort()
         Facade for cfabort.
    void $dump(any var, [boolean isAbort='false'])
         Facade for cfmx dump.
    void $htmlhead(string content)
         Facade to cfhtmlhead.
    void $include([string template])
         Facade for cfinclude.
    void $rethrow(any throwObject)
         Rethrow facade.
    any $throw(string message, [string detail=''], [string type='Framework'])
         Facade for cfthrow.
    any addAsset(any asset)
         Add a js/css asset(s) to the html head section.
    any announceInterception(any state, [any interceptData], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
         Announce an interception to the system.
    any<IColdboxApplicationCache> getColdboxOCM([any cacheName='default'])
         Get a CacheBox Cache of type: coldbox.
    any getController()
         Get controller: coldbox.
    any<DatasourceBean> getDatasource([any alias])
         I will return to you a datasourceBean according to the alias of the datasource you wish to get from the configstruct.
    boolean getDebugMode()
         Facade to get your current debug mode.
    any getInterceptor([any interceptorName], [any<Boolean> deepSearch='false'])
         Get an interceptor.
    any getMailService()
         Get a reference to our Mail Service plugin.
    any<MailSettingsBean> getMailSettings()
         I will return to you a mailsettingsBean modeled after your mail settings in your config file.
    any getMemento()
         Get the memento of this object.
    any getModel([any name], [any dsl], [any<struct> initArguments='[runtime expression]'])
         Create or retrieve model objects by convention.
    any getModuleSettings(any module)
         Get a module's setting structure if it exists.
    any getMyPlugin(any plugin, [any<Boolean> newInstance='false'], [any module=''], [any<Boolean> init='true'])
         Facade.
    any getNewMail()
         Get a new mail payload object ready for sending email through our mail service.
    any getPlugin([any plugin], [any<Boolean> customPlugin='false'], [any<Boolean> newInstance='false'], [any module=''], [any<Boolean> init='true'])
         Facade.
    any getResource(any resource, [any default], [any locale], [any values], [any bundle])
         Facade to i18n.
    any getSetting(any name, [boolean FWSetting='false'], [any defaultValue])
         Facade.
    struct getSettingStructure([boolean FWSetting='false'], [boolean DeepCopyFlag='false'])
         Facade.
    ConfigBean getSettingsBean([boolean FWSetting='false'])
         Returns a configBean with all the configuration structure.
    IValidationManager getValidationManager()
         Retrieve the application's configured Validation Manager.
    any getfwLocale()
         Get the user's currently set locale or default locale.
    void includeUDF(any udflibrary)
         Injects a UDF Library (*.
    any loadGlobalUDFLibraries()
         Load the global UDF libraries defined in the UDFLibraryFile Setting.
    string locateDirectoryPath(any pathToCheck)
         Locate the real path location of a directory in a coldbox application.
    string locateFilePath(any pathToCheck)
         Locate the real path location of a file in a coldbox application.
    void persistVariables([string persist=''], [struct persistStruct])
         Persist variables for flash redirections.
    Any populateModel(any model, [any scope=''], [boolean<Boolean> trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
         Populate a named or instantiated model (java/cfc) from the request collection items.
    void relocate(string url, [boolean addtoken='false'], [boolean postProcessExempt='false'])
         This method will be deprecated, please use setNextEvent() instead.
    Any renderExternalView(any view, [any cache], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [struct args='[runtime expression]'])
         Renders external views.
    any renderLayout([any layout], [any view], [any module], [struct args='[runtime expression]'])
         Renders a layout with view combinations.
    Any renderView(any view, [any cache], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [any module], [struct args='[runtime expression]'], [any collection], [any collectionAs])
         Renders all kinds of views.
    any runEvent([any event=''], [any<boolean> prepostExempt='false'], [any<boolean> private='false'], [any<boolean> default='false'], [any<struct> eventArguments='[runtime expression]'])
         Facade to controller's runEvent() method.
    void setDebugMode(boolean mode)
         Facade to set your debug mode.
    void setNextEvent([string event], [string queryString], [boolean addToken], [string persist], [struct persistStruct], [boolean ssl], [string baseURL], [boolean postProcessExempt], [string URL], [string URI], [numeric statusCode])
         Facade.
    void setNextRoute(string route, [string persist=''], [struct persistStruct], [boolean addToken='false'], [boolean ssl='false'])
         This method is now deprecated, please use setNextEvent().
    void setSetting(any name, any value)
         Facade.
    any setfwLocale([any locale], [any<Boolean> dontloadRBFlag])
         Set the default locale to use in the framework for a specific user.
    boolean settingExists(any name, [boolean FWSetting='false'])
         Facade.
    IValidationResult validateModel(any target, [string fields='*'], [any constraints], [string locale=''], [string excludeFields=''])
         Validate a target object.
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Method Detail

    $abort

    public void $abort()

    Facade for cfabort


    $dump

    public void $dump(any var, [boolean isAbort='false'])

    Facade for cfmx dump

    Parameters:
    var
    isAbort - Abort also

    $htmlhead

    public void $htmlhead(string content)

    Facade to cfhtmlhead

    Parameters:
    content - The content to send to the head

    $include

    public void $include([string template])

    Facade for cfinclude

    Parameters:
    template

    $rethrow

    public void $rethrow(any throwObject)

    Rethrow facade

    Parameters:
    throwObject - The cfcatch object

    $throw

    public any $throw(string message, [string detail=''], [string type='Framework'])

    Facade for cfthrow

    Parameters:
    message
    detail
    type

    addAsset

    public any addAsset(any asset)

    Add a js/css asset(s) to the html head section. You can also pass in a list of assets.

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

    announceInterception

    public any announceInterception(any state, [any interceptData], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [string 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 interception state to execute
    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.

    getColdboxOCM

    public any<IColdboxApplicationCache> getColdboxOCM([any cacheName='default'])

    Get a CacheBox Cache of type: coldbox.system.cache.IColdboxApplicationCache

    Parameters:
    cacheName - The cache name to retrieve

    getController

    public any getController()

    Get controller: coldbox.system.web.Controller


    getDatasource

    public any<DatasourceBean> getDatasource([any alias])

    I will return to you a datasourceBean according to the alias of the datasource you wish to get from the configstruct

    Parameters:
    alias - The alias of the datasource to get from the configstruct (alias property in the config file)

    getDebugMode

    public boolean getDebugMode()

    Facade to get your current debug mode


    getInterceptor

    public any getInterceptor([any interceptorName], [any<Boolean> deepSearch='false'])

    Get an interceptor

    Parameters:
    interceptorName - The name of the interceptor to search for
    deepSearch - By default we search the cache for the interceptor reference. If true, we search all the registered interceptor states for a match.

    getMailService

    public any getMailService()

    Get a reference to our Mail Service plugin


    getMailSettings

    public any<MailSettingsBean> getMailSettings()

    I will return to you a mailsettingsBean modeled after your mail settings in your config file.


    getMemento

    public any getMemento()

    Get the memento of this object


    getModel

    public any getModel([any name], [any dsl], [any<struct> initArguments='[runtime expression]'])

    Create or retrieve model objects by convention

    Parameters:
    name - The mapping name or CFC instance path to try to build up
    dsl - The dsl string to use to retrieve the instance model object, mutually exclusive with 'name'
    initArguments - The constructor structure of arguments to passthrough when initializing the instance

    getModuleSettings

    public any getModuleSettings(any module)

    Get a module's setting structure if it exists

    Parameters:
    module - The module name

    getMyPlugin

    public any getMyPlugin(any plugin, [any<Boolean> newInstance='false'], [any module=''], [any<Boolean> init='true'])

    Facade

    Parameters:
    plugin - The plugin name as a string
    newInstance
    module - The module to retrieve the plugin from
    init - Auto init() the plugin upon construction

    getNewMail

    public any getNewMail()

    Get a new mail payload object ready for sending email through our mail service. This function's arguments match the cfmail tag, so send whatever you like


    getPlugin

    public any getPlugin([any plugin], [any<Boolean> customPlugin='false'], [any<Boolean> newInstance='false'], [any module=''], [any<Boolean> init='true'])

    Facade

    Parameters:
    plugin - The Plugin object's name to instantiate, as a string
    customPlugin
    newInstance
    module - The module to retrieve the plugin from
    init - Auto init() the plugin upon construction

    getResource

    public any getResource(any resource, [any default], [any locale], [any values], [any bundle])

    Facade to i18n.getResource. Returns a string.

    Parameters:
    resource - The resource (key) to retrieve from the main loaded bundle.
    default - A default value to send back if the resource (key) not found
    locale - Pass in which locale to take the resource from. By default it uses the user's current set locale
    values - An array, struct or simple string of value replacements to use on the resource string
    bundle - The bundle alias to use to get the resource from when using multiple resource bundles. By default the bundle name used is 'default'

    getSetting

    public any getSetting(any name, [boolean FWSetting='false'], [any defaultValue])

    Facade

    Parameters:
    name
    FWSetting
    defaultValue - Default value to return if not found.

    getSettingStructure

    public struct getSettingStructure([boolean FWSetting='false'], [boolean DeepCopyFlag='false'])

    Facade

    Parameters:
    FWSetting
    DeepCopyFlag

    getSettingsBean

    public ConfigBean getSettingsBean([boolean FWSetting='false'])

    Returns a configBean with all the configuration structure.

    Parameters:
    FWSetting - Whether to build the config bean with coldbox settings or config settings

    getValidationManager

    public IValidationManager getValidationManager()

    Retrieve the application's configured Validation Manager


    getfwLocale

    public any getfwLocale()

    Get the user's currently set locale or default locale


    includeUDF

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

    loadGlobalUDFLibraries

    public any loadGlobalUDFLibraries()

    Load the global UDF libraries defined in the UDFLibraryFile Setting


    locateDirectoryPath

    public string locateDirectoryPath(any pathToCheck)

    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

    Parameters:
    pathToCheck - The path to check

    locateFilePath

    public string locateFilePath(any pathToCheck)

    Locate 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

    Parameters:
    pathToCheck - The path to check

    persistVariables

    public void persistVariables([string persist=''], [struct persistStruct])

    Persist variables for flash redirections

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

    populateModel

    public Any populateModel(any model, [any scope=''], [boolean<Boolean> trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])

    Populate a named or instantiated model (java/cfc) from the request collection items

    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 bean
    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

    relocate

    public void relocate(string url, [boolean addtoken='false'], [boolean postProcessExempt='false'])

    This method will be deprecated, please use setNextEvent() instead.

    Parameters:
    url
    addtoken
    postProcessExempt - Do not fire the postProcess interceptors

    renderExternalView

    public Any renderExternalView(any view, [any cache], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [struct args='[runtime expression]'])

    Renders external views

    Parameters:
    view - The full path to the view. This can be an expanded path or relative. Include extension.
    cache - True if you want to cache the view.
    cacheTimeout - The cache timeout
    cacheLastAccessTimeout - The last access timeout
    cacheSuffix - Add a cache suffix to the view cache entry. Great for multi-domain caching or i18n caching.
    args - An optional set of arguments that will be available to this layouts/view rendering ONLY

    renderLayout

    Public any renderLayout([any layout], [any view], [any module], [struct args='[runtime expression]'])

    Renders a layout with view combinations

    Parameters:
    layout - The explicit layout to use in rendering.
    view - The name of the view to passthrough as an argument so you can refer to it as arguments.view
    module - Explicitly render a layout from this module
    args - An optional set of arguments that will be available to this layouts/view rendering ONLY

    renderView

    public Any renderView(any view, [any cache], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [any module], [struct args='[runtime expression]'], [any collection], [any collectionAs])

    Renders all kinds of views

    Parameters:
    view
    cache - True if you want to cache the view.
    cacheTimeout - The cache timeout
    cacheLastAccessTimeout - The last access timeout
    cacheSuffix - Add a cache suffix to the view cache entry. Great for multi-domain caching or i18n caching.
    module - Explicitly render a layout from this module
    args - An optional set of arguments that will be available to this layouts/view rendering ONLY
    collection - A collection to use by this Renderer to render the view as many times as the items in the collection
    collectionAs - The name of the collection variable in the partial rendering. If not passed, we will use the name of the view by convention

    runEvent

    public any runEvent([any event=''], [any<boolean> prepostExempt='false'], [any<boolean> private='false'], [any<boolean> default='false'], [any<struct> eventArguments='[runtime expression]'])

    Facade to controller's runEvent() method.

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

    setDebugMode

    public void setDebugMode(boolean mode)

    Facade to set your debug mode

    Parameters:
    mode

    setNextEvent

    public void setNextEvent([string event], [string queryString], [boolean addToken], [string persist], [struct persistStruct], [boolean ssl], [string baseURL], [boolean postProcessExempt], [string URL], [string URI], [numeric statusCode])

    Facade

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

    setNextRoute

    public void setNextRoute(string route, [string persist=''], [struct persistStruct], [boolean addToken='false'], [boolean ssl='false'])

    This method is now deprecated, please use setNextEvent(). This method will be removed later on

    Parameters:
    route - The route to relocate to, do not prepend the baseURL or /.
    persist - What request collection keys to persist in the relocation
    persistStruct - A structure key-value pairs to persist.
    addToken - Wether to add the tokens or not. Default is false
    ssl - Whether to relocate in SSL or not

    setSetting

    public void setSetting(any name, any value)

    Facade

    Parameters:
    name
    value

    setfwLocale

    public any setfwLocale([any locale], [any<Boolean> dontloadRBFlag])

    Set the default locale to use in the framework for a specific user. Utility Method

    Parameters:
    locale - The locale to change and set. Must be Java Style: en_US
    dontloadRBFlag - Flag to load the resource bundle for the specified locale (If not already loaded) or just change the framework's locale. Boolean

    settingExists

    public boolean settingExists(any name, [boolean FWSetting='false'])

    Facade

    Parameters:
    name
    FWSetting

    validateModel

    public IValidationResult validateModel(any target, [string fields='*'], [any constraints], [string locale=''], [string excludeFields=''])

    Validate a target object

    Parameters:
    target - The target object to validate or a structure of name-value paris to validate.
    fields - Validate on all or one or a list of fields (properties) on the target, by default we validate all fields declared in its constraints
    constraints - The shared constraint name to use, or an actual constraints structure
    locale - The locale to validate in
    excludeFields - The fields to exclude in the validation