wwServer::Process

The Process method is the main routing routine for incoming Web Connection requests. This method parses the base parameters/filenames and decides which Process class to call for request processing.

This method must be implemented by wwServer subclasses as the base method is generic. This method is generated by default and includes place holders to add additional process class handlers.

The bulk of an implementation typically contains a CASE statement that routes each script map or positional parameter to the appropriate process class.

Here's what a typical Process method looks like:

PROTECTED FUNCTION Process
LOCAL lcParameter, lcExtension, lcPhysicalPath

*** Retrieve first parameter
lcParameter=UPPER(THIS.oRequest.Querystring(1))  


*** Set up project types and call external processing programs:
DO CASE
      *** Legacy handling of wwMaint requests
      CASE lcParameter == "WWMAINT"
         DO wwMaint with  THIS
  OTHERWISE
     *** Check for Script Mapped files for: .WC, .WCS, .FXP
     lcPhysicalPath=THIS.oRequest.GetPhysicalPath()
     lcExtension = Upper(JustExt(lcPhysicalPath))    

     DO CASE
      *** Stock Extensions 
      CASE lcExtension = "WC" OR lcExtension == "FXP" OR lcExtension == "MD"
        DO wwScriptMaps with THIS

     *** Route to your Process class
     CASE lcExtension = "WD" 
        DO WebDemo with THIS

    OTHERWISE
     	this.ErrorMsg("Unhandled Request",;
     	"The server is not set up to handle the following extension: <b>." +  lcExtension + "</b>")

    ENDCASE
ENDCASE

RETURN

Note there are two nested CASE statements. The first checks for 'ordered' parameter which is the legacy style using urls like wwMaint~ClearErrorLog~100. The second block checks for script mapped extensions which is the most common ways requests are routed - including if set up extensionless Urls. Each CASE looks for a specific extension and maps it to and runs the appropriate Process class passing in the server object as a parameter which is how your custom Process class gets fired. The process class itself then has a way to route the script name preceeding the scriptmap to find the method or script to execute.

o.Process()

Return Value

nothing

Parameters

none

Remarks

This method should always be overridden.


See also:

Class wwServer | wwServer::ProcessHit | wwProcess::Process

© West Wind Technologies, 1996-2021 • Updated: 03/18/20
Comment or report problem with topic