Re: [Tracker] A clean way to add service types



Hi Ivan,

I think that would be a great way to simplify adding new services :)
I have two additions to your suggestion:

- Specify a program that is called when I click on a search result (e.g. Tomboy is opened when I click on a Tomboy note in the results)

- Specify inclusion/exclusion filters on files/folders (e.g. in ~/.tomboy, there are .note files, but also configuration files that should not be indexed; there are also subdirectories that should be excluded)


Dustin


Ivan Frade schrieb:
Hi,

 Now it is quite difficult to add new service types in tracker (look at
the Tomboy integration in another thread in the mailing list). Here is
my proposal to simplify it.

 Tracker need to know the service type of a file. When the service type
is known, it can decide to index the contents, extract metadata, etc.
 Right now, we can assign a mimetype to a service type through .service
files. At the same time, in the code we have some special cases ("Web
History" or "Applications" for instance) where a directory is assigned
to a category (hardcoded!).

 My proposal is to load from configuration files this "directory -
service type" link (extending, not replacing, the current mime
solution). It can be useful to integrate cleanly more applications into
tracker (like tomboy) and to remove the ugly special cases in the code.

 Unfortunately, it is not so easy. Tracker-extract and the filter system
are based in the mimetype to choose the correct extractor/filter. So,
when tracker uses the directory to infer the service type, the real
mimetype of the file could be wrong. For instance, a tomboy note
in .tomboy/ directory have a text/plain mime type.

 One solution could be to use "virtual" mimetypes. For example:

[TomboyNotes]
Parent=Files
Dir=$HOME/.tomboy
VirtualMime=tracker/tomboy
HasFullText=true
HasMetadata=true
HasThumbs=false


And then tracker will call "tracker-extract /home/xxx/.tomboy/12iod3j.note tracker/tomboy"

 and use filter: tracker/tomboy_filter

 I think this could be a good and clean solution to add new applications
in tracker. What do you think?

 Sorry for the long mail. I couldn't use less words.

Ivan


_______________________________________________
tracker-list mailing list
tracker-list gnome org
http://mail.gnome.org/mailman/listinfo/tracker-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]