W3CAnnotea

Interfacing Annotea Via JavaScript

Document Status

This document was a WorkInProgress and subject to change (e.g. to add/delete issues, bug reports, etc.). As of early 2002, active development on the JavaScript servlet work described here is no longer taking place at W3C due to lack of resources. Refer to the Annotea home page for information about other client interfaces.

Introduction

The W3C's Annotea annotation system is an open, Web-based shared annotation system based on an RDF infrastructure. The W3C has implemented the user interface aspects of Annotea in its Amaya web browser. The tight integration of Amaya and Annotea provides the user with a single entry point to create, edit and view fine-grained annotations.

This document describes an alternate, experimental interface to Annotea that uses JavaScript (JS) and a servlet. The JS interface is browser-independent but when compared with the Amaya implementation of Annotea, it has several limitations that are documented below.

How to Use

The JS interfaces have been tested with Netscape's Communicator (NC) bookmarklet facility as well as Microsoft's Internet Explorer (IE) and the Mozilla browser.

To use the JS interface to create annotations, add the following bookmarklet to the browser and name it something like "Create Annotations":

  javascript:void(window.open('http://www.w3.org/2001/Annotea/Bookmarklet/create_annot.html?title='+escape(document.title)+'&referrer='+escape(document.URL),"CreateAnnotation","width=600,height=450,scrollbars=yes,resizable=yes",""))
To retrieve annotations for an arbitrary document, add the following bookmarklet and name it something like "Retrieving Annotations":
  javascript:void(window.open('http://www.w3.org/2001/Annotea/Bookmarklet/get_annot.html?referrer='+escape(document.URL),"GetAnnotation","width=600,height=320,scrollbars=yes,resizable=yes",""))

Note that the width and height values may be adjusted for the user's preferences. Other browsers that support JavaScript should provide a mechanism for installing bookmarklets.

To use this service, the address of a running Annotea servlet is required. The W3C runs an experimental Annotea servlet at http://www.w3.org/2001/04/AnnoteaServlet.

Advantages of a JavaScript Interface

Limitations

There are limitations to a JS-based interface to Annotea (as opposed to native browser support). Some of the limitations are caused by the JavaScript security model which make some useful information unavailable to a script unless certificates are used. Among the limitations are:

Additional Work To Do

Among the additional work that could be done:

Known Problems/Defects/Annoyances

Aside from the additional work described earlier, here is a list of known problems, bugs and general annoyances:

The Annotea Servlet

The servlet's Java sources are available in the W3C CVS Repository.

The servlet uses the following Java packages:

The JavaScript files used by the servlet and the bookmarklets are also in the W3C CVS Repository.

Defect Reporting

Defect reports should be sent to www-annotation.
$Id: Annotea-JavaScript.html,v 1.6 2002/08/14 13:08:20 swick Exp $