Bookmarks Data API
The goal of this is to create a Bookmarks Data API that can support all the various sorts of things we want to be able to do with bookmarks (smart bookmarks, live bookmarks, remote bookmarks, shared bookmarks, live imported bookmarks, etc etc etc). The implementations of these bits aren't relevant to this API, however the API should make it possible to do all of those.
To use regular bookmarks and live bookmarks as an example: there would be a provider with a type of "simple" for regular bookmarks, and a provider with a type of "rss" for live bookmarks.
The simple provider's bmIBookmarkItem implementation wouldn't have much other than just the URI and the name. It would return true for all canBeContainedBy queries. The bmIBookmarkContainer would also be straightforward, and would return true for all canContain queries. For serialization, the container would just ask each child to serialize itself, chain these together, add some data (such as its own name and id), and return.
The live bookmarks provider would have its own implementation of bmIBookmarkContainer and bmIBookmarkItem; the container would reference a particular URL (which is what it would serialize, along with maybe information about items that have been visited), and it would create a bunch of bmIBookmarkItems (bmRSSBookmarkItem?) that would have URIs for the individual entries. bmLivemark would be a bmIBookmarkContainer with readOnly = false and containerReadOnly = true. Because these are read-only, the canContain/canBeContainedBy values don't really matter.
There is a Bookmarks Use Cases page if you would like to describe and discuss user-level Bookmark behaviours and use cases.
VladVukicevic 20:26, 6 Jul 2005 (PDT): Updated API incorporating comments, and expanding in-IDL documentation. All bmI* became mozI*. Removed the forwarded nsIMutableArray methods from mozIBookmarkContainer, and just required all mozIBookmarkContainer implementations to also implement nsIMutableArray. All mozIBookmarkNode implementations also must implement nsIWritablePropertyBag. Removed serialization/deserialization -- the property bag for each node should contain the entire state of that node, and will be serialized/deserialized automatically if the node is serialized.