|
From: Chris F. <cd...@fo...> - 2010-09-18 11:24:05
|
On Sat, Sep 18, 2010 at 12:40:36PM +0200, deloptes wrote: > The thing is that I'm not sure where to do it and what type of format and > objtype I need to set - or do I need a proper configuration file? I'm definitely not an Akonadi expert, but if the types change per installation, this should be taken into account in discover. Also, each type can be enabled and disabled in the plugin config. This is handled by the engine, although the plugin can make use of it. If both are "true" (for example, if Akonadi supports events and events are enabled in the plugin config), then that type can be enabled in the discover process. I'm afraid I'm not explaining this very well. Let me know if you have more questions. > the file plugin i.e. could be used to sync "Local Folders" and may > be "outbox" too > > [1284801554.297273] FORMAT: vcard21 > [1284801554.297299] FORMAT: vcard30 > [1284801554.297320] FORMAT: vevent10 > [1284801554.297339] FORMAT: vevent20 > [1284801554.297358] FORMAT: vtodo10 > [1284801554.297377] FORMAT: vtodo20 > [1284801554.297396] FORMAT: vjournal > [1284801554.297415] FORMAT: vnote11 This depends on what format of data you get from Akonadi. Can you extract RFC format data from it? If so, then these are what you want. > [1284801554.297435] FORMAT: xmlformat-contact > [1284801554.297457] FORMAT: xmlformat-event > [1284801554.297476] FORMAT: xmlformat-todo > [1284801554.297496] FORMAT: xmlformat-note Opensync has its own xmlformat for these types, and converts the RFC formats into XML internally. These same XML documents, in binary parsed form, can be passed to the plugin, and used via the osync xml and xmlformat APIs. This saves the need for parsing. > [1284801554.297515] FORMAT: xmlformat-contact-doc > [1284801554.297535] FORMAT: xmlformat-event-doc > [1284801554.297563] FORMAT: xmlformat-todo-doc > [1284801554.297582] FORMAT: xmlformat-note-doc If what you want is the actual XML, then you want the doc, in text. If you need to work with the data, you'll need to parse it with libxml yourself, or use the osync xml API. Alternatively, you can use XSLT to transform the XML into something that Akonadi can use, and vice versa. > [1284801554.297622] FORMAT: file > [1284801554.297642] FORMAT: plain > [1284801554.297661] FORMAT: memo I hardly use these, but I believe the file and plain formats are mostly used for backups. In case you're looking for examples: The barry-sync plugin uses the vformat formats (first choice). It actually goes to great lengths to create and parse these formats, using some of the vformat API copied from opensync itself. I would not recommend going this route, since you need to get deep into the RFC details sometimes, but if you get data from Akonadi in this format, then don't parse it yourself... pass it straight into opensync, and let opensync deal with it. The google-calendar uses the 3rd method, taking the -doc formats and using xslt to transform them into something that Google accepts. I'm no XML guru, so this has been a challenge at times too (mostly due to learning Google Calendar XML API on the fly.) Hope this helps, - Chris |