Class PHRUTS_RequestUtils

Description

General purpose utility methods related to processing a service request in the PHruts controller framework.

  • 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_RequestUtils.php,v 1.3 2008/05/24 13:44:06 ohenry Exp $
  • copyright: Copyright PHruts 2008

Located in /util/PHRUTS_RequestUtils.php (line 31)


	
			
Variable Summary
static Logger $log
Method Summary
static PHRUTS_ActionForm createActionForm ( $request,  $mapping,  $moduleConfig,  $service)
static PHRUTS_ModuleConfig getModuleConfig ( $request,  $context)
static string getModuleName ( $request,  $context)
static void populate (object $bean, string $prefix, string $suffix,  $request)
static PHRUTS_MessageResources retrieveMessageResources ( $request,  $context, string $bundle)
static PHRUTS_Locale retrieveUserLocale ( $request, string $locale)
static void selectModule ( $request,  $context)
Variables
static Logger $log = null (line 37)

Commons Logging instance.

  • access: public
Methods
static method createActionForm (line 141)

Create (if necessary) and return a PHRUTS_ActionForm instance appropriate for this request.

If no PHRUTS_ActionForm instance is required, return null.

  • return: PHRUTS_ActionForm instance associated with this request
  • todo: Manage exception for PHRUTS_ClassLoader::loadClass.
  • access: public
static PHRUTS_ActionForm createActionForm ( $request,  $mapping,  $moduleConfig,  $service)
static method getModuleConfig (line 116)

Return the PHRUTS_ModuleConfig object if it exists, null otherwise.

  • return: The PHRUTS_ModuleConfig object
  • access: public
static PHRUTS_ModuleConfig getModuleConfig ( $request,  $context)
static method getModuleName (line 77)

Get the module name to which the specified request belong.

  • return: The module prefix or ""
  • access: public
static string getModuleName ( $request,  $context)
static method populate (line 225)

Populate the properties of the specified PHPBean from the specified HTTP request, based on matching each parameter name (plus an optional prefix and/or suffix) against the corresponding JavaBeans "property setter" methods in the bean's class.

If you specify a non-null prefix and non-null suffix, the parameter name must match both conditions for its value(s) to be used in populating bean properties.

  • throws: PHRUTS_ServiceException - If an exception is thrown while setting property values
  • access: public
static void populate (object $bean, string $prefix, string $suffix,  $request)
  • object $bean: The PHPBean whose properties are to be set
  • string $prefix: The prefix (if any) to be prepend to bean property names when looking for matching parameters
  • string $suffix: The suffix (if any) to be appended to bean property names when looking for matching parameters
  • PHRUTS_HttpServiceRequest $request: The HTTP request whose parameters are to be used to populate bean properties
static method retrieveMessageResources (line 276)

Returns the appropriate MessageResources object for the current module and the given bundle.

  • todo: If PHRUTS_MessageResources is null throw Exception.
  • access: public
static PHRUTS_MessageResources retrieveMessageResources ( $request,  $context, string $bundle)
  • PHRUTS_HttpServiceRequest $request: The service request we are processing
  • PHRUTS_ServiceContext $context: The PHRUTS_ServiceContext for this web application
  • string $bundle: The bundle name to look for. If this is null, the default bundle name is used
static method retrieveUserLocale (line 311)

Look up and return current user locale, based on the specified parameters.

  • access: public
static PHRUTS_Locale retrieveUserLocale ( $request, string $locale)
  • PHRUTS_HttpServiceRequest $request: The service request we are processing
  • string $locale: Name of the session attribute for our user's PHRUTS_Locale. If this is null, the default locale key is used for the lookup
static method selectModule (line 48)

Select the module to which the specified request belongs, and add corresponding request attributes to this request.

  • access: public
static void selectModule ( $request,  $context)

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