Hardware Reference
In-Depth Information
The Components of WebFace
Each abstraction in WebFace covers one of the four areas in WARP code design. References to each can be retrieved
from the applet manager with functions and functionality as follows:
getAuth() : Authorization. This module will let you know whether the user has logged
in and been authenticated by the Apache server using the method getUser . Since the
Apache user ID is administered manually to match the Minerva username, this can be
used to present the TV guide and other user-specific data on a web page. This module also
connects to the minuser code, through isUserValidFor , to provide fine-level control over
the various applets. This makes it possible for many people to see the currently playing CD
or MP3 track but for only a privileged few to change it ( warp/warplib/appauth.inc ).
getCtrl() : Control. Generates anchors for web links; I'll cover this in detail later in this
chapter.
getView() : Viewport. This is used to combine multiple blocks of individual data into a
single frame. The metaphor used here is pane , since they are combined to form windows.
The default functionality allows you to combine these into horizontally or vertically, aligned
windows of two, three, or four panes ( webface/webview.inc ).
getDbug() : Debug. This is a utility submodule that allows individual errors, warnings, and
information lines to be logged. Once the HTML has been built, the complete list can be
written out using dumpAll . This is done as output written to arbitrary parts of the web page
can break the formatting badly and, in the case of cookies, prevent the page from loading
altogether ( webface/webdbug.inc ).
The Basic Structure
Almost every applet begins the same way, with a directory inside warp/applets and a new applet class taken from
the template as follows:
<?php
require_once 'system/setup.conf';
require_once 'warp/warplib/applet.inc';
class Warp_TODO_Applet extends Warp_Applet
{
function Warp_TODO_Applet($caption = "TODO List")
{
parent::__construct($caption);
}
function getID()
{
return "MY_APP_V1A";
}
function getDirectory()
{
return "todo";
}
Search WWH ::




Custom Search