WEB-INF.cftags.component coldbox.system.web.context.RequestContext
The request context object simulates a user request. It has two internal data collections: one public and one private. You can also manipulate the request stream and contents from this object.
Constructor Summary | |
---|---|
init(any properties, any controller)
constructor. |
Method Summary | |
---|---|
private void
|
$dump(any var, [boolean isAbort='false'])
Facade for cfmx dump. |
private any
|
$throw(string message, [string detail=''], [string type='Framework'])
Facade for cfthrow. |
any
|
buildLink(string linkto, [boolean translate='true'], [boolean ssl='false'], [string baseURL=''], [string queryString=''])
Builds a link to a passed event, either SES or normal link. |
any
|
clearCollection([boolean private='false'])
Clears the entire collection. |
any
|
collectionAppend(any collection, [boolean overwrite='false'], [boolean private='false'])
Append a structure to the collection, with overwrite or not. |
any<struct>
|
getCollection([boolean deepCopyFlag='false'], [boolean private='false'])
I Get a reference or deep copy of the public or private request Collection. |
any
|
getCurrentAction()
Gets the current action requested in the current event: String. |
any
|
getCurrentEvent()
Gets the current incoming event. |
any
|
getCurrentHandler()
Gets the current handler requested in the current event: String. |
any
|
getCurrentLayout()
Gets the current set layout for rendering. |
any
|
getCurrentLayoutModule()
Gets the current set layout's module for rendering. |
any
|
getCurrentModule()
Gets the current module name, else returns empty string. |
any
|
getCurrentRoute()
Get the current request's SES route that matched. |
any
|
getCurrentRoutedNamespace()
Get the current routed namespace that matched the SES route, if any. |
any
|
getCurrentRoutedURL()
Get the current routed URL that matched the SES route. |
any
|
getCurrentView()
Gets the current set view the framework will try to render for this request. |
any
|
getCurrentViewArgs()
Gets the current set view the framework will try to render for this request. |
any
|
getCurrentViewModule()
Gets the current set views's module for rendering. |
boolean
|
getDebugPanelFlag()
I return the debugpanel flag for this request. |
any
|
getDefaultLayout()
Get's the default layout of the application: String. |
any
|
getDefaultView()
Get's the default view of the application: String. |
any
|
getEventCacheableEntry()
Get the event cacheable entry. |
any
|
getEventName()
The event name used by the application: String. |
struct
|
getFolderLayouts()
Get the registered folder layout associations map. |
struct
|
getHTTPBasicCredentials()
Returns the username and password sent via HTTP basic authentication. |
any
|
getHTTPContent()
Get the raw HTTP content. |
any
|
getHTTPHeader(string header, [any default])
Get a HTTP header. |
any
|
getHTTPMethod()
Get the HTTP Request Method Type. |
any
|
getMemento()
Get the state of this request context. |
any
|
getModuleRoot([any module=''])
Convenience method to get the current request's module root path. |
struct
|
getRegisteredLayouts()
Get all the registered layouts in the configuration file. |
any
|
getRenderData()
Get the renderData structure. |
struct
|
getRoutedStruct()
Get the routed structure of key-value pairs. |
string
|
getSESBaseURL()
Get the ses base URL for this request. |
any
|
getSelf()
Returns index. |
numeric
|
getSize([boolean private='false'])
Returns the number of elements in the collection. |
Any
|
getTrimValue(any name, [any defaultValue], [boolean private='false'])
I Get a value from the request collection and if simple value, I will trim it. |
Any
|
getValue(any name, [any defaultValue], [any private='false'])
I Get a value from the public or private request collection. |
any
|
getViewCacheableEntry()
Get the event cacheable entry. |
struct
|
getViewLayouts()
Get the registered view layout associations map. |
boolean
|
isAjax()
Determines if in an Ajax call or not by looking at the request headers. |
any
|
isEventCacheable()
Check wether the incoming event has been flagged for caching. |
any
|
isNoExecution()
Determine if we need to execute an incoming event or not. |
any
|
isNoRender()
Is this a no render request. |
boolean
|
isProxyRequest()
Is this a coldbox proxy request. |
boolean
|
isSES()
Determine if you are in SES mode. |
boolean
|
isSSL()
Returns boolean result whether current request is in ssl or not. |
boolean
|
isViewCacheable()
Check wether the incoming view has been flagged for caching. |
any
|
noExecution()
Set that the request will not execute an incoming event. |
any
|
noLayout()
Mark this request to not use a layout for rendering. |
any
|
noRender([boolean remove='false'])
Set the flag that tells the framework not to render, just execute. |
any
|
overrideEvent([any event])
I Override the current event in the request collection. |
any
|
paramValue(any name, any value, [boolean private='false'])
Just like cfparam, but for the request collection. |
any
|
removeEventCacheableEntry()
Remove the cacheable entry. |
any
|
removeValue(string name, [boolean private='false'])
I remove a value in the request collection. |
any
|
renderData([string type='HTML'], any data, string contentType='', [string encoding='utf-8'], [numeric statusCode='200'], [string statusText=''], [string location=''], [string jsonCallback=''], [string jsonQueryFormat='query'], [boolean jsonAsText='false'], [string xmlColumnList=''], [boolean xmlUseCDATA='false'], [string xmlListDelimiter=','], [string xmlRootName=''], [struct pdfArgs='[runtime expression]'], [any formats=''], [any formatsView=''], [boolean isBinary='false'])
Use this method to tell the framework to render data for you. |
private any
|
renderWithFormats()
Render With Formats. |
any
|
setDefaultLayout(string DefaultLayout)
Override the default layout for a request. |
any
|
setDefaultView(string DefaultView)
Override the default view for a request. |
any
|
setEventCacheableEntry(any mdCacheEntry)
Set the event cacheable entry. |
any
|
setHTTPHeader([string statusCode], [string statusText=''], [string name], [string value=''], [string charset='UTF-8'])
Set an HTTP Header. |
any
|
setLayout(any name, [any module=''])
I Set the layout to override and render. |
any
|
setMemento(any memento)
Set the state of this request context. |
any
|
setProxyRequest()
Set that this is a proxy request. |
any
|
setRoutedStruct(struct routedStruct)
Set routed struct of key-value pairs. |
any
|
setSESBaseURL(string sesBaseURL)
Set the ses base URL for this request. |
any
|
setValue(any name, any value, [boolean private='false'])
I Set a value in the request collection. |
any
|
setView([any view], [boolean nolayout='false'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any layout], [any module=''], [struct args='[runtime expression]'])
I Set the view to render in this request. |
any
|
setViewCacheableEntry(any mdCacheEntry)
Set the view cacheable entry. |
any
|
setisSES(boolean isSES)
Set the isSES flag, usualy done by the SES interceptor. |
any
|
showDebugPanel(boolean show)
I can override to show or not the debug panel. |
boolean
|
valueExists(any name, [boolean private='false'])
I Check if a value exists in the request collection. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
constructor
properties
- The context properties structcontroller
- The ColdBox ControllerMethod Detail |
---|
Facade for cfmx dump
var
isAbort
- Abort alsoFacade for cfthrow
message
detail
type
Builds a link to a passed event, either SES or normal link. If the ses interceptor is declared it will create routes.
linkto
- The event or route you want to create the link totranslate
- Translate between . and / depending on the ses mode. So you can just use dot notation.ssl
- If true, it will change http to https if found in the ses base url.baseURL
- If not using SES, you can use this argument to create your own base url apart from the default of index.cfm. Example: https://mysample.com/index.cfmqueryString
- The query string to append, if needed.Clears the entire collection
private
- Use public or private request collectionAppend a structure to the collection, with overwrite or not. Overwrite = false by default
collection
- A collection to appendoverwrite
- If you need to override data in the collection, set this to true.private
- Use public or private request collectionI Get a reference or deep copy of the public or private request Collection
deepCopyFlag
- Default is false, gives a reference to the collection. True, creates a deep copy of the collection.private
- Use public or private request collectionGets the current action requested in the current event: String
Gets the current incoming event
Gets the current handler requested in the current event: String
Gets the current set layout for rendering
Gets the current set layout's module for rendering
Gets the current module name, else returns empty string
Get the current request's SES route that matched
Get the current routed namespace that matched the SES route, if any
Get the current routed URL that matched the SES route
Gets the current set view the framework will try to render for this request
Gets the current set view the framework will try to render for this request
Gets the current set views's module for rendering
I return the debugpanel flag for this request.
Get's the default layout of the application: String
Get's the default view of the application: String
Get the event cacheable entry
The event name used by the application: String
Get the registered folder layout associations map
Returns the username and password sent via HTTP basic authentication
Get the raw HTTP content
Get a HTTP header
header
- The header keydefault
- A default value if the header does not existGet the HTTP Request Method Type
Get the state of this request context
Convenience method to get the current request's module root path. If no module, then returns empty path. You can also get this from the modules settings.
module
- Optional name of the module you want the root for, defaults to the current moduleGet all the registered layouts in the configuration file
Get the renderData structure.
Get the routed structure of key-value pairs. What the ses interceptor could match.
Get the ses base URL for this request
Returns index.cfm?{eventName}= : String
Returns the number of elements in the collection
private
- Use public or private request collectionI Get a value from the request collection and if simple value, I will trim it.
name
- Name of the variable to get from the request collectiondefaultValue
- Default value to return if not found.private
- Use public or private request collectionI Get a value from the public or private request collection.
name
- Name of the variable to get from the request collectiondefaultValue
- Default value to return if not found.private
- Use public or private request collection. BooleanGet the event cacheable entry
Get the registered view layout associations map
Determines if in an Ajax call or not by looking at the request headers
Check wether the incoming event has been flagged for caching. Boolean
Determine if we need to execute an incoming event or not.
Is this a no render request
Is this a coldbox proxy request
Determine if you are in SES mode.
Returns boolean result whether current request is in ssl or not
Check wether the incoming view has been flagged for caching
Set that the request will not execute an incoming event. Most likely simulating a servlet call.
Mark this request to not use a layout for rendering
Set the flag that tells the framework not to render, just execute
remove
- If true, it removes the flag, else its set.I Override the current event in the request collection. This method does not execute the event, it just replaces the event to be executed by the framework's RunEvent() method. This method is usually called from an onRequestStart or onApplicationStart method.
event
- The name of the event to override.Just like cfparam, but for the request collection
name
- Name of the variable to param in the request collection: Stringvalue
- The value of the variable to set if not found.private
- Use public or private request collectionRemove the cacheable entry
I remove a value in the request collection
name
- The name of the variable to remove.private
- Use public or private request collectionUse this method to tell the framework to render data for you. The framework will take care of marshalling the data for you
type
- The type of data to render. Valid types are JSON, JSONP, JSONT, XML, WDDX, PLAIN/HTML, TEXT, PDF. The deafult is HTML or PLAIN. If an invalid type is sent in, this method will throw an errordata
- The data you would like to marshall and return by the frameworkcontentType
- The content type of the data. This will be used in the cfcontent tag: text/html, text/plain, text/xml, text/json, etc. The default value is text/html. However, if you choose JSON this method will choose application/json, if you choose WDDX or XML this method will choose text/xml for you. The default encoding is utf-8encoding
- The default character encoding to usestatusCode
- The HTTP status code to send to the browser. Defaults to 200statusText
- Explains the HTTP status code sent to the browser.location
- Optional argument used to set the HTTP Location headerjsonCallback
- Only needed when using JSONP, this is the callback to add to the JSON packetjsonQueryFormat
- JSON Only: query or array format for encoding. The default is CF query standardjsonAsText
- If set to false, defaults content mime-type to application/json, else will change encoding to plain/textxmlColumnList
- XML Only: Choose which columns to inspect, by default it uses all the columns in the query, if using a queryxmlUseCDATA
- XML Only: Use CDATA content for ALL values. The default is falsexmlListDelimiter
- XML Only: The delimiter in the list. Comma by defaultxmlRootName
- XML Only: The name of the initial root element of the XML packetpdfArgs
- All the PDF arguments to pass along to the CFDocument tag.formats
- The formats list or array that ColdBox should respond to using the passed in data argument. You can pass any of the valid types (JSON,JSONP,JSONT,XML,WDDX,PLAIN,HTML,TEXT,PDF). For PDF and HTML we will try to render the view by convention based on the incoming event.formatsView
- The view that should be used for rendering HTML/PLAIN/PDF. By default ColdBox uses the name of the event as an implicit view.isBinary
- Bit that determines if the data being set for rendering is binary or not.Render With Formats
Override the default layout for a request
DefaultLayout
Override the default view for a request
DefaultView
Set the event cacheable entry
mdCacheEntry
- The cache entry we need to get to cacheSet an HTTP Header
statusCode
- A status codestatusText
- A status textname
- The header namevalue
- The header valuecharset
- The charset to useI Set the layout to override and render. Layouts are pre-defined in the config file. However I can override these settings if needed. Do not append a the cfm extension. Private Request Collection name: currentLayout
name
- The name or alias of the layout file to set.module
- Is the layout from a module or notSet the state of this request context
memento
Set that this is a proxy request
Set routed struct of key-value pairs. This is used only by the SES interceptor. Not for public use.
routedStruct
Set the ses base URL for this request
sesBaseURL
I Set a value in the request collection
name
- The name of the variable to set. Stringvalue
- The value of the variable to setprivate
- Use public or private request collectionI Set the view to render in this request. Private Request Collection Name: currentView, currentLayout
view
- The name of the view to set. If a layout has been defined it will assign it, else if will assign the default layout. No extension pleasenolayout
- Boolean flag, wether the view sent in will be using a layout or not. Default is false. Uses a pre set layout or the default layout.cache
- True if you want to cache the rendered view.cacheTimeout
- The cache timeoutcacheLastAccessTimeout
- The last access timeoutcacheSuffix
- Add a cache suffix to the view cache entry. Great for multi-domain caching or i18n caching.cacheProvider
- The cache provider you want to use for storing the rendered view. By default we use the 'template' cache providerlayout
- You can override the rendering layout of this setView() call if you want to. Else it defaults to implicit resolution or another override.module
- Is the view from a module or notargs
- An optional set of arguments that will be available when the view is renderedSet the view cacheable entry
mdCacheEntry
- The cache entry we need to get to cacheSet the isSES flag, usualy done by the SES interceptor
isSES
I can override to show or not the debug panel. Very useful in AJAX debugging
show
I Check if a value exists in the request collection.
name
- Name of the variable to find in the request collection: Stringprivate
- Use public or private request collection