<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>A little bit of Ajax</title><biblioid class="uri">http://norman.walsh.name/2007/10/15/ajax</biblioid>
<volumenum>10</volumenum>
<issuenum>109</issuenum>
<pubdate>2007-10-15T16:23:23-04:00</pubdate>
<date>$Date$</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2007</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>After a brief exploration of “information management” programs,
I decided to roll my own. Irrespective of whether it succeeds or fails,
I learned a little something about Ajax. Emphasis on little.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Ajax"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#SelfReference"/>
</info>

<para xml:id="p1">There are two parallel threads to this story. A while
back when I wanted to learn more about
<wikipedia page="Ajax_%28programming%29">Ajax</wikipedia>, I started working
on my
<link xlink:href="http://norman.walsh.name/2006/09/13/photodata">photographic
metadata</link> application. It worked great, until it
<link xlink:href="http://norman.walsh.name/2007/06/08/digikam">stopped
working</link> altogether. Ajax succeeded for that application, but it
was built to be that way from the start. Prototype or not, I expect
1500 or so lines of
<wikipedia page="Ruby_%28programming_language%29">Ruby</wikipedia>
and 1500 or so lines of <wikipedia>JavaScript</wikipedia> to do something
useful.</para>

<para xml:id="p2">The second thread is about information management. There are lots
of Mac applications designed to help with “information management”.
I recall looking at
“<link xlink:href="http://bargiel.home.pl/iGTD/">iGTD</link>”,
“<link xlink:href="http://www.barebones.com/products/yojimbo/">Yojimbo</link>”,
and “<link xlink:href="http://www.eastgate.com/Tinderbox/">Tinderbox</link>”
but I'm sure a few others crossed my desk as well.</para>

<para xml:id="p3">(Tinderbox was probably the most interesting option. Some folks
describe it as a life changing application, but I never really groked
it. And it's fairly expensive as these things go, but at least it does
store its data in XML.)</para>

<para xml:id="p4">Anyway, I spent a few days pouring sample data into these
applications and thinking about adopting one of them as my “go to”
tool for managing action items, wish lists, tasks, and the
rolling sea of little slips of paper and reminders that wash
around my physical and virtual desktops.</para>

<para xml:id="p5">Then it hit me.</para>

<para xml:id="p6">None of them, with the notable exception of
Tinderbox, seem to store the data in any open format. I was seriously
considering one of these commercial black boxes for an important chunk
of the data that drives my day-to-day life. The little voice in my
head reacted viscerally when the observation was made: “What the hell
you thinking, man! Stop that!”</para>

<para xml:id="p7">I generally do what the voices in my head tell me to.</para>

<para xml:id="p8">I took a
step back and realized that, in their simplest form, these applications
boil down to a little three-pane UI.</para>

<mediaobject role="flickr">
    <!--Notes-->
  <imageobject xlink:href="http://www.flickr.com/photos/ndw/1583487576/">
    <imagedata fileref="http://farm3.static.flickr.com/2053/1583487576_eaa9d3a858.jpg"/>
  </imageobject>
</mediaobject>

<para xml:id="p9">On the left, some sort of categorization. I decided to go with
a collection of tags because folksonomies are trendy and because building a proper
ontology would have been hard (and pointless since if I was sufficiently
organized that I could predict how it would grow, I probably wouldn't need
the crutch that I'm building). On the right, some sort of list of the 
items in that category and then a place for each individual item.</para>

<para xml:id="p10">The categories are organized into a tree where each tag is
considered a primary key, a secondary key for every other tag with
which it appears, a tertiary key for every pair of primary and
secondary, etc. There's probably a term for that, but if so,
it escapes me at the moment. (One or more of the first three comments will no doubt
contain the answer.)</para>

<para xml:id="p11">The items have a title and some other basic metadata that can
be used for summary information and each has a body that can either
be empty (as in the “Explore ‘Linked Data'” example above), contain text,
or contain a saved copy of a web page.</para>

<para xml:id="p12">The three pane view is just an HTML <tag>frameset</tag> and the
whole thing is built from a collection of small XML files by a
few lines of <wikipedia>Perl</wikipedia> and
<wikipedia page="XSL_Transformations">XSLT</wikipedia>.</para>

<para xml:id="p13">The tricky part, if there is one, is making the check boxes and
the little “flag” icons persist. Any attempt to do this with old
school “submit” buttons would be a total disaster. If this application
has any hope of succeeding, it has to be at least a little bit easy to
use.</para>

<para xml:id="p14">I decided to try a little Ajax. It worked, and there's nothing
very rich or interesting about the script, but it's just a fraction
over 100 lines. Easily less if I tried.</para>

<para xml:id="p15">There's nothing really earth shattering here, except if “Ajax”
makes you think of big, sophisticated applications like
<link xlink:href="http://maps.google.com/">Google maps</link> or
the latest extraordinary mashup, maybe you're missing something.
My little notes application may be crude, but it still gets a pretty
big bang for 100 lines of code. I'll be thinking about that from now
on when I build web pages.</para>

<para xml:id="p16">If you want to see more of my little notes application, you
can find it with a small selection of sample data at
<link xlink:href="http://portal.nwalsh.com/"/> under the “Notes”
tab. Disappointingly as demos go, the one thing I had to turn off in
the public version was the Ajax. It wasn't designed to be a multi-user
application and I doubt it would behave well.</para>

<para xml:id="p17">By the way, I was reminded to write this essay by
<personname>Shelley Powers</personname>’
<citetitle xlink:href="http://www.oreilly.com/catalog/9780596529369/">Adding
Ajax</citetitle>. I thumbed through it in the local bookstore and it looks
like a good read. Recommended if you're thinking of…adding a little ajax
to your web.</para>

</essay>

