Contents This section of the documentation describes Whitebeam templates and their functionality. Whitebeam templates are universal "building blocks"
that support core services or functions that are common to many e-business
processes. As such, the use of Whitebeam templates represents a substantial
saving in the complexity, time and cost of developing equivalent back-end
functionality in a bespoke system. While basic JavaScript classes are used to provide utility functions such as image manipulation,
HTTP requests, email interface - templates tend to encapsulate a higher level abstraction. Templates operate as separate processes within the server environment and so do not bloat the
process sizes of individual Apache HTTPD processes. Template | Description |
---|
System | Provides control of the system level page generation and basic Presentation Engine facilities. |
---|
Site | The site template provides a store for site-wide, or global site data. |
---|
Contacts |
Creates, maintains and supplies hierarchical 'contact' information.
This template is part of the Whitebeam authentication mechanism.
|
---|
Catalogue |
Maintains a hierarchical structure of categories to which
items can be attached. Items can also be inter-related.
|
---|
Audit |
Intended to store bulk audit or logging information. For example tracking changes to other records within an application
|
---|
Scheduler |
Schedules timed events without recourse to system utilities such as cron. Provides a decoupling consumer/supplier model for
decoupling functional application components.
|
---|
Collection |
The collection template provides a mechinism for grouping, or collecting elements
together. The collections are represented by arcs, or relations, that link two
elements.
|
---|
Semaphore | Protection against multiple HTTP processes accessing a critical resource. |
---|
Counter | Shared protected numeric data accessible across HTTPD processes. Support atomic read-modify functions |
---|
Chat | The chat template provides all the building blocks required to build an interactive chat room within
your Whitebeam application.
|
---|
Postcode | Provides for the translation of national 'post-codes' into longitude/latitude pairs given a suitable source data set. Currently
data sets are known to exist for the UK, Irland and the US (zip-codes)/ |
---|
Geo | Provides a lookup service translating an IP address into a country code. Amongst other applications
this has been used to target advertising to specific locales and to restrict access to specific countries. |
---|
Log file | Providing safe access to the analog web-stats analysis package (experimental) |
---|
Core Definitions | Detailed definitions of template objects (ROM) |
---|
Whitebeam templates are in effect server-side components that interact with
the database and maintain the integrity of the business and data model. Templates
are developed in various languages (mostly C++) and interact with the database
via SQL. Presentation Pages interact with the required Whitebeam templates, through simple
but powerful methods or APIs, to deploy complex and secure e-business applications
that are aligned to the business processes of each client.
These exported interfaces are described by the
Whitebeam Object Model. This section on templates gives an overview of template concepts and links
to available templates. ConceptsPresentation pages can execute template services through a number of methods or
application programming interfaces. Each Whitebeam template typically supports
the following methods or qualified versions of them: Method | Description | Features |
---|
create() | Creates a logical record in the database. | Typically, a template automatically assigns a unique
identifier to each new record. | modify() | Modifies the logical record in the database. | Only the properties that need to be modified
need be specified. Where a record is being modified using a copy of a
previously retrieved record, the properties that need not be modified should
be removed (e.g. object.property = void 0;) to improve speed of
execution. | remove() | Removes a logical record from the database. | Other related records may be automatically removed or modified. | get() | Retrieves an iterator for the set of records matching the specified
search criteria. | Additionally, this method allows the index of the first record to be retrieved from
the results-set to be specified. It may also allow partial records to be retrieved. | count() | Retrieves a count of the number of records matching the search criteria. | This method takes the same parameters as get(). |
An identifier (ID) is a system assigned value
that is guaranteed to be a unique in the context that it is used in the database.
Typically, an ID is a positive number starting from 100. Although numeric
identifiers are incremented in steps of 2, there is no guarantee that it will
be continuous for records that are created in succession by any one client
application. Where a method returns an ID, a value of -1 indicates an error. A marker (...Mkr) typically refers to a system
assigned (alpha or numeric) string that indicates the status (or relationship)
of a record or to a qualifier of the type of identifier specified in a search
request. Template methods accept and return values of different type. The first five
are standard JavaScript types, the last two are Whitebeam defined classes: Type | Description |
---|
String | Alphanumeric characters and special characters. It is suggested that
% (percent) and _ (underscore) characters are not used as input data to
avoid a clash when these characters are used in keyword searches. | Number | Double precision floating point number | Boolean | 0 = false, 1 = true | Array | A data structure of multiple,
indexed elements. | Object | An arbitarily complex data structure of types | Binary | A class used for holding files for manipulation within the Presentation
Environment. Objects of Binary type support properties of binary data,
path to binary data and MIME (Multipurpose Internet Mail Extension) encoding. | Iterator | These are used to return collections of objects when the size of the
collection returned is indeterminate but could be very large e.g. the
results of an item search from the Catalogue template. An iterator object
is like any JavaScript object except it has one very important method
defined - getNextRow(). Making this call changes the object's contents
to represent the next sequential object in the collection. It also support
a setNextRow() method. |
Meta-data allows record structures of Whitebeam templates to be extended. An
application developer can define a user specific and complex data structures
or objects that can be assigned to a meta-data object in an object record and
applied to the database. The user-defined object is automatically reconstructed
when the record is retrieved. Whitebeam templates support sophisticated search mechanisms typically through
their get() methods. This allows records matching a range of search criteria
to be retrieved from the database. It is commonly possible to specify an identifier
on which to base the search and to nominate fields in the record structure in
which to match up to 4 keywords. The initial implementation is non-case sensitive
search. Special characters % (percent) and _ (underscore)
can be used as wildcard characters in a keyword or string search request and
can be placed anywhere in a search string. The % character should be placed
where any number of characters in that portion of the target string is omitted
(e.g. %hite% will find any string containing the consecutive letters ‘hite’
such as ‘This is Whitebeam’). The _ character should be placed where a
single character in that position in the target string is omitted (e.g.
‘_hitebeam’ will find any 9 letters ending with ‘hitebeam’ such as ‘Whitebeam’). The search method returns an iterator object that has the following methods: getNextRow() populates the iterator with the next record in the set of search
results matching the specified search criteria. setNextRow() sets the index of the next record to be retrieved by getNextRow(). The example JavaScript code below shows an iterator loop that retrieves all the records in the result set. iterator_object = rb.template_object.get( search_object );
while ( iterator_object.getNextRow() )
write(“Found attribute “+iterator_object.recordID+”<br\>);
Note that the result set may change if other Template
methods (e.g. modify() and remove()) are executed whilst iterating through the
result set. For example, removing records after being retrieved may cause other records to be skipped. |