Class PHRUTS_RequestProcessor

Description

PHRUTS_RequestProcessor contains the processing logic that the PHruts controller service performs as it receives each service request.

You can customize the request processing behavior by subclassing this class and overriding the method(s) whose behavior you are interested in changing.

  • author: John WILDENAUER <jwilde@users.sourceforge.net> (PHP4 port of Struts)
  • author: Olivier HENRY <oliv.henry@gmail.com> (PHP5 port of Struts)
  • version: $Id: PHRUTS_RequestProcessor.php,v 1.3 2008/05/21 16:39:50 ohenry Exp $
  • copyright: Copyright PHruts 2008

Located in /action/PHRUTS_RequestProcessor.php (line 38)


	
			
Variable Summary
Method Summary
PHRUTS_RequestProcessor __construct ()
void doForward (string $uri,  $request,  $response)
void doInclude (string $uri,  $request,  $response)
void init (PHRUTS_ActionService $service,  $moduleConfig)
void process ( $request,  $response)
PHRUTS_ForwardConfig processActionCreate ( $request,  $response,  $mapping)
PHRUTS_ActionForm processActionForm ( $request,  $response,  $mapping)
PHRUTS_ForwardConfig processActionPerform ( $request,  $response, PHRUTS_Action $action, PHRUTS_ActionForm $form,  $mapping)
void processContent ( $request,  $response)
boolean processForward ( $request,  $response,  $mapping)
void processForwardConfig ( $request,  $response, PHRUTS_ForwardConfig $forward)
boolean processInclude ( $request,  $response,  $mapping)
void processLocale ( $request,  $response)
PHRUTS_ActionConfig processMapping ( $request,  $response, string $path)
void processNoCache ( $request,  $response)
string processPath ( $request,  $response)
void processPopulate ( $request,  $response, PHRUTS_ActionForm $form,  $mapping)
boolean processPreprocess ( $request,  $response)
boolean processRoles ( $request,  $response,  $mapping)
boolean processValidate ( $request,  $response, PHRUTS_ActionForm $form,  $mapping)
void __wakeup ()
Variables
static Logger $log = null (line 44)

Commons Logging instance.

  • access: protected
array $actions = array() (line 52)

The set of PHRUTS_Action instances that have been created and initialized, keyed by the fully qualified PHP class name of the PHRUTS_Action class.

  • access: protected
PHRUTS_ModuleConfig $moduleConfig = null (line 59)

The PHRUTS_ModuleConfiguration we are associated with.

  • access: protected
PHRUTS_ActionService $service = null (line 66)

The controller service we are associated with.

  • access: protected
Methods
Constructor __construct (line 74)
  • access: public
PHRUTS_RequestProcessor __construct ()
doForward (line 748)

Do a forward to specified uri using request dispatcher.

This method is used by all internal method needing to do a forward.

  • access: protected
void doForward (string $uri,  $request,  $response)
doInclude (line 768)

Do an include of specified uri using request dispatcher.

This method is used by all internal method needing to do an include.

  • access: protected
void doInclude (string $uri,  $request,  $response)
getInternal (line 86)

Return the PHRUTS_MessageResources instance containing our internal message strings.

  • access: protected
PHRUTS_MessageResources getInternal ()
init (line 99)

Initialize this request processor instance.

  • todo: Actions initializations?
  • access: public
void init (PHRUTS_ActionService $service,  $moduleConfig)
process (line 115)

Process a PHRUTS_HttpServiceRequest and create the corresponding PHRUTS_HttpServiceResponse.

  • access: public
void process ( $request,  $response)
processActionCreate (line 635)

Return a PHRUTS_Action instance that will be used to process the current request, creating a new one if necessary.

  • access: protected
PHRUTS_ForwardConfig processActionCreate ( $request,  $response,  $mapping)
processActionForm (line 415)

Retrieve and return the PHRUTS_ActionForm bean associated with this mapping, creating and stashing one if necessary.

If there is no form bean associated with this mapping, return null.

  • access: protected
PHRUTS_ActionForm processActionForm ( $request,  $response,  $mapping)
processActionPerform (line 699)

Ask the specified PHRUTS_Action instance to handle this request.

Return the PHRUTS_ActionForward instance (if any) returned by the called PHRUTS_Action for further processing.

  • throws: PHRUTS_ServiceException
  • access: protected
PHRUTS_ForwardConfig processActionPerform ( $request,  $response, PHRUTS_Action $action, PHRUTS_ActionForm $form,  $mapping)
processContent (line 270)

Set the default content type (with optional character encoding) for all responses if requested.

NOTE

  • This header will be overridden automatically if a PHRUTS_RequestDispatcher->doForward call is ultimately
invoked.

  • access: protected
void processContent ( $request,  $response)
processForward (line 579)

Process a forward requested by this mapping (if any).

Return true if standard processing should continue, or false if we have already handled this request.

  • access: protected
boolean processForward ( $request,  $response,  $mapping)
processForwardConfig (line 720)

Forward or redirect to the specified destination, by the specified mechanism.

  • access: protected
void processForwardConfig ( $request,  $response, PHRUTS_ForwardConfig $forward)
processInclude (line 608)

Process an include requested by this mapping (if any).

Return true if standard processing should continue, or false if we have already handled this request.

  • access: protected
boolean processInclude ( $request,  $response,  $mapping)
processLocale (line 233)

Automatically select a PHRUTS_Locale for the current user, if requested.

NOTE

  • configuring PHRUTS_Locale selection will trigger the creation
of a new PHRUTS_HttpSession if necessary.

  • access: protected
void processLocale ( $request,  $response)
processMapping (line 330)

Select the mapping used to process the selection path for this request.

If no mapping can be identified, create an error response and return null.

  • access: protected
PHRUTS_ActionConfig processMapping ( $request,  $response, string $path)
processNoCache (line 290)

Set the no-cache headers for all responses, if requested.

NOTE

  • This header will be overridden automatically if a PHRUTS_RequestDispatcher->doForward call is ultimately
invoked.

  • access: protected
void processNoCache ( $request,  $response)
processPath (line 198)

Identify and return the path component (from the request URI) that we will use to select a PHRUTS_ActionConfig to dispatch with.

If no such path can be identified, create an error response and return null.

  • access: protected
string processPath ( $request,  $response)
processPopulate (line 457)

Populate the properties of the specified PHRUTS_ActionForm instance from the request parameters included with this request.

In addition, request attribute Globals::CANCEL_KEY will be set if the request was submitted with a cancel button.

  • throws: PHRUTS_ServiceException - If thrown by PHRUTS_RequestUtils->populate()
  • access: protected
void processPopulate ( $request,  $response, PHRUTS_ActionForm $form,  $mapping)
processPreprocess (line 313)

General-purpose preprocessing hook that can be overridden as required by subclasses.

Return true if you want standard processing to continue, or false if the response has already been completed. The default implementation does nothing.

  • access: protected
boolean processPreprocess ( $request,  $response)
processRoles (line 371)

If this action is protected by security roles, make sure that the current user possesses at least one of them.

Return true to continue normal processing, or false if an appropriate response has been created and processing should terminate.

  • access: protected
boolean processRoles ( $request,  $response,  $mapping)
processValidate (line 504)

If this request was not cancelled, and the request's PHRUTS_ActionConfig has not disabled validation, call the validate method of the specified PHRUTS_ActionForm, and forward back to the input form if there were any errors.

Return true if we should continue processing, or false if we have already forwarded control back to the input form.

  • access: protected
boolean processValidate ( $request,  $response, PHRUTS_ActionForm $form,  $mapping)
__wakeup (line 68)
  • access: public
void __wakeup ()

Documentation generated on Sat, 31 May 2008 15:46:30 +0200 by phpDocumentor 1.4.1