Mozilla XForms Snapshots ("Nightlies")
firefox
XForms in Firefox
Submitted by administrator on Wed, 06/18/2008 - 19:07.Elliotte Rusty Harold explains how to process XForms with Firefox.
Saved By: Timo Kankare | View Details | Give Thanks
XRX: Simple, Elegant, Disruptive
Submitted by administrator on Tue, 05/27/2008 - 12:33.I recently started writing for O’Reilly Media. I posted an article on XRX.
Here is the link:
http://www.oreillynet.com/xml/blog/2008/05/xrx_a_simple_elegant_disruptiv_1.html
We are just getting started moving to a new MoveableType (MT) system so not all of the features (like keywords and feedback) are working.
If you have problems commenting on the site, please feel free to post your comments here.
Here is a comment from Arun Batchu:
An elegant introduction to an elegant architecture, Dan. Thank you. The essential takeaway from what you describe is the exploitation of XML from one end to the other end - especially from the Developer's perspective, for, how XRX actually manifests in runtime could be left to implementation technologies. Thus the logical architecture of XRX could be realized by a few variations of concrete technology - which is great. The XForms could be realized by XForms server technology (such as the excellent Orbeon stack), the ReST could be realized by any middle tier and the XQuery could be realized by an XQuery engine (such as Data Direct) that may actually be driving any one or a combination of datastores (XML, SQL, file system or ...) . The symmetrical and consistent leverage of XML as a data model from creation to transport to rest and back eliminates a whole lot of wasteful work. Like you point out, XPath is one of the most powerful query systems I have encountered; you can pack so much in so little and reuse it across the board with little if any change from the drawing board to production. In such a system as you describe, a business rule expressed once can be reused anywhere - from one end-to-end , however long the travel, as long as the architecture is XRX, like you have described. Thanks for expressing it so well. A few of your readers will not get it - it is one of those things that once you experience it, you are left wondering why this did not happen before. Oh, well!
You are welcome! Thank for your feedback Arun!
XQuery Annoyances…
Submitted by administrator on Thu, 05/22/2008 - 05:06.If you are used to XSLT 1.0 and XForms, you see { $book/bk:title } and think nothing of it. XSLT 1.0 calls the curly-brace construct an Attribute Value Template, which is pretty descriptive of where it’s used. Always in an attribute, always converted into a string, even if you are actually pointing to an element.
In [...]
XForms Tutorial and Cookbook Voted Featured Wikibook!
Submitted by administrator on Sun, 03/09/2008 - 21:52.I am happy to announce that the XForms Tutorial and Cookbook that I have been working on for over a year been voted a "Featured Book" on the wikibooks web site. A quote from the award:
XForms is a featured book on Wikibooks because it contains substantial content, it is well-formatted, and the Wikibooks community has decided to feature it on the main page or in other places. Please continue to improve it and thanks for the great work so far!
Here are some stats on the book so far:
90 sample programs
116 chapters
626 edits
28,811 words
29 registered authors
One of the big tasks is to start to move some of the advanced XForms examples that require siginficant server-side logic to a seperate server-specific book. As a pilot I have started an XRX cookbook for people using REST interfaces and the eXist server.
I would like to thank the over 30 others that have contributed ideas and content to this wikibook. We still have lots of work to do to cleanup the example programs, make them more consistent and add additional examples for new XForms students. But I believe it is one of the best examples of collaborative training that I have worked on in the last few years.
Ajax and progressive browser enhancement
Submitted by administrator on Tue, 07/17/2007 - 10:35.Progressive enhancement is an approach to web development that has been around for a few years now. (More on PE at Wikipedia.) At its most basic it suggests building our web pages in a 'clean' and uncluttered way, and then layering functionality onto the mark-up using various mechanisms, such as stylesheets and scripts. The idea is that browsers without the additional capabilities can still render the page in some fashion, but those with additional power--such as scripting support--can add more enhanced features.
This principle actually underpins much of the work we've been doing on XHTML 2, which has involved taking HTML back to its semantic roots. In particular the work on RDFa has been to a large extent motivated by providing more semantic 'hooks' on which to attach increasingly focused functionality. (The work pre-dates the term progressive enhancement, so it isn't generally called that.)
But there is a new phenomena afoot, which I'd like to call progressive browser enhancement. It's something we've been doing for a while with our work on XForms and formsPlayer, but it also has wider applicability.
DOM Events and standards
To illustrate the idea of PBE, let's look at eventing in the browser. Many Ajax libraries have their own eventing architecture, and they are without exception non-standard. This is a shame, since the W3C has a standard for DOM events (DOM 2 Events) which has been around for years and is very clearly defined. Of course, part of the problem is that whilst it has been implemented in Firefox, Safari and Opera, it's not available in Internet Explorer. This meant that when we began our work on formsPlayer, our XForms processor plug-in for Internet Explorer, we had to implement a DOM 2 Events component ourselves.
This does however mean that DOM 2 Events support is potentially available for all browsers, but of course the problem now is that in order to make use of it on IE, people would have to install formsPlayer. And even if we made the module available separately (which we will be doing shortly), the problem for the programmer is that they can't assume that it is installed; there is still an annoying rift between those who have browsers with DOM 2 Events support, and those that don't.
Using JavaScript to enhance the browser
To fill the gap we simply implemented a DOM 2 Events library in JavaScript. Whilst most Ajax libraries went the route of creating their own non-standard eventing architectures, we went the other way and implemented the standard. The advantage of our approach is that if our end-user is running a browser with reasonable standards support such as Firefox, Opera or Safari, they'll get native support for DOM 2 Events, and hopefully a faster experience. Similarly, if our user is on IE and has installed the formsPlayer DOM 2 Events component, they will likewise get a faster experience. It's only the middle group using the scripted version of DOM 2 Events who will have a slightly slower experience.
But the key point is that the end-user now has some control, since they can add a DOM 2 Event component if they want to--most likely as part of some other package--independent of the actual web applications they are using. And for the authors of web applications life is much easier, since they are coding to a standard, rather than being forced to code to the specific event architecture of YUI, Dojo, or whatever Ajax library they want to use.
This is the key idea of progressive browser enhancement.
Threading in Google Gears
Another example of PBE is threading in Google Gears. There are a number of JavaScript libraries around that create simple threading by using the timer in JavaScript. This is fine for a lot of uses but can affect performance. However, we can follow the same approach as I described above for DOM 2 Events; if the function calls that the programmer makes to create a thread are 'standard', then although in normal operation the less-efficient JavaScript version would be used, with no change to the code the web application can take advantage of 'proper' threading, should a user have Google Gears installed. (See also: Ajax makes browser choice irrelevant...but we still need standards.)
Of course, most users are unlikely to be looking for a threading library to install, just as they will not be downloading a DOM 2 Events module. But if these components are small enough to be bundled up with other pieces of software they will gradually find their way onto users machines as part of other, useful, packages.
However the distribution takes place, it's the end-users of our web applications that are in control of progressively enhancing their browser, not the web application programmers themselves.
These principles have underpinned the design of Yowl, a centralised notification system for web applications.
Yowl centralised notification system
Yowl is a way of providing notifications to users of web applications, but in a way that the user themselves can control. It was inspired by Growl, which runs on the Mac, and which is used by applications such as Skype and Adium; by passing all notifications through a central system users are given the power to decide which messages they are interested in, and how they want to see--or even hear--them.
Progressive browser enhancement allows Yowl notifications to make use of advanced features in the browser if they are available, but to fall back to basic notifications if not. For example, we've created a Windows component that allows messages to be displayed above the system tray. The component is invoked and called from script, and works with both Firefox and Internet Explorer:
However, if the systray component is not installed, the Yowl notification system will simply use JavaScript to show messages within the browser window. You can see a sample of the non-enhanced notifications here--it will run in all the major browsers:
The programmer need change nothing in their code to make use of the systray component if it is present, since as with the DOM 2 Events example, or Google Gears and threading, the user is in control of the browser enhancement, not the programmer.
(For more on Yowl see the Yowl open source project page, Yowl: Design principles and how to use it and Yowl: An open source centralised notification system.)
Where does this leave the browser?
There is still plenty of scope for the browser to evolve and make available the kind of features we're talking about here. But the truth is that progressive browser enhancement makes browser evolution far less significant than it has been until now. That's probably not a bad thing, given the chaos that is currently surrounding the development of HTML since the W3C gave its support to HTML 5; the spec itself is becoming increasingly top-heavy, and bears little relationship to the early principles of HTML. Far from having enormous 'kitchen-sink' specifications, PBE looks to add new features in a more nimble way, via small and focused modules.
Yowl: An open source centralised notification system
Submitted by administrator on Tue, 06/19/2007 - 22:05.So Hackday was certainly an excellent event.
If you weren't there and have only heard about lightening striking the building (no, really), then it may sound odd to say that it was 'excellent'. After all, the lightening caused problems with the wi-fi, and it didn't really settle down until quite late in the day. And it also caused something far more surreal...the windows in the roof opened just at the moment it started raining, so we had to be evacuated from the main hall. But the organisers coped with all of this in such a calm way that you couldn't help but get into the swing of things, and keep on adapting.
However, the upshot was that I 'adapted' to the point of avoiding doing any hack that required the Yahoo! APIs, since you had no idea whether the network would remain up for more than ten minutes. Instead I decided to implement something I'd been mulling over for quite a while, and that's a browser-based implementation of Growl.
(If you want to cut straight to a demo, it's available by selecting "Try it now" from the Yowl project page. It's been tested with Firefox, Safari and IE, although the latter does not yet have proper opacity.)
Growl
Growl is an interesting piece of software for Mac OS, which centralises the management of notifications. The idea is simply that applications such as Skype or Adium ask Growl to display a message, rather than doing it themselves. However, this makes it sound like just a standard library which might save you writing a bit of code, but Growl is much more important than that. Since all messages pass through it, it can provide facilities to enable the user to indicate whether a message is enabled or disabled, to control how they appear, for how long, and so on.
But even that doesn't capture it all; extensions to Growl provide different types of notifications, which are not limited to the display. For example, a user can request that certain messages are spoken to them, or even emailed.
formsPlayer messaging
We have a module in formsPlayer, our XForms processor that handles XForms messages, and it provides the ability to speak (as long as Microsoft Agent is installed on the PC). Our module also allows authors to display XForms messages as system tray messages, so breaking out of the confines of the browser window.
So we've long harboured a desire to break this component out into a standalone module that could be used in other applications, and at the same time provide extra features like a debug message logging mode, and so on.
But an idea that started to form recently was for authors to be able to make a single call to an API requesting a message, and for that call to either be handled in script if formsPlayer was not installed, and handled by the formsPlayer messaging module if it was. This would mean that authors can get richer messaging functionality if it's available, without having to change their code.
YUI-based notifications
So for Hackday, I decided to implement the first part of this, and used the Yahoo! User Interface Library (YUI) to provide the core notification code. I created a set of interfaces that quite closely mirror the Growl interfaces and object structure, and since my code uses the Yahoo! library, I decided to call the library Yowl.
The library displays notifications based on a combination of individual settings and themes. One interesting feature I added was to store these themes in a Google spreadsheet, and retrieve them as JSON--all of which continues the idea of 'programming against the cloud' that I've been calling 'skimming'.
You can try the current state of the library on Firefox, IE or Safari by selecting "Try it now" from the Yowl project page. Note that depending when you try this, the IE version might not have opacity support.
Next steps
Various features will be added this week, mainly based on making use of additional functionality if available. For example, it will be possible to save your preferences for different web applications, in Google Gears if it's installed. Similarly, if the platform has formsPlayer and Microsoft Agent installed then spoken messages will be available on Windows. One particularly interesting goal is to make use of Growl itself if it's detected.
Once the library is suitably advanced, we'll also fold it back into formsPlayer, and it will become our core messaging module. The interfaces will also be written up separately since they provide a key module of the XForms backplane.
RDFa hacking at Hack Day
Submitted by administrator on Fri, 06/15/2007 - 19:16.
So tomorrow morning it's off to Alexandra Palace for the start of Hack Day London. My wife is raising an eyebrow as I ready my sleeping-bag, and she may have a point...but I'm secretly quite looking forward to hanging out with a lot of smart people, hearing about their good ideas, with no-one around to tell me what time to go to bed.
For myself, I'm hoping to get involved in projects relating to metadata and rich-clients. I'm sure there will be people working in this area, but if not, I've got plenty of new things we've been experimenting with that I might be able to get others to take a look at.
RDFa Parsing
Perhaps the most interesting is the use of our RDFa parser within a blog or other document. By adding metadata to elements in a document you are providing a hook which gives you more information about some item. Onto this hook you can 'hang' further functionality or more information.
To illustrate, let's say I have a cookery blog on which I mentioned Canteen Cuisine by Marco Pierre White. Given that I probably want to make some money from the site with my Google Ads and reseller links, I will most likely place a link to a site like Amazon around the words "Canteen Cuisine":
I found a good recipe in <a href="http://www.amazon.com/gp/product/0091808189?ie=UTF8&tag=escuelerie-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0091808189">
Canteen Cuisine
</a> which you really should buy so that I get a kick-back.
Obviously this satisfies my commercial yearnings, but it doesn't really contribute to the great 'mass' of semantic information that others might find useful. It doesn't actually tell you which book is being referred to, only that there is a link to a page on Amazon. It would be far better--and easier, as it happens--to simply tag the book with an ISBN number, and leave the creation of links to Amazon, or Barnes and Noble, to some other layer of behaviour.
The key is to use RDFa to indicate a unique identifier for the book, and also to indicate an object type, i.e., to indicate that the item we're dealing with is really a book:
I found a good recipe in <span xmlns:bib="http://somebig.org/" about="urn:ISBN:0091808189" class="bib:book">
Canteen Cuisine
</span> which you really should buy so that I get a kick-back.
If you know RDF then you'll understand that the generated triples are:
<urn:ISBN:0091808189> rdf:type <http://somebig.org/book> .
If you don't know RDF don't worry; the main point is that we've added mark-up that says nothing more than:
"urn:ISBN:0091808189" represents a book.
But that simple fact is pretty useful, since now we could use the ISBN number to go and get more information from Amazon, and then display the data in a tooltip, or add links so that a reader of the cookery blog could buy the book or add it to their wish-list.
Before we look at how we get that data, it's worth pointing out that Amazon does offer the Quick Linker widget for TypePad users, but you'll see that the mark-up looks very strange:
<a type=amzn asin=B000012345>I love this item</a>
In some ways it's similar to what I've shown with RDFa, where we use a small amount of mark-up as a hook to generate richer functionality, but in their case it's an Amazon-specific solution. A key design goal of RDFa is to provide a generic solution that would work with all types of data.
RDFa action handlers
Once the RDFa parser has 'found' items in the page it then does something with them. Up until now all of our experiments have been to simply display data in a different way, such as showing FOAF information as a card with the person's picture, or event information as a pin on a map. The Operator Firefox extension (which now supports RDFa as well as microformats) takes a slightly different approach and allows the user to do things with the data, such as add an hCard to their contacts database.
The Amazon book experiment is a first step towards combining these approaches. The action handler that gets run when a book is found actually goes to get further data about the book from Amazon, before it shows a panel that contains an image of the book and its title. This means that we don't need to know any URLs for the book on Amazon or where its images are located, since they are derived in the action handler; all we need is the ISBN number.
Yahoo! Pipes
But an interesting twist here is that we don't go directly to Amazon to get the data, but instead go via Yahoo! Pipes. There are many reasons for doing this--not least that it fits well with my ideas about skimming--but the main one is simply because Pipes gives us JSON data for any feed we can access, which works nicely with the model we're building here. By running all of our data requests through Pipes we can provide a single format to our RDFa processor, even if we decide to change the source of our data at some later point, or add further services into the pipe to add more metadata.
The pipe that we've defined for Amazon actually takes the URI of the ISBN number (such as urn:ISBN:0091808189) rather than just the ISBN number, because at some point I'd like this to be a proper RDF query. So I'm actually saying, "give me everything you know about this URI", and whilst that URI currently represents a book, in the future the same query might be able to return information about URIs that represent people, ships, planets, and so on.
What's next?
Everything we've been working on so far is about providing a solid widget framework that can be used to enhance any page on any site, in a simple and consistent way. I'm sure that at Hack Day there will be people working on ideas to do with enhancing blogs, ideas related to using the semantic web, microformats (whether in the traditional or RDFa style), and many other things besides, and so I'm really hoping that this will be an opportunity to move some of this work on, in the context of real applications that people want to build.


