Skip to content

ControllerApi

dskaggs edited this page Nov 12, 2012 · 1 revision

PageOutline

A Controller in a Model-Glue application extends the ModelGlue.Core.Controller CFC.

The base controller contains a set of functions known as the Controller API. These functions are available inside all controllers and provide controller-related functionality.

Adding a Message Listener Function

To add a function that can be registered via a tag, the function must have a RETURNTYPE attribute of VOID, and a single argument of type "any".

AddToCache(name:string, value:any, [timeout:numeric])

Description

Adds the value passed to the controllers internal cache, using the name passed as a key.  If timeout is passed, it is the lifespan, in minutes, of the value passed.

Returns

Void

Arguments

Name (Required) - The key by which to identify this value in the cache.

Value (Required) - The value to cache

Timeout (Optional) - The number of minutes to store the value in the cache.  Defaults to the DefaultCacheTimeout setting set the ModelGlueConfiguration bean in ColdSpring.xml.

GetFromCache(name:string)

Description

Gets a value from the cache with a matching name. If the value does not exist, an error of type ModelGlue.Util.TimedCache.ItemNotFound will be thrown.

Returns

Any

Arguments

Name (Required) - The key of the value to retrieve.

GetModelGlue()

Description

Returns the Model-Glue framework itself

Returns

ModelGlue.unity.framework.ModelGlue

Arguments

None

Clone this wiki locally