Sync plugins

= Types of plugins = There are three kinds of sync plugins 1. Client plugin 2. Server plugin 3. Storage plugin

1. The client plugins as the name indicates is the client side part of a synchronization activitiy. For example, synchronization with Google services from the device would involve a client plugin and Google services acting as a server. The client plugins would be loaded on demand and would be unloaded once the sync activity is over. More than one client plugin can be loaded at any point of time, provided that they deal with different kinds of storages (contacts, calendar, notes etc.)

2. The server plugins enable a server role for the synchronization. A server plugin acts as a server for an external client to connect to. An example of a server plugin is a SyncML sync between two devices. When sync happens between two devices, one of the device has to act as a server. The protocol would be responsible for deciding the roles between the two devices. Whenever a device acts as a server, the server plugin is responsible for handling the server side activities. A server plugin is not unloaded for ever, since any client can connect to it at any point of time

3. A storage plugin is one that enables synchronization of a particular storage for a sync session. For example, a contacts storage plugin will be loaded for the duration of the sync session, would perform the sync activities between the sync agent (protocol) and the database (like store/retrieve) and gets unloaed once the sync session is over.

= Creating a plugin =

The buteo-syncfw comes with a tools package to create template plugin code that will help the developer to quickly create plugins

The tool uses Cheetah (www.cheetahtemplate.org/‎) template library to generate the templates. One can install cheetah in Ubuntu using command: 'sudo apt-get install python-cheetah'. Python 2.7 or greater is required

Instructions for generating template
The configuration files corresponding to a client/server/storage have to be filled-in with the appropriate information. Each of the fields in the config files are marked with MANDATORY/OPTIONAL. Info about the fields is provided in the config files

To generate client plugin, run the command: ./gen_template.py -c client-plugin.cfg -d

To generate server plugin, run the command: ./gen_template.py -c server-plugin.cfg -d

To generate storage plugin, run the command: ./gen_template.py -c storage-plugin.cfg -d