Google

Akonadi Google Resource: complete rewrite

Hi there,

today I finally pushed a completely new version of the Akonadi Google Resource. Since last update cca 2 months ago I’ve completely rewritten the resources, moving most of the functionality into libKGoogle. The library now provides access to Google services and can be easily used by any other project.

So what’s new? A lot of things changed for programmers. I’ve begun to fulfill my threats about providing a C++/Qt library for accessing Google Services. It’s not pure Qt, I’m using some KDE stuff in there, but that will change :)

LibKGoogle now provides API similar to QNetworkAccessManager (KGoogleAccessManager) through which you can send KGoogleRequest and if it works, you’ll receive a KGoogleReply. Each Google Service is represented by a KGoogleService subclass, implementing XML and/or JSON parser and serializer and providing informations about fetch/create/update URLs. Each object (contact, event, calendar) is represented by KGoogleObject subclass. For now, Event class is implements KCalCore::Event as well, the Calendar and Contact classes provide their own implementation of everything. Porting it to KABC/KCalCore is on TODO.

libKGoogle provides unified authentication framework and stores the tokens in KWallet. For now, you can only use one account per service (means that you can’t have two calendars from two different Google accounts), but this is on my TODO as well. The framework is also able to automatically refresh the tokens when they expire, so that should fix the problem with “resources forgeting the authentication”.

The API needs some more polishing and I must somehow force myself to write documentation, but the I think the libKGoogle can provide a solid base for any Google-related services.

The library is still in the same git repository with the Resources. I will try to move it to it’s own repo when it gets support for more services and the API will really stabilize.

Contacts Resource new Settings Dialog
Contacts Resource new Settings Dialog 2

From users’ point of view, there is just a very slight change in Contact Resource settings dialog. There are no new features in any resource. Though there are probably many new bugs :F So please try it out and don’t be afraid to spam me with any issue, idea, problem, comment, invitations to a beer etc…:)

With libKGoogle I hope more developers will begin to create Google-related applications for Qt and KDE. This library could one day be a good start-point for them.

Plans for future versions:

  • support more contacts and event properties
  • support multiple Google accounts per service
  • changing contact photos
  • tie KGoogleObjects to KCalCore and KABC
  • API cleanup
  • DOCUMENTATION :/
  • make the libkgoogle optionally KDE-independent (long-term plan)

Akonadi Google Resource, part III

It’s been more then two weeks since my last update about progress on Akonadi Google Resource, so here we go. Many bugs in calendar were fixed, resource now supports creating and editing events and Contacts resource can fetch contact photos.

So let’s start with the contacts. I’ve implemented fetching photos from Google Contacts, so now you can see all your contacts smiling at you from your address book. Updating/removing photos is on to-do, but there are more important things to be implemented/fixed first.

Now to calendar resource: you can now finally create and edit events from KOrganizer. I’ve also fixed some issues with timezones, recurrence and reminders, so it really seems to work pretty good now. What has to be done are timezones in recurrence. I’ve also implemented removing of events, but there seems to be some hidden problem somewhere, because Akonadi refuses to invoke itemRemoved() signal, thus informing the resource, that event was removed and the resource can’t send deletion request to Google Calendar….I hope I’ll get to look into this this week. Of course, if you feel you can do something about it, just send patches ;)

Known bugs: except for the broken deleting of events there is a problem with authentication. Google only remembers the last authentication token it has issued, so when you have two Calendar resources for example, Google will accept requests only from the one you added as second. When you re-authenticate the first calendar, Google will forget access token of the second calendar and vice versa. Using KWallet to store the access token would be probably the best way how to share a single token among multiple resources and of course it would increase security a lot, but I need to learn how to do it first :).

And finally, about future of this project…I was in contact with developer of the original Akonadi GData resource (now called Akonadi GCalendar & Contacts resources) and we agreed that it would be nice to have a C++/Qt library for full support of GData API (including other services, not just calendars and contacts). I will be slowly moving all the GData-related code from resources to a separate library. My idea is to provide a pure-Qt library with optional KDE extensions (like conversion to KABC or KCalCore objects), which could be enabled during build-time, so that the library could be KDE-(in)dependent, depending on developers’ needs. But this will be content of an another blog post, maybe later when things will begin to move. Now is my priority to improve the resource, because the Akonadi-related code is minimum compared to GData-related code which can be later dragged into the library.

So, that would be all for now, please test the resource and give me some feedback :)

Cheers,

Dan

Akonadi Google Resource 0.2

Hi,

so it’s been almost ten days since first version of Akonadi Google Resource and now here comes 0.2. This version introduces Google Calendar Resource, so that you can finally access Google Calendar from comfortable interface of KOrganizer.

UPDATE: Akonadi Google Resource is now in KDE git repository!

Preview of Google Calendar Resource settings dialog

As of now the resource supports read-only access to calendars, so you can just watch your busy schedule, but you still have to update it in GMail. Some basic write support is the main goal for version 0.3.

A good news is, that the resource supports multiple calendars, so you can finally see all your calendars in KOrganizer, not just the default one. You have to add a new resource for each calendar you want to access. In configuration dialog you can then choose, which calendar you want to sync with.

The resource supports, except for the basic properties, multiple attendees, including their roles and types, recurrent events (but without exceptions) and reminders (popup-dialog and email notification).

As I already said, in 0.3 I’d like to introduce read-write access to Google Calendar and add photo-fetching to the Contacts resource.

If you want to give it a try, you can download 0.2 tarball from here, or you get the most recent sources from git:

git clone git://gitorious.org/akonadi-google/akonadi-google.git

Bye!

UPDATE: Akonadi Google Resource is now in KDE git repository. To fetch it, use: git clone git://anongit.kde.org/akonadi-google.

Google support in Akonadi, part I

My job as a Red Hat internet is development of Evolution, the groupware software. Although I’m using Gnome 3 and all the Gtk stuff in work, I’m still loyal to KDE on my personal laptop. But one thing I really like on Evolution and I really miss in KDE PIM is proper support for Google services. As result of this and after some talking with my flatmate, I started to work on real, fullfeatured Akonadi Resource for Google Services.

At this moment, after about week of work I have working Contacts Resource. It can fetch, create, update and remove contacts from Google server using their GData API. The implementation of GData protocol is far from complete, as of now only few basic values are supported (name, emails, phones, addresses, notes).

Since this implementation is actually “working”, I’ve decided to release it as 0.1.

Version 0.2 should bring basic support for Google Calendar and most probably some major refactoring of libkgoogle. Following releases will focus on improving support of GData protocol, including fetching of contacts photos. I have to mention here, that the code is inspired by code of the great Akonadi Facebook Resource, because this is my first Akonadi-related code and I really need something to learn from :)

There are no screenshots worth posting at this moment, you rather try checking out the sources, maybe sending some patches back, what do you say? ;) Sources are available in Gitorious: http://www.gitorious.org/akonadi-google, clone URL is git://gitorious.org/akonadi-google/akonadi-google.git.

UPDATE: the project is now hosted in KDE Git repo on *https://projects.kde.org/projects/playground/pim/akonadi-google.