box.system.web.context.concurrent.Callable interface">
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.web.context.RequestContext
public class 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)
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 |
void |
NoRender([boolean remove='false'])
Set the flag that tells the framework not to render, just execute |
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 |
void |
clearCollection([boolean private='false'])
Clear the entire collection |
void |
collectionAppend(any collection, [boolean overwrite='false'], [boolean private='false'])
Append a structure to the collection, with overwrite or not |
any |
getCollection([boolean DeepCopyFlag='false'], [boolean private='false'])
I Get a reference or deep copy of the request Collection: Returns a structure |
any |
getCurrentAction()
Gets the current action requested in the current event: String |
any |
getCurrentEvent()
Gets the current set event: String |
any |
getCurrentHandler()
Gets the current handler requested in the current event: String |
string |
getCurrentLayout()
Gets the current set layout |
any |
getCurrentModule()
Gets the current module, if any |
string |
getCurrentRoute()
Get the current request's URL route if found |
string |
getCurrentRoutedURL()
Get the current request's routed URL string if found |
string |
getCurrentView()
Gets the current set view |
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 |
any |
getHTTPHeader(string header, [any default])
Get a HTTP header |
string |
getHTTPMethod()
Get the HTTP Request Method Type |
any |
getMemento()
Get the state of this request context |
any |
getModuleRoot()
Convenience method to get the current request's module root path |
struct |
getRegisteredLayouts()
Get all the registered layouts in the configuration file |
struct |
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'])
The number of elements in the collection |
Any |
getTrimValue(any name, [any defaultValue='NONE'], [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='NONE'], [boolean private='false'])
I Get a value from the request collection |
any |
getViewCacheableEntry()
Get the event cacheable entry |
struct |
getViewLayouts()
Get the registered view layout associations map |
boolean |
isEventCacheable()
Check wether the incoming event has been flagged for caching |
boolean |
isNoExecution()
Determine if we need to execute an incoming event or not |
boolean |
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 |
void |
noExecution()
Set that the request will not execute an incoming event |
void |
overrideEvent([string event])
I Override the current event in the request collection |
void |
paramValue([any name], [Any value], [boolean private='false'])
Just like cfparam, but for the request collection |
void |
removeEventCacheableEntry()
Remove the cacheable entry |
void |
removeValue([string name], [boolean private='false'])
I remove a value in the request collection |
void |
renderData(string type='PLAIN', any data, string contentType='', [string encoding='utf-8'], [numeric statusCode='200'], [string statusText=''], [string jsonCase='lower'], [string jsonQueryFormat='query'], [boolean jsonAsText='false'], [string xmlColumnList=''], [boolean xmlUseCDATA='false'], [string xmlListDelimiter=','], [string xmlRootName=''])
Use this method to tell the framework to render data for you |
void |
setDefaultLayout(string DefaultLayout)
Override the default layout for a request |
void |
setDefaultView(string DefaultView)
Override the default view for a request |
void |
setEventCacheableEntry(any mdCacheEntry)
Set the event cacheable entry |
void |
setLayout([string name])
I Set the layout to override and render |
void |
setMemento(any memento)
Set the state of this request context |
void |
setProxyRequest()
Set that this is a proxy request |
void |
setRoutedStruct(struct routedStruct)
Set routed struct of key-value pairs |
void |
setSESBaseURL(string sesBaseURL)
Set the ses base URL for this request |
void |
setValue([any name], [Any value], [boolean private='false'])
I Set a value in the request collection |
void |
setView(string name, [boolean nolayout='false'], [boolean cache='false'], [string cacheTimeout=''], [string cacheLastAccessTimeout=''], [string cacheSuffix=''], [string layout])
I Set the view to render in this request |
void |
setViewCacheableEntry(any mdCacheEntry)
Set the view cacheable entry |
void |
setisSES(boolean isSES)
Set the isSES flag, usualy done by the SES interceptor |
void |
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 |
|---|
|
| Constructor Detail |
|---|
public init(any properties)
properties - The context properties struct| Method Detail |
|---|
private void $dump(any var, [boolean isAbort='false'])
varisAbort - Abort alsoprivate any $throw(string message, [string detail=''], [string type='Framework'])
messagedetailtypepublic void NoRender([boolean remove='false'])
remove - If true, it removes the flag, else its set.public any buildLink(string linkto, [boolean translate='true'], [boolean ssl='false'], [string baseURL=''], [string queryString=''])
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.public void clearCollection([boolean private='false'])
private - Use public or private request collectionpublic void collectionAppend(any collection, [boolean overwrite='false'], [boolean private='false'])
collection - A collection to appendoverwrite - If you need to override data in the collection, set this to true.private - Use public or private request collectionPublic any getCollection([boolean DeepCopyFlag='false'], [boolean private='false'])
DeepCopyFlag - Default is false, gives a reference to the collection. True, creates a deep copy of the collection.private - Use public or private request collectionpublic any getCurrentAction()
public any getCurrentEvent()
public any getCurrentHandler()
public string getCurrentLayout()
public any getCurrentModule()
public string getCurrentRoute()
public string getCurrentRoutedURL()
public string getCurrentView()
public boolean getDebugPanelFlag()
public any getDefaultLayout()
public any getDefaultView()
public any getEventCacheableEntry()
public any getEventName()
public struct getFolderLayouts()
public any getHTTPHeader(string header, [any default])
header - The header keydefault - A default value if the header does not existpublic string getHTTPMethod()
public any getMemento()
public any getModuleRoot()
public struct getRegisteredLayouts()
public struct getRenderData()
public struct getRoutedStruct()
public string getSESBaseURL()
public any getSelf()
public numeric getSize([boolean private='false'])
private - Use public or private request collectionPublic Any getTrimValue(any name, [any defaultValue='NONE'], [boolean private='false'])
name - Name of the variable to get from the request collectiondefaultValue - Default value to return if not found.private - Use public or private request collectionPublic Any getValue(any name, [any defaultValue='NONE'], [boolean private='false'])
name - Name of the variable to get from the request collectiondefaultValue - Default value to return if not found.private - Use public or private request collectionpublic any getViewCacheableEntry()
public struct getViewLayouts()
public boolean isEventCacheable()
public boolean isNoExecution()
public boolean isNoRender()
public boolean isProxyRequest()
public boolean isSES()
public boolean isSSL()
public boolean isViewCacheable()
public void noExecution()
Public void overrideEvent([string event])
event - The name of the event to override.Public void paramValue([any name], [Any value], [boolean private='false'])
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 collectionpublic void removeEventCacheableEntry()
Public void removeValue([string name], [boolean private='false'])
name - The name of the variable to remove.private - Use public or private request collectionpublic void renderData(string type='PLAIN', any data, string contentType='', [string encoding='utf-8'], [numeric statusCode='200'], [string statusText=''], [string jsonCase='lower'], [string jsonQueryFormat='query'], [boolean jsonAsText='false'], [string xmlColumnList=''], [boolean xmlUseCDATA='false'], [string xmlListDelimiter=','], [string xmlRootName=''])
type - The type of data to render. Valid types are JSON, XML, WDDX, PLAIN. THe deafult is 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.jsonCase - JSON Only: Whether to use lower or upper case translations in the JSON transformation. Lower is defaultjsonQueryFormat - JSON Only: query or arrayjsonAsText - 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 packetpublic void setDefaultLayout(string DefaultLayout)
DefaultLayoutpublic void setDefaultView(string DefaultView)
DefaultViewpublic void setEventCacheableEntry(any mdCacheEntry)
mdCacheEntry - The cache entry we need to get to cachepublic void setLayout([string name])
name - The name or alias of the layout file to set.public void setMemento(any memento)
mementopublic void setProxyRequest()
public void setRoutedStruct(struct routedStruct)
routedStructpublic void setSESBaseURL(string sesBaseURL)
sesBaseURLPublic void setValue([any name], [Any value], [boolean private='false'])
name - The name of the variable to set. Stringvalue - The value of the variable to setprivate - Use public or private request collectionpublic void setView(string name, [boolean nolayout='false'], [boolean cache='false'], [string cacheTimeout=''], [string cacheLastAccessTimeout=''], [string cacheSuffix=''], [string layout])
name - 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 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.layout - You can override the rendering layout of this setView() call if you want to. Else it defaults to implicit resolution or another override.public void setViewCacheableEntry(any mdCacheEntry)
mdCacheEntry - The cache entry we need to get to cachepublic void setisSES(boolean isSES)
isSESpublic void showDebugPanel(boolean show)
showPublic boolean valueExists([any name], [boolean private='false'])
name - Name of the variable to find in the request collection: Stringprivate - Use public or private request collection
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||