Home printable version

WeaveAPI-0.7.0-cgiInterface - Documentation for the cgi interface to Weave Version 0.7.0

The Weave is a navigatible object database, implemented using Offsider technology. It can be found at http://weavedb.sourceforge.net/.

This manual documents the web-based cgi interface, and related matters.

The API for the database itself is documented seperately (WeaveAPI-0.7.0), as is theAPI for the items stored in the database (WeaveAPI-0.7.0-eventMethods).

cgiWeaves

cgiWeaves is an offsider that lists all of the weaves that can be accessed using cgi scripts under http.

addWeave

Add a weave to the list of weaves that are known to the global weave cgi interface.

Syntax:

addWeave weave key

where weave is either a named executable or a base directory key is the name you would like to give the weave for this list.

cgi scripts

There are a number of cgi scripts that are used to interface to the weave from a browser using http. They are documented in this section.

In order to facilitate their use as cgi scripts, all of the scripts below accept arguments with either spaces or , delimiting the arguments. Thus they can be run with equal ease either from a web-browser, or the command line (eg for testing purposes).

weave.allhome.cgi

Home page for all web-accessable weaves known to the system.

The list of web-accessable weaves is managed by the offsider cgiWeaves (documented separately).

Usage:

http://domain/cgi-bin/weave.allhome.cgi

weave.attachment.cgi

Output a page of html, showing the contents of an attachment of an event on a weave.

Usage:

http://domain/cgi-bin/weave.attachment.cgi?weave,ref,attachment

where weave is the base directory of the weave, ref is the internal reference for the event, attachment is the name of the attachment.

weave.event.cgi

Output a page of html which shows a summary of a single weave event.

Usage:

http://domain/cgi-bin/weave.event.cgi?weave,ref

where weave is the base directory of the weave, ref is the internal reference for the event,

weave.home.cgi

Home page for a weave

Usage:

http://domain/cgi-bin/weave.home.cgi?weave

where weave is the base directory of the weave.

weave.htmlAttachment.cgi

Display the contents of an attachment where the attachment is already a well-formed html page.

The attachment in question is an attachment to an event on a weave.

Usage:

http://domain/cgi-bin/weave.htmlAttachment.cgi?weave,ref,attachment

where weave is the base directory of the weave, ref is the internal reference for the event, attachment is the name of the attachment.

weave.method.cgi

cgi script to send a specific message to an event on a weave.

Syntax:

weave.method.cgi weave ref method[ $arg1 $arg2 .. ]

or

weave.method.cgi weave,ref,method[,$arg1,$arg2 .. ]

Usage:

http://domain/cgi-bin/weave.attachment.cgi?weave,ref,method[,$arg1,$arg2 .. ]

where weave is the base directory of the weave, ref is the internal reference for the event, method is the name of the method, $arg1, etc are arguments as required by that method

None of the arguments can contain , or a space.

In fact, the message does not have to be in the form method arguments. Any valid message can be sent, so long as all spaces are replaced with ,.

The method must return the complete http response, including the content-type header.

weave.nodes.cgi

Output an html page, listing the named nodes for a weave.

Usage:

http://domain/cgi-bin/weave.nodes.cgi?weave

where weave is the base directory of the weave.

Weave methods for html and cgi

The methods in this section are used to generate web pages for the web-accessible cgi interfaces.

They are methods that are understood by the Weave.

asHtml

Present a summary of an event as html.

Syntax:

asHtml ref

where ref is the internal reference for the event.

This Weave method is provided so that the generic weave.cgi can rely on a weave to present the html for an event as appropriate for that weave, (and that event).

This method can be overridden to provide custom web-page presentation appropriate for that weave.

The method does not output a complete html page. That is done by the cgi. It outputs a snippet of html that can be included inside the cgi-generated page.

fastEventHtml

Create a page of html to display the contents of an event

Syntax:

fastEventHtml ref

where ref is the internal reference of the event.

THIS IS A FAST METHOD which bypasses normal Offsider processing

fastHomeHtml

Output a snippet of html which provides basic entry points to the weave, for use by weave.home.cgi.

Syntax:

fastHomeHtml

THIS IS A FAST METHOD which bypasses normal Offsider processing.

fastNamedNodesHtml

Output a snippet of html which provides links to all the weave's named nodes for use by weave.nodes.cgi.

Syntax:

fastNamedNodesHtml

THIS IS A FAST METHOD which bypasses normal Offsider processing.

Event methods for Presentation

The following methods are understood by events on the Weave. They are methods to do with presenting information from the event.

asHtml

Show the contents of the event as a snippet of html.

Syntax:

asHtml

This method is specifically written to integrate with the standard weave http cgi interface.

asText

Show a summary of the contents of the event as text.

Syntax:

asText

fastHtml

Return a snippet of html to display the contents of the event.

syntax:

fastHtml

This method is specifically written to integrate with the standard weave http cgi interface.

navAsHtml

Show a navigation key as a snippet of html.

syntax:

navAsHtml key cgiurl

where key is the name of the navigation key to display, and cgiurl is the url of the cgi that displays an event.

Weave methods for Presentation

The following methods are understood by the Weave. They are methods to do with presenting information from the weave.

asText

Show the contents of a list of Weave events as text.

Syntax:

asText refs

where refs is a list of internal references.




(20100527 17:02:53) This page was produced using rsml. Source file was WeaveAPI-0.7.0-cgiInterface