An explanation of the examples

This explains what it's so cool about rectangles that randomly appear out of nowhere.

Currently there is one example application. A second that demonstrates RPC has bugs and is not yet completely reliable, but can be found in the source distribution.

Targeting & directive demonstrations

This is the service that should normally be accessible at this URL:

gradient://gradient-examples@jabber.org/svg/index.svg

On loading the index page you are presented with two links:

  1. A map.

    This map is an SVG map distributed with the Batik project. The map is requested over XMPP, using the document request IQ extension. The response directs the client to load the SVG file (which is rather large) via HTTP.

    The same map can be viewed in a normal SVG-enabled browser. Entering http://ex-337.net/xmppservices/svg/index.svg directly into Squiggle will load the same document via HTTP.

  2. Some rectangles.

    This document, as with index.svg, is directly loaded via XMPP.

    The gradient examples services is constantly broadcasting document modification directives using presence stanzas. These stanzas also contain a target path extension that ensures that the client only to apply this modification to document with the path /svg/rectangles.svg.

    Note: the server side code that makes all this happen is in the DemoGradientService, available for download along with the rest of the source code.

    The rectangles are relatively infrequent (every 12 seconds) because otherwise the XMPP server (jabber.org) will start bandwidth-limiting our TCP connection.

    Along with the normal rectangles, there are three buttons on the canvas which, when pressed, will send a message to the server requesting for personalised rectangles of the same colour as the pressed button. When the server JID receives this message, a thread will be started up for that canvas, and other, smaller rectangles will also be sent until the "Stop" button is pressed.

    This demonstrates the sending of XMPP messages from within the DOM, and the broadcast/unicast of targeted document modification directives.

© 2006. Some rights reserved. Author: Ian Sollars.