[sync] Major update to SyncML module. Including Outlook support
Karsten Fourmont
fourmont at gmx.de
Sun Apr 24 05:15:08 PDT 2005
Hello everybody,
I just posted a major update to the SyncML framework. In cvs right now,
in cvs tarball as of tomorrow.
Almost everything has changed; here are the highlights:
- implementation is way more generic, should support more devices now
due to usage of the DevInf information
- even when a device does not working, adding support is now more easy
because decvice dependant behaviour is encapsulated in one class.
Support for other devices can be added by creating a new sublcass in
the Device directory without the risk to break support for existing
devices.
- By this mechanism Horde_SyncML now supports the sync4j outlook
connector available from www.sync4j.org
So now Horde can sync contacts, events, notes and tasks with Microsoft
Outlook!
Some details:
Quite a few useless classes are gone, a few (hopefully useful) ones are new:
- Backend.php The SnycmlBackend_Horde backend class encapsulates all
the stuff where actual communication with the horde backend is
involved.
This includes importing/exporting of data, retrival of changes and
providing the map between client and server UIDs. Theoretically it
would be possible to sync with another backend than horde by
replacing this class. I've got no intention to do so, it's only
for clearness of
design.
- DeviceInfo.php The classes therein represent the DevInf information
sent from the client. They are created by put.php as a result of a
put command and then stored in state.php as an attribute to the
session var.
- Device.php: here's were were device dependant conversions take
place.
Device.php provides a base class with a default implementation.
For individiual devices there are subclasses in the Device
subdirectory.
The factory method decides which class to instantiate. based on the
SourceURI and DevInf information from the client,
So to add specific behaviour for a new device, copy
device_template.php to device_mydevice.php, rename the class and
make the desired modifications. Then make the new class known to
the factory method in device.php so it instantiates it when syncing
with your device.
By that design support for individual devices can be added without
breaking it for already supported devices. Probably the biggest
advantage of the whole redesign.
- log.txt a new log file is created in /tmp/sync/log.txt. This
contains information about the icalendar/vcard data exchanged
between client and server.
Useful for checking individual data fields.
Note that /tmp/sync must be writeable for the webserver for the
logfiles to appear. (chown wwwrun /tmp/sync)
Currently there are three device dependant classes in the Device
directory:
- P800.php for syncing with P800/P900/P910. This class is basically
empty as the default Device implementation already handles most
of the P800 stuff.
- Sync4.php. sync4j (www.syn4j.org) uses a proprietery non
icalendar-format for data exchange. So here the device class
converts sync4j's sif format from and to icalendar/vcard.
- Template.php: a template to start implementing your own device
dependant behaviour. The class must be made known to the factory
method in Device.php.
The overall design has been worked on: this is not completly finished
but I hope the code now looks somewhat less repelling than it used to...
It took quite a few efforts to make the protocol part work with P800 and
sync4j at the same time. But I hope the result is an implementation that
is able to sync with a far greater variety of devices than before.
So give it a try, I'm curious about any feedback. It would be especially
nice if people with other devices than the ones I own could test it and
report the results.
Quick starter how to configure your device:
- url is http(s)://pathtoyourhordeinstall/rpc.php
- user/pasword: your horde account data
- databases (sometimes called remote settings) must be calendar, tasks,
notes, or contacts.
- for debug output create dir /tmp/sync and make it writeable by
webserver
- set loglevel to PEAR_LOG_DEBUG in Horde Setup/Logging. It may be
helpful to view the logs as follows:
tail -f /yourhorde.log | grep "SyncML:"
- for sync4j outlook syncing, use at least SyncClient PIM Outlook
version 1.3.9 available from sync4j.org (v 2.2).
Device ID must be sc-pim-outlook or anything containing sync4j so
the horde backend can identify the connector.
Enjoy!
Karsten
More information about the sync
mailing list