The KDE community announced yesterday the official release of version 4.3, a significant new version that brings a number of compelling improvements to the popular open source desktop environment. According to the developers, over 10,000 bug reports have been resolved since the last version, and over 63,000 changes were committed to the project's version control system. These statistics reflect the enormous amount of refinement that is visible in the 4.3 release.

Social Desktop

KDE 4.3 is the first version of the desktop environment to include integration with the KDE community's Social Desktop initiative. This project was largely conceived by Frank Karlitschek, the developer behind the openDesktop.org network--including the popular theming community sites KDE-Look.org and GNOME-Look.org.

Karlitschek has created an API that allows desktop software to interact with his Web sites, making it possible for applications to dip into the community-oriented social networking features and content that he hosts. The openDesktop.org services include friend and identity systems, a microblogging component, private messaging, desktop theme hosting and search, event tracking, and several other features.

He hopes that his Web APIs will gain cross-desktop acceptance and serve as a generic, vendor-neutral standard that can be implemented by third-party Web services. He has documented the API, which he calls the Open Collaboration Services (OCS) specification, at the FreeDesktop.org wiki and is actively looking for feedback from application developers. The OCS APIs can be used today to interact with his Web sites, but there are no third-party server implementations yet.

One of the fundamental ideas behind the Social Desktop effort is to facilitate community-building by providing a vehicle for connecting open source software enthusiasts to each other. It can be used to help inform others about Linux user group meetings, release parties, and similar events. It can also help you find fellow Linux enthusiasts in your region. Another important motivator behind the project is the need to simplify the process of providing community-based software support for new users. The OCS knowledgebase framework, for example, allows users to ask questions about open source software and get answers from other members of the community.

The KDE developers have created a Plasma data engine that supports the OCS APIs. In KDE 4.3, it is used by a new social desktop Plasmoid that allows you to send messages to your friends and find users who live in your region. It is very simple, and its functionality is still somewhat limited, but it's a good start because it demonstrates how OCS can be used to bring social networking directly to the desktop.

Karlitschek has also launched a Social Desktop contest, offering prizes for developers who can create the most useful and innovative applications with OCS. This will encourage broader adoption of the APIs and could help attract GNOME developers to OCS, making it a truly cross-desktop effort. The contest could potentially spawn some new OCS-based applications for future versions of KDE. It will also help Karlitschek obtain much-needed developer feedback that can aid him in guiding the development of the standard. Developers can learn more about the contest and how to participate at the Social Desktop web site.

I began examining OCS several months ago, and I discussed the APIs with Karlitschek. He's highly receptive to developer input and made a number of improvements to the APIs based on my own feedback and suggestions. As an experiment to ascertain the viability of bringing OCS to GTK+ applications, I implemented support for several features of the service—such as theme searching—in my program, a microblogging client for GNOME called Gwibber.

OCS has a lot of potential, but the APIs still need further refinement before it will be ready for adoption as a cross-desktop standard. The XML output of some of the API methods, particularly those relating to content, have some idiosyncrasies that will create challenges for parsing and validation.

For example, individual content items can have a variable number of preview and download items, which each have a number in the tagname: downloadlink1, downloadlink2, downloadtype2, etc. It would obviously be better to structure download items into nested tags so that client applications can simply iterate over a sequence of download element nodes. I proposed this to Karlitschek, who says that such a change could potentially be considered for future versions of the API but can't be adopted right now because he wants to avoid breaking compatibility with existing applications.

The following example demonstrates how to connect to the service and retrieve the latest items in the activity stream with Python. It uses the JSON output format.

#!/usr/bin/env python import urllib, urllib2, json, base64 OCS_USERNAME = "segphault" OCS_PASSWORD = "XXXXXXXXXXXX" HEADER = { "Authorization": "Basic " + base64.encodestring( "%s:%s" % (OCS_USERNAME, OCS_PASSWORD))} API_ROOT = "http://api.opendesktop.org/v1" request = urllib2.Request(API_ROOT + "/activity?" + urllib.urlencode({"format": "json"}), headers = HEADER) response = json.load(urllib2.urlopen(request)) for message in response["data"]: print message["firstname"], "-", message["message"]

OCS is still at a relatively early stage of development, and KDE integration is still largely experimental, but the underlying concept and broader vision are both highly promising. If the API can be refined and made suitable for broader adoption, it could gain serious traction.