Mailody and Akonadi meet Nepomuk
Isn’t it great to have two Pilars of KDE in the subject? Anyway, this weekend I started working on Nepomuk. The end goals is simple, I want to tag my e-mails and have the possibility to enter a comment about them.
First step was trying to get some basic interaction with Nepomuk. They seem to change their API a lot, so it took some time and help from DanielW on #nepomuk-kde to get that working. Afer that I went looking for a widget that could be used for this.
I actually like the complete widget that Dolphin uses, but that’s not available in KDE libs and I did not want to go throught the process of doing the move. Luckely Nepomuk provides a tiny widget which can be integrated easily and does not take to much space in Mailody. I’ve put it in a QDockWidget so people can put it at the bottom of the complete Mailody window if they need more space. It now looks like this:
[img_assist|nid=245|title=Mailody meets Nepomuk|desc=|link=none|align=center|width=453|height=166]
On the right there is a little arrow and if you press it, you see a popup with all existing tags so you can easily assign them to a message. Whenever you switch between messages the area shows the assigned tags.
Assigning is fun, but you need to be able to do anything with it, right? Right. Of course you can use the kioslave to search for the tag and get all the messages which are tagged with that tag, but that should also be possible in Mailody.
So I implemented an Akonadi Resource for it. Similar to an IMAP resource that shows you the folders of an account, the Nepomuk tags resource shows you a folder for each tag, selecting it brings out all the messages that belong to that tag. It looks like this:
[img_assist|nid=246|title=Akonadi meets Nepomuk|desc=|link=none|align=center|width=391|height=224]
To get it to work Volker Krause implemented the LinkJob and UnlinkJob in the Akonadi KDE library. This makes it possible to link certain messages from there original folders to a virtual folder. The server was already prepared to handle this kind of Virtual Folders. What would we do without Volker?
Conclusion is that it is now possible to tag your emails with any tag you like and retrieve the messages with a certain tag just as easily. Next step is to implement the possibility to make comments on mails.
ok, this is just plain awesomeness wrapped in cool.
do you have any ideas when you’ll be able to reference tags when searching for mails? that would be great when viewing a folder of email!
How about searching for multiple tags at once? like i want to search for my “school” that is also related to “kde” or something like that? would that be possible?
I just committed the possibility to do a quick search based on the tag (you know, the bar at the top). Extending that to multiple tags is a matter of hacking on it for half an hour probably. Great as a junior job. ;-)
I just committed that part. The quick search bar can now be used to filter the messages with that tag. Also from the assign widget (the top image in this blog) you can click the tag to filter the current message list on that tag.
Tags are cool, and very cool if they integrate with other desktop searches. (Something Thunderbird doesn’t do is integrate with KDE4.) However, what would be REALLY cool, would be automatic tagging of saved attachments with some sort of “link” to the original email, and a more general link to the sender contact (from the Akonadi Contacts resource) indicating who it’s from in case the email is deleted. Any idea when that kind of functionality might be possible?
It should not be that hard to implement. All email received by akonadi is added to Nepomuk. So it is a matter of keeping the nepomuk information when an attachment is saved to disk. Another 1/2 hour of work for someone who wants to do that.
Cool stuff. :)
As for the searches. Why not use the Nepomuk query service to provide arbitrary virtual folders in Akonadi? I think tokoe was working on that. But I think it would be quite simple. Instead of your own tag filtering code you “just” send a query to the Nepomuk query service. The query for the tags would look like (this is the human readable variant of course ;)
type:email AND hastag:foo AND hastag::barCheers,
Sebastian
Hi Sebastian,
That’s exactly the goal in longer term. I wanted to start easy with this.
Toma