|
ColdBox Platform v3.8.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.FrameworkSupertype
coldbox.system.Interceptor
coldbox.system.interceptors.SES
public class SES
This interceptor provides complete SES and URL mappings support to ColdBox Applications
Method Summary | |
---|---|
any |
addModuleRoutes(string pattern, string module, [boolean append='true'])
Register modules routes in the specified position in the main routing table, and returns itself |
any |
addNamespace(string pattern, string namespace, [boolean append='true'])
Register a namespace in the specified position in the main routing table, and returns itself |
any |
addRoute(string pattern, [string handler], [any action], [boolean packageResolverExempt='false'], [string matchVariables], [string view], [boolean viewNoLayout='false'], [boolean valuePairTranslation='true'], [any constraints=''], [string module=''], [string moduleRouting=''], [string namespace=''], [string namespaceRouting=''], [boolean ssl='false'], [boolean append='true'], [any response], [numeric statusCode], [string statusText], [any condition])
Adds a route to dispatch and returns itself |
private void |
checkForInvalidURL(any route, any script_name, any event)
Check for invalid URL's |
void |
configure()
This is where the ses plugin configures itself |
private any |
detectExtension(any requestString, any event)
Detect extensions from the incoming request |
any |
endWith()
End a with closure and returns itself |
private void |
findConventionNameValuePairs(string requestString, any match, struct params)
Find the convention name value pairs |
private any |
findRoute(any action, any event, [any module=''], [any namespace=''])
Figures out which route matches this request and returns a routed structure |
private any |
fixIISURLVars(any requestString, any rc)
Clean up some IIS funkyness |
any<boolean> |
getAutoReload()
Set to auto reload the rules in each request |
string |
getBaseURL()
Get BaseURL |
private any |
getCGIElement(any cgielement, any Event)
The cgi element facade method |
private any |
getCleanedPaths(any rc, any event)
Get and Clean the path_info and script names structure |
private string |
getDefaultFrameworkAction()
Get the default framework action |
any<boolean> |
getEnabled()
Get enabled |
any<boolean> |
getExtensionDetection()
Get the flag if extension detection is enabled |
any<boolean> |
getLooseMatching()
Get the current loose matching property |
any<array> |
getModuleRoutes(any module='')
Get a modules routes array |
any<struct> |
getModulesRoutingTable()
Get the entire modules routing table |
any<array> |
getNamespaceRoutes(any namespace)
Get a namespace routes array |
any<struct> |
getNamespaceRoutingTable()
Get the entire namespace routing table |
any<array> |
getRoutes()
Get the array containing all the routes |
any<boolean> |
getThrowOnInvalidExtension()
Get if we are throwing or not on invalid extension detection |
any<boolean> |
getUniqueURLs()
Get uniqueURLs |
private any<coldbox.system.core.util.Util> |
getUtil()
Create and return a util object |
any |
getValidExtensions()
Get the list of valid extensions this interceptor allows |
private void |
importConfiguration()
Import the routing configuration file |
any |
includeRoutes(any location)
Includes a routes configuration file as an added import and returns itself after import |
void |
onRequestCapture(any event, any interceptData)
This is the route dispatch |
private any |
packageResolver(any routingString, any routeParams, [any module=''])
Resolve handler/module packages |
private void |
processRouteOptionals(struct thisRoute)
Process route optionals |
private any |
processWith(any args)
Process a with closure |
any |
removeModuleRoutes(any module)
Remove a module's routing table and registration points and return itself |
any |
removeNamespaceRoutes(any namespace)
Remove a namespace's routing table and registration points and return itself |
private any |
renderResponse(any route, any event)
Render a RESTful response |
private any |
serializeURL([any formVars=''], any event)
Serialize a URL when invalid |
any |
setAutoReload(any<boolean> autoReload)
Set the auto reload flag and return itself |
any |
setBaseURL(string baseURL)
Set the base URL for the application and return itself |
any |
setEnabled(any<boolean> enabled)
Set whether the interceptor is enabled or not and return itself |
any |
setExtensionDetection(any<boolean> extensionDetection)
Call it to activate/deactivate automatic extension detection and return itself |
any |
setLooseMatching(any<boolean> looseMatching)
Set the loose matching property of the interceptor and return itself |
void |
setModuleRoutingTable(any<struct> routes)
Set the module routing table |
void |
setRoutes(any<array> routes)
Internal override of the routes array |
any |
setThrowOnInvalidExtension(any<boolean> throwOnInvalidExtension)
Configure the interceptor to throw an exception or not when invalid extensions are detected and return itself |
any |
setUniqueURLs(any<boolean> uniqueURLs)
Set the uniqueURLs property and return itself |
any |
setValidExtensions(any validExtensions)
Setup the list of valid extensions to detect automatically for you |
any |
with([string pattern], [string handler], [any action], [boolean packageResolverExempt], [string matchVariables], [string view], [boolean viewNoLayout], [boolean valuePairTranslation], [any constraints], [string module], [string moduleRouting], [string namespace], [string namespaceRouting], [boolean ssl], [boolean append])
Starts a with closure, where all arguments will be prefixed for the next concatenated addRoute() methods until an endWith() is called |
Methods inherited from class coldbox.system.Interceptor |
---|
appendToBuffer, clearBuffer, getBufferObject, getBufferString, getInterceptorService, getProperties, getProperty, init, propertyExists, setProperties, setProperty, unregister
|
Methods inherited from class WEB-INF.cftags.component |
---|
None
|
Method Detail |
---|
public any addModuleRoutes(string pattern, string module, [boolean append='true'])
pattern
- The pattern to match against the URL.module
- The module to load routes forappend
- Whether the module entry point route should be appended or pre-pended to the main routes array. By default we append to the end of the arraypublic any addNamespace(string pattern, string namespace, [boolean append='true'])
pattern
- The pattern to match against the URL.namespace
- The name of the namespace to registerappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the arraypublic any addRoute(string pattern, [string handler], [any action], [boolean packageResolverExempt='false'], [string matchVariables], [string view], [boolean viewNoLayout='false'], [boolean valuePairTranslation='true'], [any constraints=''], [string module=''], [string moduleRouting=''], [string namespace=''], [string namespaceRouting=''], [boolean ssl='false'], [boolean append='true'], [any response], [numeric statusCode], [string statusText], [any condition])
pattern
- The pattern to match against the URL.handler
- The handler to execute if pattern matched.action
- The action in a handler to execute if a pattern is matched. This can also be a structure based on the HTTP method(GET,POST,PUT,DELETE). ex: {GET:'show', PUT:'update', DELETE:'delete', POST:'save'}packageResolverExempt
- If this is set to true, then the interceptor will not try to do handler package resolving. Else a package will always be resolved. Only works if :handler is in a patternmatchVariables
- A string of name-value pair variables to add to the request collection when this pattern matches. This is a comma delimmitted list. Ex: spaceFound=true,missingAction=onTestview
- The view to dispatch if pattern matches. No event will be fired, so handler,action will be ignored.viewNoLayout
- If view is choosen, then you can choose to override and not display a layout with the view. Else the view renders in the assigned layout.valuePairTranslation
- Activate convention name value pair translations or not. Turned on by defaultconstraints
- A structure of regex constraint overrides for variable placeholders. The key is the name of the variable, the value is the regex to try to match.module
- The module to add this route tomoduleRouting
- Called internally by addModuleRoutes to add a module routing route.namespace
- The namespace to add this route tonamespaceRouting
- Called internally by addNamespaceRoutes to add a namespaced routing route.ssl
- Makes the route an SSL only route if true, else it can be anything. If an ssl only route is hit without ssl, the interceptor will redirect to it via sslappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the arrayresponse
- An HTML response string to send back or a closure to be executed that should return the response. The closure takes in a 'params' struct of all matched params and the string will be parsed with the named value pairs as ${param}statusCode
- The HTTP status code to send to the browser response.statusText
- Explains the HTTP status code sent to the browser response.condition
- A closure or UDF to execute that MUST return true to use route if matched or false and continue.private void checkForInvalidURL(any route, any script_name, any event)
route
script_name
event
public void configure()
private any detectExtension(any requestString, any event)
requestString
- The requested URL stringevent
- The event object.public any endWith()
private void findConventionNameValuePairs(string requestString, any match, struct params)
requestString
- The request stringmatch
- The regex matcherparams
- The parameter structureprivate any findRoute(any action, any event, [any module=''], [any namespace=''])
action
- The action evaluated by the path_infoevent
- The event object.module
- Find a route on a modulenamespace
- Find a route on a namespaceprivate any fixIISURLVars(any requestString, any rc)
requestString
- The request stringrc
- The request collectionpublic any<boolean> getAutoReload()
public string getBaseURL()
private any getCGIElement(any cgielement, any Event)
cgielement
- The cgi element to retrieveEvent
- The event object.private any getCleanedPaths(any rc, any event)
rc
- The request collection to incorporate items intoevent
- The event object.private string getDefaultFrameworkAction()
public any<boolean> getEnabled()
public any<boolean> getExtensionDetection()
public any<boolean> getLooseMatching()
public any<array> getModuleRoutes(any module='')
module
- The name of the modulepublic any<struct> getModulesRoutingTable()
public any<array> getNamespaceRoutes(any namespace)
namespace
- The name of the namespacepublic any<struct> getNamespaceRoutingTable()
public any<array> getRoutes()
public any<boolean> getThrowOnInvalidExtension()
public any<boolean> getUniqueURLs()
private any<coldbox.system.core.util.Util> getUtil()
public any getValidExtensions()
private void importConfiguration()
public any includeRoutes(any location)
location
- The include location of the routes configuration template. Do not add '.cfm'public void onRequestCapture(any event, any interceptData)
event
- The event object.interceptData
- interceptData of intercepted info.private any packageResolver(any routingString, any routeParams, [any module=''])
routingString
- The routing stringrouteParams
- The routed params arraymodule
- Tells package resolver this is an explicit module package resolving callprivate void processRouteOptionals(struct thisRoute)
thisRoute
- The route structprivate any processWith(any args)
args
- The arguments to processpublic any removeModuleRoutes(any module)
module
- The name of the module to removepublic any removeNamespaceRoutes(any namespace)
namespace
- The name of the namespace to removeprivate any renderResponse(any route, any event)
route
- The route responseevent
- The event object.private any serializeURL([any formVars=''], any event)
formVars
event
public any setAutoReload(any<boolean> autoReload)
autoReload
public any setBaseURL(string baseURL)
baseURL
public any setEnabled(any<boolean> enabled)
enabled
public any setExtensionDetection(any<boolean> extensionDetection)
extensionDetection
public any setLooseMatching(any<boolean> looseMatching)
looseMatching
public void setModuleRoutingTable(any<struct> routes)
routes
public void setRoutes(any<array> routes)
routes
public any setThrowOnInvalidExtension(any<boolean> throwOnInvalidExtension)
throwOnInvalidExtension
public any setUniqueURLs(any<boolean> uniqueURLs)
uniqueURLs
public any setValidExtensions(any validExtensions)
validExtensions
- A list of valid extensions to allow in a requestpublic any with([string pattern], [string handler], [any action], [boolean packageResolverExempt], [string matchVariables], [string view], [boolean viewNoLayout], [boolean valuePairTranslation], [any constraints], [string module], [string moduleRouting], [string namespace], [string namespaceRouting], [boolean ssl], [boolean append])
pattern
- The pattern to match against the URL.handler
- The handler to execute if pattern matched.action
- The action in a handler to execute if a pattern is matched. This can also be a structure based on the HTTP method(GET,POST,PUT,DELETE). ex: {GET:'show', PUT:'update', DELETE:'delete', POST:'save'}packageResolverExempt
- If this is set to true, then the interceptor will not try to do handler package resolving. Else a package will always be resolved. Only works if :handler is in a patternmatchVariables
- A string of name-value pair variables to add to the request collection when this pattern matches. This is a comma delimmitted list. Ex: spaceFound=true,missingAction=onTestview
- The view to dispatch if pattern matches. No event will be fired, so handler,action will be ignored.viewNoLayout
- If view is choosen, then you can choose to override and not display a layout with the view. Else the view renders in the assigned layout.valuePairTranslation
- Activate convention name value pair translations or not. Turned on by defaultconstraints
- A structure of regex constraint overrides for variable placeholders. The key is the name of the variable, the value is the regex to try to match.module
- The module to add this route tomoduleRouting
- Called internally by addModuleRoutes to add a module routing route.namespace
- The namespace to add this route tonamespaceRouting
- Called internally by addNamespaceRoutes to add a namespaced routing route.ssl
- Makes the route an SSL only route if true, else it can be anything. If an ssl only route is hit without ssl, the interceptor will redirect to it via sslappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the array
|
ColdBox Platform v3.8.0 | ||||
FRAMES |