SOS

Shane O'Sullivan's technical blog… really ties the room together

Archive for the ‘Atom’ Category

Cool Portlets added to Dojo!

Posted by Shane O'Sullivan on June 1, 2009

Last week I put the finishing touches my Portlets for the Dojo Ajax Toolkit.  You can see them now on the test page at http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/widget/tests/test_PortletInGridContainer.html (it can take a while to load since it loads a hell of a lot of widgets and the code is not optimized with a build).

To see a description of what they can do, see my original post announcing them at http://shaneosullivan.wordpress.com/2009/03/11/cool-portlets-in-dojo

As a brief description, Portlets are widgets that represent individual applications used in a web portal.  They can be rearranged by dragging and dropping them around the page, and can often be customised with a number of settings.

The Dojo Portlets, in the dojox.widget project, support some useful features like:

  • Customisable settings widgets, for setting user defined options.
  • Loading Atom and RSS feeds to display as a list

and a good bit more.  See my previous post for a full description, or check out the test page.

Below you can see the Portlets using the blue Soria theme from Dojo.  There will probably be some small changes to the look and feel before v1.4 is released, but nothing major.  Note the different types of Portlets, from the Atom & RSS feed portlets on the left that can show more detail using tooltips or expandable secrions, to portlets containing generic widgets like a slideshow on the right.

Have fun!

Portlets

Posted in Ajax, Atom, dojo.data, dojo.image, dojox, dojox.image, Javascript, open source, tab | Tagged: | 16 Comments »

Cool Portlets in Dojo

Posted by Shane O'Sullivan on March 11, 2009

I’ve been working on writing Portlets for the Dojo Ajax Toolkit for a while now, and they’re almost ready.

You can see a demo of it at http://www.skynet.ie/~sos/misc/dojo/dojox/widget/tests/test_PortletInGridContainer.html?theme=soria

A Portlet is similar to a dijit.TitlePane, in that it has a title bar, a content area, and is collapsible.  However, it should also have the option of being configurable, perhaps using a dialog box or an expandable area.  A nice example is the BBC website at http://bbc.co.uk, or the Google Portal http://www.google.com/ig.

Portlets are generally presented in a draggable grid, and a very cool new addition to Dojo is the dojox.layout.GridContainer, which provides this framework.

A number of types of Portlets and Setting widgets will be provided, hopefully in v1.4 (1.3 is in final beta, so this is too late for that).

  • dojox.widget.Portlet – this is the basic Portlet, which provides a close button, a collapse button, and a settings button.  All of these are optional.
  • dojox.widget.FeedPortlet – this Portlet loads an external Atom or RSS feed and displays it as a list.  Hovering over an item shows a dijit.Tooltip with a summary of the news story.
  • dojox.widget.ExpandableFeedPortlet – similar to FeedPortlet, but instead of using tooltips, a toggle icon is used to show more or less of a news story.
  • dojox.widget.PortletSettings – a widget that can be placed inside a Portlet to provide customizable settings for that widget.
  • dojox.widget.PortletDialogSettings – like PortletSettings, but the configuration options are displayed in a dijit.Dialog.
  • dojox.widget.PortletFeedSettings – provides one or more URLs to Atom or RSS feeds for a FeedPortlet to load.

These widgets offer pretty large set of functionality, which should be sufficient for the majority of peoples needs.  However, this is still in active development, and if you have any ideas for cool additions or changes I could make, please let me know.

Posted in Ajax, Atom, Calendar, chart, charting, Date Picker, demo, dijit, Dojo, dojo.charting, dojo.data, dojox, open source, widget | 72 Comments »

Keep up with the latest Dojo Demos

Posted by Shane O'Sullivan on May 8, 2008

The Dojo Feature Explorer now has an Atom feed you can subscribe to to keep up with all the latest demos that have been added.  So, point your browser at http://dojocampus.org/explorer/featureexplorer/latestDemos.xml and subscribe!

For all the Web 2.0 addicts out there, I’ve also added access to the list via SCRIPT IO.  If you point your browser to http://dojocampus.org/explorer/featureexplorer/latestDemos.php, you will receive a file containing a JavaScript array of the last ten demos added to the feature explorer.  By default, it will call the function dojocDemos, passing it the array.  You can specify the callback function you want using the callback parameter. e.g.

http://dojocampus.org/explorer/featureexplorer/latestDemos.php?callback=myFunction

will call the myFunction JavaScript function.  You can load this file, as I mentioned, using SCRIPT IO.  This could be hard coded into your HTML page, e.g.:

<script type=”text/javascript” src=”http://dojocampus.org/explorer/featureexplorer/latestDemos/php?callback=myFunction”></script&gt;

or loaded using dojo.io.script.

Posted in Ajax, Atom, Dojo, Javascript, json, open source, Technical | Leave a Comment »

Google and Dojo, Sitting in a tree…

Posted by Shane O'Sullivan on May 1, 2008

I’ve submitted a bunch of new data stores to the Dojo Ajax Toolkit that make it simple to search Google directly from your own site (ticket here).

Update: I’ve also submitted a store to read any Atom or RSS feed, anywhere, without any server redirects. See Google And Dojo, F.E.E.D.I.N.G

This is different from putting a search box on your site and redirecting to Google. With the new dojox.data.GoogleSearchStore family of data stores, you can retrieve google search results in JSON format, and display them on your site directly.

Pause a second…. let it sink in…..

There are no cross domain issues, and no server side component is required. It uses the dojo.io.script transport to access the Google Ajax API service. Just stick the following on your page:

<div dojoType=”dojox.data.GoogleWebSearchStore” jsID=”googleStore”></div>

and you have Google’s millions of servers at your fingertips.

The following data stores are available:

  • GoogleWebSearchStore - does a standard web search.
  • GoogleBlogSearchStore - searches blogs. A future enhancement I will be writing will be to write a data store that accesses Google’s extremely cool Ajax Feed API, which provides access to any ATOM feed, anywhere, in JSON. It’ll be possible to do a full web search of all blogs for certain topics, then using the feed store to pull down that complete feed .
  • GoogleLocalSearchStore - searches the Google Local service to find places, businesses etc.
  • GoogleVideoSearchStore - Does what it says on the tin, searches for videos.
  • GoogleNewsSearchStore - Finds news stories…. noticing a pattern yet?
  • GoogleBookSearchStore - Um, finds books..
  • GoogleImageSearchStore - Finds images. This provides both a thumbnail and full sized version, similar to the FlickrRestStore already provided by Dojo.

The potential applications are more or less infinite. Demos included in the check-in show how to integrate this with the extremely cool dojox.dtl templating engine to display the results in a number of different ways, as well as how to feed the results into the Dojo Grid, Gallery and SlideShow.

This code is included in the nightly checkouts of Dojo, and not in v1.1. To get it, either check it out from source control, or get it from http://archive.dojotoolkit.org/nightly/.

Have a look at the simplistic demo of it in action at http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/data/demos/demo_GoogleSearchStore.html (available from the May 1st nightlies).

A big thank you to Google for making this service available. Now go play!

P.S. Stay tuned for the Yahoo variant, coming soon!

Posted in Ajax, Atom, Dojo, dojo.data, dojox, Javascript, json, open source, Technical | Tagged: | 11 Comments »

Dojo 1.1 is cooked and ready to eat!

Posted by Shane O'Sullivan on March 28, 2008

The latest and greatest release of the Dojo Ajax Toolkit has just hit the presses, and she’s looking good. As Alex mentioned, the number of cool features in Dojo can be difficult to keep up with, so I’ll just list some of the things I’ve either written for Dojo, helped along, or just been damn impressed by in this release:

Dojo Datastores

The number of useful data stores for Dojo just keeps growing and growing, under the watchful eye of Jared. For release 1.1, I submitted a data store to read Atom XML documents, dojox.data.AtomReadStore. See more about this at http://shaneosullivan.wordpress.com/2008/02/20/new-atom-data-store-for-dojo/.

FisheyeLite

Peter Higgins submitted an amazingly simple, but oh-so-cool widget called dojox.widget.FisheyeLite. Rather than act like a ‘true’ Fisheye widget, which would generally only work on images (á la OS X), this widget can apply cool Fisheye-like behaviors to just about anything – text, divs, spans, you name it. Check out the test page for some cool examples, or see my personal website for an example of how I used it to spruce up my site menu.

Django Template Languate – dojox.dtl

The Django Template Language is an amazingly powerful templating language, with which you can turn your JavaScript data into HTML. While this was originally designed to be a server side templating solution, Neil Roberts has done a brilliant job of converting it over to work in the browser. While I though I’d had an original idea when I pitched the idea to him that it’d be cool to integrate Dojo data stores directly into DTL, Alex already had the whole thing implemented and about to check it in. Typical :-) I’ve written up a tutorial on how to integrate DTL with Dojo data stores, specifically the AtomReadStore I wrote, at http://shaneosullivan.wordpress.com/2008/03/03/writing-a-django-template-widget-with-dojo-data-stores/.

Functional Programming

This enables you perform many operations on data using just a single function call. Once of the cool things it provides is the ability to specify a function as a simple string, drastically reducing the complexity and size of your own code. Eugene Lazutkin wrote a great blog post about this, which is well worth a read. I wrote a follow up post, as a quick reference to some of the cool things you can do with this feature. Some of this was available in 1.0, but I’ve just discovered it, so here you go!

Dojo Campus

Peter Higgins, Nikolai Onken and myself have been working on a new learning resource for Dojo developers, called Dojo Campus. It provides a lot of learning materials, including videos, tutorials for beginners and more advanced programmers, and much more. We also have a still-under-wraps-but-soon-to-be-release demo engine that has loads of easy to use runtime examples of things to make and do with Dojo. I blogged about a very early version of it at http://shaneosullivan.wordpress.com/2008/01/07/dojo-demo-engine-update/, but it’s come a long way since then. Keep you eyes peeled for it’s release. Any day now…..

And finally….

A very sexy Calendar widget I’ve written got submitted just a bit too late to make in into 1.1 (read: the day before release), but will be in the nightlies soon, and will make it into 1.2. See the blog post about it at http://shaneosullivan.wordpress.com/2008/03/24/sexy-new-calendar-widget-for-dojo/.

This is nowhere near a comprehensive list of course, just the bits I’ve been fiddling with over the last few months:

  • See Dylan’s post for some more info.
  • Get the release notes here.
  • See the Ajaxian post here.
  • See Alex Russell’s (Dojo project lead) post here.

So go forth and explore, it’s good healthy nerd-fun! Share this post:
digg it|kick it|Email it|bookmark it|reddit|liveIt

Posted in Ajax, Alex Russell, Atom, Date Picker, demo, Demo Engine, django, Dojo, dojo.data, dojox.data, Javascript, json, open source, Technical, widget | Leave a Comment »

New Atom data store for Dojo

Posted by Shane O'Sullivan on February 20, 2008

I’ve just submitted a patch to the DojoX project for a dojo.data data store that can read Atom XML documents. It’s relatively simple for the moment, but is capable of taking an XML document that conforms to the Atom spec, and returning the entries using the dojo.data.Read API.

Update: this has now been committed to the DojoX project.

This arose out a desire to rewrite the page on my personal website that mirrors this blog. At time of writing, that has a strong dependency on PHP to query my blog for the Atom feed, parse the feed, and output it using a server side HTML template.

This is of course be easily achievable on the browser also, except for the fetching of the XML document from the remote website which the server would still have to do. Of course, if the Atom URL is on the same server as the page, even this dependency could be removed, and all the work, from the fetching, parsing and templating, could be done on the browser.

However, implementing this as a Dojo data store has many advantages, the primary one being that I get to play with integrating a Dojo data store with the very very cool Django templating language package in DojoX, dojox.dtl. Alex recently checked in a patch to dojox.dtl that enables the use of dojo.data stores directly in templates, so I can’t wait to get this checked in (once any issues Jared has with it are satisfied) and get going on my site!
Share this post:digg it|kick it|Email it|bookmark it|reddit|liveIt

Posted in Ajax, Alex Russell, Atom, Blogs, Dojo, dojo.data, dojox.data, Feeds, Javascript, json, open source, Technical | 2 Comments »

I am a sponge!

Posted by Shane O'Sullivan on June 27, 2006

(a sponge absorbing knowledge, not IBM’s conference fees… honestly)

The first two days of ApacheCon Europe are now over and done with – and what have we learned children? I chose to attend two of the full day tutorials,

  • Practical Hands-on Tutorial on JavaServer Faces Using Apache MyFaces, and
  • An XSLT Tutorial, Including XSLT 2.0 and Publishing with Cocoon

The first was relatively interesting, and since I was (am, I suppose) a relative newcomer to the JSF world, a lot of it was new to me – though of course the main idea of this being essentially “another” MVC architecture meant that much was familiar from Struts. The bar was kept pretty low for the day however, mostly due to the fact that it was a very hands-on tutorial, with each of us expected to implement relatively simple JSF applications. Differences in each person’s laptop setup (JRE version etc) meant that various errors occurred, rarely the same, which slowed the whole thing down. As the organisers themselves said, they could easily have filled three days with this stuff, and it’s just a pity that time was so short. It should also be noted that the tutorial was marked as “Novice”, and it’s really my own fault for not reading the small print. The one small highlight of the day was where the Oracle-based speakers repeatedly apologised each time they *forgot* to mention IBM in each vendor listing. Funny stuff, or else I’m easily amused.

The second days tutorial, focused on XSLT, was considerably more interesting, at least to me as much of my recent work has been based around it. The speaker, Doug Tidwell from IBM, is the author of the O’Reilly XSLT book, and is therefore extremely knowledgeable on the subject. Much of the basic XSLT 1.0 stuff I was already pretty familiar with, but I was very happy to find out that XSLT 2.0 has drastically simplified much of the overly-verbose structures of version 1.0. However, raining on my parade was the fact that there will probably be no browser support for XSLT/XPath 2.0 in the near to medium term – if anyone knows of any support for this coming to either Firefox or, very importantly, Internet Explorer 7, please let me know. Without this support, XSLT 2.0 will remain very much a server side phenomenon, which would be a real shame, since it is a vast improvement over version 1.0, and many cool/nifty things can be done with XSLT browser-side, especially when combined with things like Atom feeds.

On a side note, I’ve recently discovered that JackRabbit, the Apache based Java Content Repository implementation, only supports a subset of XPath 1.0 – for example, you cannot do a query like:

/base/child[position()>1][position()<11]

which would be very useful for paging. There are a number of other limitations to the implementation. If anyone is in a programmy kind of mood, and feels like diving the depths of JackRabbit, Lucene and Derby, adding full XPath 1.0 support would be cool little (read huge) and very worthwhile project.

Posted in Apache, ApacheCon, Atom, Technical, xslt xpath jackrabbit jsf | Leave a Comment »

Threading extensions to the Atom Publishing Protocol

Posted by Shane O'Sullivan on June 23, 2006

James Snell's bid to conquer the webiverse through the power of the Atom continues apace. His threading extension for Atom has been approved as a proposed standard for linking multiple entries/feeds in a threaded manner. See this post for his announcement, and, more interesting, his post on how to use the threading with Abdera, the Apache Atom parser.

Posted in Abdera, Apache, Atom, Feeds, Technical, Threading | Leave a Comment »

Abdera Atom parser gone to Apache Incubator

Posted by Shane O'Sullivan on June 13, 2006

James Snell's Abdera project has been accepted as an Incubator project by Apache. Abdera is a dedicated Java-based Atom parser. Unlike ROME, a similar project whose aim is to parse all sydication formats, including all versions of RSS and Atom, Abdera instead focuses on just on Atom, which seems to one major advantage – performance.

I've played around a bit with both ROME and Abdera, and they're both quite easy to use, with quite similar structures, obviously enough designed around the Atom sydication format. However, as Rob mentions, in some initial performance comparisons, you can see a reduction of from 10 to 40 times in memory consumption, and up to 8 or 9 times in CPU cycles, which is just massive.

Abdera is still very early on in development, but it's already gotten good documentation and examples, so I'm very impressed. Handy ice breaker for ApacheCon in a couple of weeks!

Posted in Abdera, Apache, Atom, Technical | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 533 other followers

%d bloggers like this: