coldbox.system.web.services

Class RoutingService

lucee.Component
    extended by coldbox.system.web.services.BaseService
      extended by coldbox.system.web.services.RoutingService

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This service is in charge of URL routing in ColdBox

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any<Router> router
          A ColdBox Router this routing service configures with.

    • access = public
    • returntype = any
    • doc_generic = coldbox.system.web.routing.Router
    true false
    Constructor Summary
    init(any controller)
          Constructor.
    Method Summary
    private any checkForInvalidURL(any route, any script_name, any event)
         Check for invalid URL's.
    private any detectExtension(any requestString, any event)
         Detect extensions from the incoming request.
    private any findConventionNameValuePairs(string requestString, any match, struct params)
         Find the convention name value pairs in the incoming request string, if found, we will incorporate them into the incoming `params` arguments.
    struct findRoute(any action, any event, [any module=''], [any namespace=''], [any domain=''])
         Figures out which route matches this request and returns a routed structure containing.
    private any fixIISURLVars(any requestString, any rc)
         Clean up some IIS funkyness where query string is found in the path info.
    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.
    string getRouter()
    private any loadRouter()
         Load a ColdBox Router CFC or a legacy router CFM template.
    any onConfigurationLoad()
         Once configuration loads prepare for operation.
    any onMissingMethod([any missingMethodName], [any missingMethodArguments='[runtime expression]'])
         Passthrough for legacy support of calling Router methods.
    void onRequestCapture([any event], [any interceptData], [any rc], [any prc], [any buffer])
         This is the route dispatcher called upon the request is captured.
    private any packageResolver(any routingString, any routeParams, [any module=''])
         Resolve handler/module packages.
    any processRoute(struct routeResults, any event, any rc, any prc)
         Process a route result to be used by the request.
    private any renderResponse(any route, any event)
         Render a RESTFul response.
    private any serializeURL([any formVars=''], any event)
         Serialize a URL when invalid.
    any setRouter(any router)
     
    Methods inherited from class coldbox.system.web.services.BaseService
    getController, onShutdown, setController
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any controller)

    Constructor

    Parameters:
    controller

    Property Detail

    router

    property any<Router> router

    A ColdBox Router this routing service configures with.

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - coldbox.system.web.routing.Router
    serializable - true

    Method Detail

    checkForInvalidURL

    private any checkForInvalidURL(any route, any script_name, any event)

    Check for invalid URL's

    Parameters:
    route - The incoming route
    script_name - The cgi script name
    event - The event object

    detectExtension

    private any detectExtension(any requestString, any event)

    Detect extensions from the incoming request

    Parameters:
    requestString - The incoming request string
    event - The event object

    findConventionNameValuePairs

    private any findConventionNameValuePairs(string requestString, any match, struct params)

    Find the convention name value pairs in the incoming request string, if found, we will incorporate them into the incoming `params` arguments

    Parameters:
    requestString - the incoming request string
    match - The regex matcher object
    params - The incoming parameter struct

    findRoute

    public struct findRoute(any action, any event, [any module=''], [any namespace=''], [any domain=''])

    Figures out which route matches this request and returns a routed structure containing the `route` it discovered or an empty structure and the `params` structure which represents URL placeholders, convention name value pairs, matching variables, etc.

    Parameters:
    action - The action evaluated by path_info
    event - The event object
    module - Incoming module
    namespace - Incoming namespace
    domain - Incoming domain

    fixIISURLVars

    private any fixIISURLVars(any requestString, any rc)

    Clean up some IIS funkyness where query string is found in the path info. We basically clean it up and add the query string into the RC scope

    Parameters:
    requestString - the incoming request string
    rc - The request collection struct

    getCgiElement

    public any getCgiElement(any cgiElement, any event)

    The cgi element facade method

    Parameters:
    cgiElement - The element to take from CGI
    event - The event object

    getCleanedPaths

    private any getCleanedPaths(any rc, any event)

    Get and Clean the path_info and script names structure

    Parameters:
    rc - The incoming request collection
    event - The event object
    Returns:
    struct { pathInfo, scriptName, domain }

    getRouter

    public string getRouter()


    loadRouter

    private any loadRouter()

    Load a ColdBox Router CFC or a legacy router CFM template.


    onConfigurationLoad

    public any onConfigurationLoad()

    Once configuration loads prepare for operation

    Overrides:
    onConfigurationLoad in class BaseService

    onMissingMethod

    public any onMissingMethod([any missingMethodName], [any missingMethodArguments='[runtime expression]'])

    Passthrough for legacy support of calling Router methods. This will be removed in future versions.

    Parameters:
    missingMethodName
    missingMethodArguments

    onRequestCapture

    public void onRequestCapture([any event], [any interceptData], [any rc], [any prc], [any buffer])

    This is the route dispatcher called upon the request is captured.

    Parameters:
    event
    interceptData
    rc
    prc
    buffer

    packageResolver

    private any packageResolver(any routingString, any routeParams, [any module=''])

    Resolve handler/module packages

    Parameters:
    routingString - The incoming routing string
    routeParams - The incoming route parameters
    module - Module route or not

    processRoute

    public any processRoute(struct routeResults, any event, any rc, any prc)

    Process a route result to be used by the request

    Parameters:
    routeResults - The route results a findRoute() method returns
    event - The ColdBox Request context
    rc - The requset collection
    prc - The private request collection
    Returns:
    An event string that can be used for execution. Empty if using something else

    renderResponse

    private any renderResponse(any route, any event)

    Render a RESTFul response

    Parameters:
    route - The route response
    event - The event object

    serializeURL

    private any serializeURL([any formVars=''], any event)

    Serialize a URL when invalid

    Parameters:
    formVars - The incoming form variables
    event - The event object

    setRouter

    public any setRouter(any router)

    Parameters:
    router