The Bookmarks Example

From Aventine Solutions

Jump to: navigation, search

Contents

[edit] What is this?

Download the code in a ZIP file.

The bookmarks example is a small set of code I developed which has some real world functionality but is intended more as a learning tool for developers, especially for XML and XSL, and not as a standalone software component. Currently, the example does the following:

  1. Stores Internet bookmarks in a generic yet well-defined XML schema. Using XML allows the user to store a database of internet favorites in a browser-neutral format and in one place.
  2. Transforms bookmarks into formats that can be imported into the bookmark managers of Opera, Safari and Firefox plus a simple HTML output for viewing from a website. Using the transformations, the user can import the database into any of these browsers on any of the supported browser platforms.

This small project grew out of my personal need to try to keep a single database of internet favorites while I use several workstations and laptops at home and at work, running Windows, Linux and MacOSX.

[edit] A little history here ...

Sychronizing bookmarks between workstations and browsers is not a new problem and in fact, it presented itself when the web first took off in the early 90's. Many have attempted to solve this problem and there are few excellent solutions in the social web now, my favorite being the del.icio.us social bookmarking site.

  • In the 90's, there was a SyncIt tool I found quite handy which installed a small program into the system tray on Windows and attempted from a website to automatically synchronize bookmarks between Internet Explorer and Netscape. You installed the program on multiple workstations and it used the account on the website as the source database. It was not perfect (often items were duplicated, a common problem with syncing software), but I grew quite addicted to the program. After the Dot.com bubble burst, the company behind it seemed to flounder, then a black-out in the New York metro area apparently dealt a final blow to their servers (sometime in 2001, I guess), so poof the tool was gone. This example code grew out of those circumstances. Since then, seems the site has been resurrected as Bookmarks Sync2it if you want to check it out.
  • Turn the corner in the new millenium to the social web, and there pops up del.icio.us which provided cross browsing scripting methods (with a dash of AJAX) to keep all your bookmarks nicely tucked away and categorized on their server, ready to be shared with your friends. I'll leave it to you to read the history of del.icio.us, except to mention that it is now owned by Yahoo. The official Yahoo Firefox extension is full featured (there are several other extensions to try) and essentially acts as a bookmark sync between all instances of Firefox in which you've installed this extension.
  • A subscription to Dot Mac will buy you syncing of your bookmarks between your various Macintoshes, including other workstation configuration items like contacts and calendars, but is is not free. Apparently, iPhone and iPod touch users can use iTunes at a given workstation to sync the bookmarks from Safari or Internet Exploer these mobile devices.
  • There are some projects afoot to allow a seemless browsing experience for the user across workstations and away from home which beside synchronizing bookmarks, includes such things as remembering browser history and preferences. This includes Mozilla's Weave beta. Apparently, it's already a feature of Opera 9.5 (see this Cybernet article which explains how to set it up), but I haven't tried it yet.

[edit] The Problems

  • The bookmark format which can be imported into Mozilla/Firefox has been around since the Netscape days and existed before XML was defined, so it is valid HTML but not well-formed XML which makes straightforward reading in to an XML parser impossible.
  • The Safari format seems to be based on the Mozilla format, but ever so slightly different.
  • Opera fans, who are in a tiny browser using minority, love this browser but know all too well that it has it's own format for exporting/importing bookmarks (and contacts as well) which has to do with neither XML nor HTML.
  • Del.icio.us bookmarks may be backed up to your local disk (if, like me, you don't trust having important information like this on their server), but, guess what, it uses the old, malformed Mozilla HTML format.

[edit] What This Example Shows

  • Managing, documenting and using an XSD schema
  • Writing XSLT transformations
  • Trying out XML and XSLT coding in Oxygen XML, the standalone version and the Eclipse plug-in.
  • Doing transformations using Java from an Ant build and Maven goal which can be used from the command line and from within Eclipse thus providing small examples of those configuration management tools.

Future articles and features will attempt to demonstrate ...

  • Using the new Author Mode of Oxygen XML and defining the required CSS 3 stylesheet.
  • Using Ruby, Rake and REXML to do transformations
  • Importing Del.icio.us bookmarks and merging them into the XML content using Ruby. The attempt here will be to reconcile the two methods of categorizing the bookmarks: traditional hierarchical folder structure with Web2.0 tagging.

While I use different browsers and platforms, I haven't tested the transformed content in every possible combination. I do use it often on ...

  • Firefox, Opera and Safari on MacOSX
  • Firefox and Opera on Windows
  • Firefox and Opera on Linux (Fedora)

Download the code in a ZIP file.

Personal tools