docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 6.1System Developer Manual PikeThe Roxen Module API
Copyright  2018, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com



Introduction to Roxen Modules
The Module Type Calling Sequence
Constants Common to All Modules
Callback Methods Common to All Modules
API Methods Common to All Modules
Module Variables
Tag Modules
Location (Filesystem) Modules
File Extension Modules
Filter Modules
Authentication Modules
Logger Modules
First Modules
Last Modules
Provider Modules
Content Type Modules
Directory Listing Modules

API Methods Common to All Modules

This page covers all API methods available to all (and interesting to all) module types. (Be sure to see the sections on common constants and callbacks too.)
int module_dependencies(Configuration conf, array(string) modids)

Add these modules to the configuration; a handy way of assuring that modules whose presence your module depends on are really there. modids is an array of module identifiers as those used by Configuration->find_module(). Typical usage:

void start(int occasion, Configuration conf)
{
  module_dependencies(conf, ({ "graphics_text" }));
}

mapping(string:function(RequestID:void)|array(function(RequestID:void)|string)) query_action_buttons (RequestID id)

Optional callback for adding action buttons to the module's administration settings page; convenient for triggering module actions like flushing caches and the like.

The indices of the returned mapping are the action descriptions that will show up on each button (e.g. "Flush Cache"), and the corresponding values are the callbacks for each button respectively. These functions may take an optional RequestID argument, where this id object refers to the id object in the admin interface sent with the request used to invoke the action by the administrator.

The mapping values may alternatively be given as a tuple <function, RXML code> where the RXML code replaces the default button rendering code.

string query_internal_location()

Returns the internal mountpoint, where find_internal() is mounted.

string query_absolute_internal_location(RequestID id)

Returns the internal mountpoint as an absolute path. This includes the site prefix, which is typically the empty string for a site mounted at a URL with no path component, such as "http://*/", as opposed to for example "http://*/roxen/2.1/", which would be prefixed "roxen/2.1/".

This method is recommended when you want to generate a link to your internal resources supplied by find_internal().

void set_module_creator(string|array(string) c)

Set the name and optionally email address of the author of the module. Names on the format "author name <author_email>" will end up as links on the module's information page in the admin interface. In the case of multiple authors, an array of such strings can be passed to generate one link per author (the array order is preserved).

void set_module_url(string to)

A common way of referring to a location where you maintain information about your module, or similar. The URL will turn up on the module's information page in the admin interface, referred to as the module's home page.