railo-context.Component coldbox.system.FrameworkSupertype coldbox.system.Interceptor coldbox.system.interceptors.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 service 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. |
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<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, getCachebox, getFlash, getInterceptorService, getLog, getLogBox, getProperties, getProperty, getWirebox, init, propertyExists, setCachebox, setFlash, setInterceptorService, setLog, setLogBox, setProperties, setProperty, setWirebox, unregister |
Methods inherited from class railo-context.Component |
---|
None |
Method Detail |
---|
Register modules routes in the specified position in the main routing table, and returns itself
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 arrayRegister a namespace in the specified position in the main routing table, and returns itself
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 arrayAdds a route to dispatch and returns itself.
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.Check for invalid URL's
route
script_name
event
This is where the ses service configures itself.
configure
in class
Interceptor
Detect extensions from the incoming request
requestString
- The requested URL stringevent
- The event object.End a with closure and returns itself
Find the convention name value pairs
requestString
- The request stringmatch
- The regex matcherparams
- The parameter structureFigures out which route matches this request and returns a routed structure
action
- The action evaluated by the path_infoevent
- The event object.module
- Find a route on a modulenamespace
- Find a route on a namespaceClean up some IIS funkyness
requestString
- The request stringrc
- The request collectionSet to auto reload the rules in each request
Get BaseURL
The cgi element facade method
cgielement
- The cgi element to retrieveEvent
- The event object.Get and Clean the path_info and script names structure
rc
- The request collection to incorporate items intoevent
- The event object.Get enabled
Get the flag if extension detection is enabled
Get the current loose matching property
Get a modules routes array
module
- The name of the moduleGet the entire modules routing table
Get a namespace routes array
namespace
- The name of the namespaceGet the entire namespace routing table
Get the array containing all the routes
Get if we are throwing or not on invalid extension detection
Get uniqueURLs
Create and return a util object
Get the list of valid extensions this interceptor allows
Import the routing configuration file
Includes a routes configuration file as an added import and returns itself after import
location
- The include location of the routes configuration template. Do not add '.cfm'This is the route dispatch
event
- The event object.interceptData
- interceptData of intercepted info.Resolve handler/module packages
routingString
- The routing stringrouteParams
- The routed params arraymodule
- Tells package resolver this is an explicit module package resolving callProcess route optionals
thisRoute
- The route structProcess a with closure
args
- The arguments to processRemove a module's routing table and registration points and return itself
module
- The name of the module to removeRemove a namespace's routing table and registration points and return itself
namespace
- The name of the namespace to removeRender a RESTful response
route
- The route responseevent
- The event object.Serialize a URL when invalid
formVars
event
Set the auto reload flag and return itself
autoReload
Set the base URL for the application and return itself
baseURL
Set whether the interceptor is enabled or not and return itself
enabled
Call it to activate/deactivate automatic extension detection and return itself
extensionDetection
Set the loose matching property of the interceptor and return itself
looseMatching
Set the module routing table
routes
Internal override of the routes array
routes
Configure the interceptor to throw an exception or not when invalid extensions are detected and return itself
throwOnInvalidExtension
Set the uniqueURLs property and return itself
uniqueURLs
Setup the list of valid extensions to detect automatically for you.: e.g.: json,xml,rss. Return itself
validExtensions
- A list of valid extensions to allow in a requestStarts a with closure, where all arguments will be prefixed for the next concatenated addRoute() methods until an endWith() is called
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