next up previous contents
Next: Suggested MIC-Compliant Datatype and Up: MIC3 Previous: Fieldspaces   Contents


MIC Driver Specifications

The MIC driver should be an executable that expects to reside on a machine and be called to handle certain HTTPD requests. It will expect to look in the environment variables `REDIRECT_URL' and `PATH_INFO.' These should contain the appropriate information about the url being requested. The driver will expect to find /\/[\w_]+\.pile\// where the characters before the `.pile' indicate the pile name and the characters along with the extension indicate the name of the file containing all the subroutines and definitions for the pages within the pile.

The driver will then require that file and take everything after `.pile' to be a page name. It will then call the function associated with the page name. This subroutine is formed by `Pile::<pile name>::<page>' where page is the page name, sans valid extension, prepended by recursive parent directories seperated by `::.' This function may or may not be mapped to a mounted pile function.

The setup function should be called unless it returns null, then the value returned should be returned by the driver (ostensibly to the web server) and driver's job is done.

If setup runs successfully, then the page function will be called, either in the parent pile, or in the proper mounted pile. If no errors are thrown, then the cleanup routine should be called in a safe context and errors reported if the evaluation fails.

If the page routine throws an error, then the driver should call the function handle_exceptions function. This function is evaluated in a safe context, and if successful, the return value will be returned, cleanup will be called as above, and execution will cease. If there was a problem with the handle_exceptions function, then this problem should be reported.

If there is no handle exceptions function, then the error should be reported as gracefully as possible, cleanup should be called as above, and execution should cease. Note that cleanup is always called.


next up previous contents
Next: Suggested MIC-Compliant Datatype and Up: MIC3 Previous: Fieldspaces   Contents