WebObjects
 

Table of Contents

Introduction
WebObject Hierarchy Config
Server
Connection
Request
Argument
Parameter

Examples
WebObjects Variable Tree

Introduction
PowerWeb uses a set of WebObjects to communicate between itself and API extensions. The interface to these WebObjects is virtualised so that a few common operations can be performed regardless of the class of the object.

For example, writing text to a socket object causes that text to be transmitted, whereas writing text to a local integer variable causes that text to be interpreted as a number and stored within the variable.

Through this mechanism, PowerWeb can support a powerful set of abstractions that simplify working with WebObjects, through a reduced set of API Functions.

Future extensibility is also easily provided for, because WebObjects are organised and stored within a hierarchy which is easily expanded. This categorisation helps with understanding the role of each object and its lifetime.


WebObject Hierarchy
PowerWeb Server++ WebObject variables are organised into a hierarchy with the top level consisting of several logical "Drives", each of which consists of a tree of "Directories" which in turn contain "Settings" variables.

These variables can be accessed from PowerWeb Macros as well as API extensions, and support both read and write access, according to the permission settings assigned to them.

The following logical "Drives" are defined within PowerWeb Server++:

Config

This is the Configuration database drive. All the server configuration settings, performance statistics and security rules are stored here. Objects stored within this drive are persistent and are restored when the server is restarted.

The contents of this drive are stored in text format within the file "\powerweb\conf\powerweb.cfg" with a rolling 5 level backup. You should not attempt to directly edit this file because its structure is complex and not easily modified. Instead, you should use the Server Administration pages.

View the Configuration Tree.

You can also Browse Your Configuration Settings to familiarise yourself with what is available.

Server

This is a dynamic drive that refers to the current Service being used to service the current request. It is therefore an alias of one of the "Config:/Servers/" directories, and allows easy access to the settings of the current service. Objects stored within this drive are persistent and are restored when the server is restarted.

View the HTTP Service Tree.

Connection

All settings specific to the current Connection, such as the authenticated user name, remote host name, TCP/IP status, etc are stored here. This drive name can also be abbreviated to "Connect". Each Connection has its own private "Connection" drive to avoid conflict with multiple simultaneous connections. Objects stored within this drive live only as long as the connection, after which they are destroyed.

View the Tree for the current Connection.

Request

Within a single user Connection, there may be many Requests. For example, within an FTP Server, each command sent to the Server is treated as a Request within the current Connection. Each Request has its own directory system that contains all settings and details specific to that Request. Settings which are common across all Requests are stored on the Connection drive. Each Request has its own private "Request" drive to avoid conflict with multiple simultaneous connections and requests. Objects stored within this drive live only as long as the request, after which they are destroyed.

View the Tree for the current Request.

Argument

When a WebHook is called, it is passed a set of Arguments specific to the type of WebHook. For example, a Decode Hook is given arguments of the data block, the encryption method, and the variable in which to place the decrypted data. All these Arguments are stored in the Argument drive for easy access. Full multi-threading is supported through each WebHook having its own private Argument drive for each invocation. Objects stored within this drive live only as long as the invocation of the WebHook, after which they are destroyed.

Parameter

When a WebHook is called, it can be passed a set of constant Parameters that further tell it what action to take. These Parameters are defined in the Configuration settings and an alias to these is stored in the Parameter drive prior to invoking the WebHook. Objects stored within this drive are aliases of persistent objects stored within the Config drive. You should not attempt to store new objects within this drive other than through the server configuration pages.

The main reference source is the Variable Tree which describes each variable, its usage, its datatype and its access control permissions.


Examples
PowerWeb variable names consist of three parts: the drive, the directory and the name, as follows:
Drive:/directory/name
The following list of examples shows how this works:

Config:/Version
The version number of the software in use.

Server:/Stats/Clients
The number of clients currently using this server.

Request:/Header/Out/Content-type
The MIME content type of the reply to the current HTTP request.

Request:/Argument/LastName
The value of the "LastName" field within an HTML form which has been submitted.