Index: openacs-4/packages/acs-core-docs/www/rp-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/rp-design.html,v diff -u -r1.6.2.7 -r1.6.2.8 --- openacs-4/packages/acs-core-docs/www/rp-design.html 29 Apr 2003 05:58:34 -0000 1.6.2.7 +++ openacs-4/packages/acs-core-docs/www/rp-design.html 7 May 2003 17:40:59 -0000 1.6.2.8 @@ -1,19 +1,19 @@ -OpenACS 4 Request Processor Design

OpenACS 4 Request Processor Design

+OpenACS 4 Request Processor Design

OpenACS 4 Request Processor Design

by Rafael H. Schloming
OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

Introduction

The request processor is the set of procs that responds to every HTTP request made to the OpenACS. The request processor must authenticate the connecting user, and make sure that he is authorized to perform the given request. If these steps succeed, then the request processor must locate the file that is associated with the specified URL, and serve the content it -provides to the browser.

Terminology

  • +provides to the browser.

Terminology

  • pageroot -- Any directory that contains scripts and/or static files intended to be served in response to HTTP requests. A typical OpenACS installation is required to serve files from multiple pageroots.

  • global pageroot @@ -31,7 +31,7 @@ that has been translated into a file system path (probably by prepending the appropriate pageroot), but still doesn't have any extension and so does not directly correspond to a file in the filesystem.

  • concrete file or concrete path -- A file -or path that actually references something in the filesystem.

System Overview

Package Lookup

One of the first things the request processor must do is to determine +or path that actually references something in the filesystem.

System Overview

Package Lookup

One of the first things the request processor must do is to determine which package instance a given request references, and based on this information, which pageroot to use when searching for a file to serve. During this process the request processor divides the URL into two pieces. The first @@ -75,7 +75,7 @@ special distinction is required between sitewide procs and package specific procs when using this facility. It is also much less prone to overlap and confusion than the use of registered procs, especially in an environment with -many packages installed.

Site Nodes

The request processor manages the mappings from URL patterns to package +many packages installed.

Site Nodes

The request processor manages the mappings from URL patterns to package instances with the site_nodes data model. Every row in the site_nodes table represents a fully qualified URL. A package can be mounted on any node in this data model. When the request processor performs a URL lookup, it @@ -88,14 +88,14 @@ performed by starting with the full request URI and successively stripping off the rightmost path components until a match is reached. This way the time required to lookup a URL is proportional to the length of the URL, not to the -number of entries in the mapping.

Request Environment

The request environment is managed by the procedure +number of entries in the mapping.

Request Environment

The request environment is managed by the procedure ad_conn. Variables can be set and retrieved through use of the ad_conn procedure. The following variables are available for public use. If the ad_conn procedure doesn't recognize a variable being passed to it for a lookup, it tries to get a value using ns_conn. This guarantees that -ad_conn subsumes the functionality of ns_conn.

Request processor
[ad_conn urlv]A list containing each element of the URL
[ad_conn url]The URL associated with the request.
[ad_conn file]The filepath including filename of the file being served
[ad_conn request]The number of requests since the server was last started
[ad_conn start_clicks]The system time when the RP starts handling the request
Session System Variables: set in -sec_handler, check security with ad_validate_security_info
[ad_conn session_id]The unique session_id coming from the sequence -sec_id_seq
[ad_conn user_id]User_id of a person if the person is logged in. Otherwise, it is -blank
[ad_conn sec_validated]This becomes "secure" when the connection uses SSL
Database API
[ad_conn db,handles]What are the list of handles available to AOL?
[ad_conn db,n_handles_used]How many database handles are currently used?
[ad_conn db,last_used]Which database handle did we use last?
[ad_conn db,transaction_level,$db]Specifies what transaction level we are in
[ad_conn db,db_abort_p,$dbh]Whether the transaction is aborted
APM
Packages
[ad_conn package_id]The package_id of the package associated with the URL.
[ad_conn package_url]The URL on which the package is mounted.
Miscellaneous
[ad_conn system_p]If true then the request has been made to one of the special directories +ad_conn subsumes the functionality of ns_conn.

Request processor
[ad_conn urlv]A list containing each element of the URL
[ad_conn url]The URL associated with the request.
[ad_conn file]The filepath including filename of the file being served
[ad_conn request]The number of requests since the server was last started
[ad_conn start_clicks]The system time when the RP starts handling the request
Session System Variables: set in +sec_handler, check security with ad_validate_security_info
[ad_conn session_id]The unique session_id coming from the sequence +sec_id_seq
[ad_conn user_id]User_id of a person if the person is logged in. Otherwise, it is +blank
[ad_conn sec_validated]This becomes "secure" when the connection uses SSL
Database API
[ad_conn db,handles]What are the list of handles available to AOL?
[ad_conn db,n_handles_used]How many database handles are currently used?
[ad_conn db,last_used]Which database handle did we use last?
[ad_conn db,transaction_level,$db]Specifies what transaction level we are in
[ad_conn db,db_abort_p,$dbh]Whether the transaction is aborted
APM
Packages
[ad_conn package_id]The package_id of the package associated with the URL.
[ad_conn package_url]The URL on which the package is mounted.
Miscellaneous
[ad_conn system_p]If true then the request has been made to one of the special directories specified in the config file (somewhere), and no authentication or -authorization has been performed.
Documentation
[ad_conn api_page_documentation_mode_p]
View comments on this page at openacs.org
+authorization has been performed.
Documentation
[ad_conn api_page_documentation_mode_p]
View comments on this page at openacs.org