- Publicity: Public Only All
request-processor-procs.tcl
The ACS Request Processor: the set of routines called upon every single HTTP request to an ACS server.
- Location:
- packages/acs-tcl/tcl/request-processor-procs.tcl
- Created:
- 15 May 2000
- Author:
- Jon Salz <jsalz@arsdigita.com>
- CVS Identification:
$Id: request-processor-procs.tcl,v 1.153.2.66 2024/08/28 06:32:37 gustafn Exp $
Procedures in this file
- acs::root_of_host (public)
- ad_acs_kernel_id (public)
- ad_conn (public)
- ad_host (public)
- ad_register_filter (public)
- ad_register_proc (public)
- ad_script_abort (public)
- root_of_host (public, deprecated)
- rp_form_put (public, deprecated)
- rp_form_update (public, deprecated)
- rp_getform (public, deprecated)
- rp_handle_tcl_request (public)
- rp_internal_redirect (public)
- rp_serve_concrete_file (public)
Detailed information
acs::root_of_host (public)
acs::root_of_host host
Maps a hostname to the corresponding subdirectory.
- Parameters:
- host
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- package_normalize_path, xowiki_test_cases, link_tests, slot_interactions, path_resolve
ad_acs_kernel_id (public)
ad_acs_kernel_id
Returns the package_id of the kernel.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_password_change, auth_use_email_for_login_p, auth_email_on_password_change, password_recovery_page, acs_system_information_api, link_tests
ad_conn (public)
ad_conn [ args... ]
Returns a property about the connection. See the request processor documentation for an (incomplete) list of allowable values. If option "-set" is passed as first argument, then ad_conn sets the specified property, otherwise it returns its value. If the property has not been set directly by OpenACS it will be passed on to AOLserver's/NaviServer's
ns_conn
If the property is not a valid option forns_conn
either then it will throw an error.Valid options for ad_conn are: ajax_p, behind_proxy_p, behind_secure_proxy_p, bot_p, browser_id, deferred_dml, extra_url, instance_name, last_issue, mobile_p, node_id, object_id, object_type, object_url, package_id, package_key, package_url, path_info, peeraddr, recursion_count, request, sec_validated, session_id, start_clicks, subsite_id, subsite_node_id, subsite_url, system_p, token, untrusted_user_id, user_id, vhost_package_url, vhost_subsite_url, vhost_url.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- cookie_consent__setup
ad_host (public)
ad_host
Returns the hostname as it was typed in the browser, provided forcehostp is set to 0.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- package_normalize_path, xowiki_test_cases, link_tests, slot_interactions, path_resolve
ad_register_filter (public)
ad_register_filter [ -debug debug ] [ -priority priority ] \ [ -critical critical ] [ -description description ] kind method \ path proc [ arg ]
Registers a filter that gets called during page serving. The filter should return one of
filter_ok
, meaning the page serving will continue;filter_break
meaning the rest of the filters of this type will not be called;filter_return
meaning the server will close the connection and end the request processing.
- Switches:
- -debug
(defaults to"f"
) (optional)- If debug is set to "t", all invocations of the filter will be ns_logged.
- -priority
(defaults to"10000"
) (optional)- Priority is an integer; lower numbers indicate higher priority.
- -critical
(defaults to"f"
) (optional)- If a filter is critical, page viewing will abort if a filter fails.
- -description
(optional)- Parameters:
- kind - Specify preauth, postauth or trace.
method - Use a method of "*" to register GET, POST, and HEAD filters.
path
proc
arg (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_register_proc (public)
ad_register_proc [ -sitewide ] [ -debug debug ] \ [ -noinherit noinherit ] [ -description description ] method path \ proc [ arg ]
Registers a procedure (see ns_register_proc for syntax). Use a method of "*" to register GET, POST, and HEAD filters. If debug is set to "t", all invocations of the procedure will be logged in the server log.
- Switches:
- -sitewide
(boolean) (optional)- specifies that the filter should be applied on a sitewide (not subsite-by-subsite basis).
- -debug
(defaults to"f"
) (optional)- -noinherit
(defaults to"f"
) (optional)- -description
(optional)- Parameters:
- method
path
proc
arg (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- test_ad_register_proc
ad_script_abort (public)
ad_script_abort
Aborts the current running Tcl script, returning to the request processor. Used to stop processing after doing ad_returnredirect or other commands which have already returned output to the client. After such operations, the connection for this request is closed and no more replies can be sent to the client.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_return_exception_template, create_folder_with_page, create_workflow_with_instance, xowiki_test_cases, create_form_with_form_instance
root_of_host (public, deprecated)
root_of_host host
Deprecated. Invoking this procedure generates a warning.
Maps a hostname to the corresponding subdirectory. DEPRECATED: this proc does not comply with OpenACS naming convention.
- Parameters:
- host
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
rp_form_put (public, deprecated)
rp_form_put name value
Deprecated. Invoking this procedure generates a warning.
This proc adds a query variable to AOLserver's internal ns_getform form, so that it'll be picked up by ad_page_contract and other procs that look at the query variables or form supplied. This is useful when you do an rp_internal_redirect to a new page, and you want to feed that page with certain query variables. Note that the variable will just be appended to the form ns_set which may not be what you want, if it exists already you will now have two entries in the ns_set which may cause ad_page_contract to break. Also, only simple variables may be added, not arrays. DEPRECATED: this proc is a trivial wrapper over NaviServer functionalities. One should use the native api directly.
- Parameters:
- name
value
- Returns:
- the form ns_set, in case you're interested. Mostly you will want to discard the result.
- Author:
- Lars Pind <lars@pinds.com>
- Created:
- August 20, 2002
- See Also:
- ns_getform
- ns_set
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
rp_form_update (public, deprecated)
rp_form_update name value
Deprecated. Invoking this procedure generates a warning.
Identical to rp_form_put, but uses ns_set update instead. DEPRECATED: this proc is a trivial wrapper over NaviServer functionalities. One should use the native api directly.
- Parameters:
- name
value
- Returns:
- the form ns_set, in case you're interested. Mostly you will want to discard the result.
- See Also:
- ns_getform
- ns_set
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
rp_getform (public, deprecated)
rp_getform
Deprecated. Invoking this procedure generates a warning.
This proc is a simple wrapper around AOLserver's standard ns_getform proc, that will create the form if it doesn't exist, so that you can then add values to that form. This is useful in conjunction with rp_internal_redirect to redirect to a different page with certain query variables set. DEPRECATED: modern ns_getform from NaviServer will never return the empty string, assuming that we are in a connection. When we are not in a connection, it makes little sense that we set request variables.
- Returns:
- the form ns_set, just like ns_getform, except it will always be nonempty.
- Author:
- Lars Pind <lars@pinds.com>
- Created:
- August 20, 2002
- See Also:
- ns_getform
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
rp_handle_tcl_request (public)
rp_handle_tcl_request
Handles a request for a .tcl file. Sets up the stack of datasource frames, in case the page is templated.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
rp_internal_redirect (public)
rp_internal_redirect [ -absolute_path ] path
Tell the request processor to return some other page. The path can either be relative to the current directory (e.g. "some-template") relative to the server root (e.g. "/packages/my-package/www/some-template"), or an absolute path (e.g. "/home/donb/openacs-4/templates/some-cms-template"). When there is no extension then the request processor will choose the matching file according to the extension preferences. Parameters will stay the same as in the initial request. Keep in mind that if you do an internal redirect to something other than the current directory, relative links returned to the clients browser may be broken (since the client will have the original URL). Update the ns_set obtained via ns_getform if you want to feed query variables to the redirected page.
- Switches:
- -absolute_path
(boolean) (optional)- If set the path is an absolute path within the host filesystem
- Parameters:
- path - path to the file to serve
- See Also:
- ns_getform
- ns_set
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_workflow_with_instance
rp_serve_concrete_file (public)
rp_serve_concrete_file file
Serves a file.
- Parameters:
- file
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.