Calendar SyncML
Finally! After many long hours OpenPSA Calendar supports SyncML using the Horde SyncML library (which for now only supports version 1.0 of the protocol) for connection handling
To test this go and grab latest CVS version of OpenPSA (no package yet, there have been lot's of changes to the calendar core which means things might not be as robust as usual) and import all the repligard packages for different point applications
Then to the actual setup
- Get Horde Framework (latest version), install somewhere on your system, it's not neccessary to actually expose Horde to web or even configure it (however you do have to have the Horde configuration files available for it to work so go to /config under your Horde installation directory and run command: for f in *.dist; do cp $f `basename $f .dist`; done
- Create file /etc/midgard/org_openpsa_calendar.conf, in it put something along the lines of (it's include():d by the Calendar core init):
<?php //Path to a horde installation $nemeinCalendar['Horde_Path']='/usr/src/horde-3.0.4'; //Horde Datatree configuration (even if there's a working horde installation we should use our own datatree for syncml) $nemeinCalendar['Horde_Conf']['datatree']['params']['phptype'] = 'mysql'; $nemeinCalendar['Horde_Conf']['datatree']['params']['persistent'] = false; $nemeinCalendar['Horde_Conf']['datatree']['params']['protocol'] = 'unix'; $nemeinCalendar['Horde_Conf']['datatree']['params']['hostspec'] = 'localhost'; $nemeinCalendar['Horde_Conf']['datatree']['params']['username'] = 'horde'; $nemeinCalendar['Horde_Conf']['datatree']['params']['password'] = 'somepassword'; $nemeinCalendar['Horde_Conf']['datatree']['params']['database'] = 'horde_datatree'; $nemeinCalendar['Horde_Conf']['datatree']['params']['table'] = 'horde_datatree'; $nemeinCalendar['Horde_Conf']['datatree']['params']['charset'] = 'iso-8859-1'; $nemeinCalendar['Horde_Conf']['datatree']['params']['driverconfig'] = 'custom'; $nemeinCalendar['Horde_Conf']['datatree']['driver'] = 'sql'; ?>
I recommend creating a separate database for the DataTree, but you can use the Midgard database as well. - From under your Horde installation find /scripts/sql/horde_datatree.sql and import it to initialize the tables for your DataTree database.
- For debugging create /tmp/sync/ and set owner to apache user
- Extract the Horde_SyncML_FS.tar.gz file from OpenPSA CVS under your Horde directory (it's a wrapper Horde "application" which loads the things we need from Midgard)
- Install libwbxml2 (some clients only support WBXML [it saves bandwidth]), the PEAR::XML_WBXML module works better with it.
- Create a new event in the web interface just to see that I have not forgotten anything that might be a dependency of Horde
- Run the following scrip in OpenPSA Manager
<?php mgd_auth_midgard('SGAdmin+SGName','password',0); $midgard=mgd_get_midgard(); mgd_include_snippet('/NemeinCalendar/Version 2.0/Core/init'); $lst=mgd_list_events(__NNC_ROOTEVENT); if ($lst) { while ($lst->fetch()) { $ev=new nemeincalendar_event($lst->id); $ret=$ev->_rebuild_horde_history(); echo "$ev->title rebuilt returned: $ret<br>\n"; } } ?>If there are errors (propably due to missing dependencies) resolve them and run the script again - Point your SyncML client to http://yourserver.example.com[/prefix]/SyncML/something.php
- In case of trouble look at /tmp/ there are some logfiles which should shed some light on the issue (note some handsets require SyncML version 1.1, which the Horde library doesn't support yet)
Caveats
These apply to the 3.0.4 stable version of Horde, the CVS version might or might not have changed the issue (as well as the API, so while I encourage everyone to play around with this and report their findings don't expect me to have time to fix anything in my end)
The protocol version issue mentioned above, also since the sync is geared towards personal calendars (as opposed to "true" group calendars) there are things to remember: removing a participant from an event will flag a delete of the event for the participant, if this delete is synchronized to the handset and participant is later re-added to the event the synch log will be confused (as expected the event will be re-imported to handset but handset vs server UID map will be incorrect causing issues with further changes to the event), this probably could be fixed at library level but right now I don't have time to look at it, I'll need to finish the OpenPSA 2.0 stuff in this month.
Update
In Horde CVS there seems to be plenty of new code, I haven't had time to look at these in more details but it looks interesting.