Introduction

Overview

Bookmarks are widely-used part of the World Wide Web browsers. They are a mechanism through which a user can return to specific sites already visited, much like their book counterparts.

Recently, bookmarks have become a feature for user with regards to browsing their file system, as a way to access recently used, or often used, places.

Even the list of recently used files can be seen as being composed of short-lived bookmarks.

Objectives of this specification

This specification aims to do the following things:

Storage format

For different desktops and applications to have access to the same information, a protocol for storing the bookmarks list has to be determined.

Base layout

A valid, UTF-8 encoded XML document will be used for storing the desktop bookmarks. The storage format will conform to the XBEL DTD with custom meta-data; see the XBEL specification for the contents of the bookmark, title, desc and info elements used in this specification.

A valid desktop bookmark stream must conform to the 1.0 version of the XBEL Specification. The root element must be the xbel element, with its version attribute set to "1.0". No folder element should be used, as well as no alias and separator elements; if any of those elements are found, they should be ignored.

Each bookmark must have the bookmark element as root node. The target URI of the bookmark must be stored in the href attribute of the bookmark element.

Each bookmark element should have its added, modified and visited attributes set with date and time specified as a string conformant to the ISO 8601 specification. The time should be relative to UTC time; local time should be converted to UTC before encoding, and converted back after reading the attribute payload.

Desktop Bookmarks meta-data

The owner for all the meta-data elements defined in this specification must be Freedesktop.Org. Thus, the owner attribute of the meta-data element containing the following elements must be set to http://freedesktop.org. Other meta-data, enclosed inside a metadata element with another, or no owner, should be ignored.

All meta-data defined in this specification belongs to a namespace, named bookmark whose URI is http://www.freedesktop.org/standards/desktop-bookmarks, except for the mime-type element, whose namespace is to be named mime and must have this URI: http://www.freedesktop.org/standards/shared-mime-info.

Each metadata element might contain any combination of the following elements, in any order:

Storage Files

Desktop bookmarks file might contain a variable number of bookmarks. Each bookmark file should contain at least one bookmark stored using the format described previously. The default extension for the desktop bookmarks file should be xbel. Imlementors should use the same ordering of the bookmarks stored inside the bookmarks file when displaying them, and should take care into storing the bookmarks inside a bookmarks file using the same order in which they are displayed.

Implementors should also take care of avoiding concurrent accesses to these files; for instance, by using file locking techniques.

File location

Standard locations for bookmark files defined in this specification are:

Application specific desktop bookmark files should be stored under the $XDG_DATA_DIRS/desktop-bookmarks directory. Each directory in the search path should be used. When two desktop bookmark files have the same name, the one appearing earlier should be used. Only files with the xbel extension are used; other files are ignored.

File encoding

All text in the file should be stored in the UTF-8 encoding. Standard encoding rules for XML and XBEL documents applies the desktop bookmark files. No local paths are allowed in the URI tag; they should be converted to a valid URI with a "file" scheme. Items with the same URI are not allowed.

Change notification

Notification should be accomplished by simply monitoring the files for changes. This can be done by either polling the file every so often, or using a libraries like FAM, d-notify or i-notify.

Registered meta-data

The meta-data associated to this spec will contain informations about the applications that have registered a bookmark, the groups to which a bookmark belongs and its visibility in relation to applications and groups.

Applications

Bookmarks must have at least an application registration.

Bookmarks might be registered by more than one application. For each application registering a bookmark, will be stored the application's name, the application's command line, the number of registrations for the application and the last time the application registered a bookmark, the timestamp (seconds from the system's epoch) of the registration time.

If an application tries to register again a bookmark, that is: if there already is an application tag with its name attribute set to the same name passed by the application, then the application tag should have the content of the timestamp attribute updated, and the content of the count attribute increased by one.

List of valid exec attribute variables

Each exec attribute of the application element may take a number of arguments which will be expanded by the implementor.

Literal % characters must be escaped as %%. Each unrecognised variable should be left unexpanded.

Recognised variables are as follows:

Groups

Groups implement meta-classes of bookmarks. The bookmarks belonging to a group (or a set of groups) will be shared across each member of the group.

For instance, each email client application could register its bookmarks under the group Mail, so that each other mail-related application could access those bookmarks.

For a list of registered group names, see the Registered group names section.

Visibility

The privacy hint of a bookmark is set using the private element. Each item with this hint set should be visible only for the groups and applications that registered it.

Appendix A: Implementation recommendations

Any implementor of this specification should conform to these recommendations:

Appendix B: Registered group names

Remember, these are case-sensitive. When using a group name described in the list below it is strongly recommended to also include the group listed under Related Groups. If a group has multiple related groups the most suitable related group should be included.

Appendix C: How to add a new desktop bookmark file

In order to properly install a new desktop bookmark file, third party applications should:

Appendix D: Desktops and applications using this specification

Please add to and update this list where it is missing or incomplete.


Author: Emmanuele Bassi

Version: 0.8.5