HomeVisionXL Web Server PluginThe Web Server plugin provides the same functionality as the Web Server of the Windows HomeVision software with two additions: After installing and enabling the Web Server plug-in, full documentation of the features and operation of the Web Server will be available in the HomeVisionXL help system. The Web Server help pages can be accessed from the Help menu, or by pressing F1 on the Web Server configuration screen. You can browse through all the help pages for the Web Server using the << and >> buttons on the help viewer toolbar.Basic operationThe web server responds to incoming requests from web browsers. Such a request specifies a Universal Resource Identifier (URI) and possibly some additional post data generated from a HTML form. A URI consists of a number of distinctive parts:
http://localhost:1033/index.cgi#information?device=HomeVision
The different parts of this URI are:
The web server plugin is only able to handle URIs for the HTTP mechanism. The hostname has to refer to the machine the web server is running on. The port number can be configured on the web server configuration dialog. In addition to the standard tags that may be present in a HTML document, the web server plugin will scan the document for special HV tags and substitute the appropriate text. For details, see the Windows HomeVision documentation for the web browser. Also the methods for performing actions on the HomeVision controller described there work with the web server plugin. WAP devicesThanks to Ron Boston, the web server plugin is now also capable of supporting WAP (Wireless Access Protocol) devices using Wireless Markup Language (WML). The HV WML capability allows web access to HV via cell phones and other WAP enabled devices.The standard set of predefined web pages is also available in a WML version. These web pages will be served when the requested URI specifies the page name with a wml extension. If the URI doesn't specify a full resource name but just a path upto a directory name, the software will examine the accept parameter in the HTTP request. If the list of MIME types that the requesting device will accept includes text/vnd.wap.wml, it is assumed to be a WAP device. In that case the server will try to find one of the following file names in the indicated directory: index.wml, index.cgi, index.html. For non-WAP devices the list of file names the server will look for is: index.html, index.htm, index.cgi. The first file from the list that is found will go through the normal pre-processing and is then returned to the requesting device.
Dynamically generated resourcesThe web server plugin is not only able to return static HTML pages, it can also run executable (CGI) programs or scripts that generate a page on the fly. The plugin recognizes a few file extensions that indicate the type of resource:
The executable generating the dynamic web pages may be written in any programming- or scripting language available on the machine that runs the web server. Examples: sh script, tcl script, perl script, compiled C program, etc. The output of the program must start with one or more lines that complete the response header. In its simplest form this is just an empty line indicating the end of the response header. All other lines of the response header must contain an identifier, a colon and a value. Anything else will result in an error. The default mime type associated with a dynamic web page is text/html. A CGI program can change this by including the Content-Type identifier in the response header. Example: To indicate plain text content the output of the program should start with: Content-Type: text/plain <The plain text starts here>Other useful identifiers that can be used in the response header are:
Posted data is always first parsed by the web server plugin to check for any special HomeVision actions tags. The appropriate actions are executed before the CGI program is started. If the output of the CGI program has a mime type of text/html or text/vnd.wap.wml, the output is scanned for HV information tags. These tags are automatically replaced with the specified information. For all other mime types the output of the CGI program is passed unaltered. Any CGI program running longer than 5 minutes is assumed to be stuck in a loop and will be killed.
|