tine20 / tine20

Tine 2.0 main repository
GNU Affero General Public License v3.0
156 stars 60 forks source link

0011006: CardDav update support for gnome evolution contacts #5447

Open Gloirin opened 6 years ago

Gloirin commented 6 years ago

Reported by nothere on 3 May 2015 14:46

Version: Koriander (2014.09.10)

What files i do have to change, create and update to add full support for Gnome Evoulution addressbooks including updating contacts to tine20 (like done for emclient under issue 0006360). Or what files would you need to create corresponding patches as done for emclient?

Gloirin commented 6 years ago

Comment posted by ingoratsdorf on 3 May 2015 21:22

You have to create a converter and add the converter to the factory:

copy any converter from tine20/Addressbook/Convert/Contact/VCard/(Sogo|KDE|IOS|...).php

and modify to suit, call it the file ie. Evolution.php chnage its converter class name to end with Evolution and add the Evolution Converter class to the Factory file

tine20/Addressbook/Convert/Contact/VCard/Factory.php

TEST IT THOROUGHLY. You may loose the odd data or not. Have backups of your contacts.

Once you are 100% sure it's working, submit the converter class so we can add it.

I have written a similar thing for Android CardDAV-Sync, still testing.

Gloirin commented 6 years ago

Comment posted by nothere on 3 Jan 2016 21:39

Ok i managed to add converters for Contacts, Tasks and calendar.

For Contacts i missed to first generate a copy of the whole directory to be able to do proper patch files. I for now added a zip file containing the modified fields. If you could send me the original ones for Elena (2015.07.7) I can generate the proper patch file.

For the Address book i had alos to modify the Abstract.php file to be able to map some Evolution fields which use Evolution specific WebDAV fields to their counterpart used by Tine20. For this i introduced the _toTine20ModelParseOther function which is called by the default clause of the switch statement in the toTine20Model function. Per default it prints the debug output which was previously directly generated by the default clause. When overloaded in the client specific php file it can be used to further extend the switch statement (see Evolution.php)

I do get a zend error about string exceeding field length for the Task converter (see error log included in Evolution_DAV_Fields).

The Evolution_DAV_Fields file include the list of fields reported by Evolution (the ones corresponding to fields supported by tine20 are prefixed by +)

Evolution would allow to add Attachments to Calendar and Tasks but i have no clue how to get them into tine20 even though tine supports at least in the GUI Attachments.

Gloirin commented 6 years ago

Comment posted by pschuele on 4 Jan 2016 16:20

hi nothere,

thanks for the patch, i already had a quick look at it :)

> I do get a zend error about string exceeding field length for the Task converter > (see error log included in Evolution_DAV_Fields).

that is quite strange. i see that the id is very long ("20160103T202744Z-13410-1000-5369-226_Starship2-20160103T205259Z") but I'm not sure where the id is created. it looks like that a datetime string ("20160103T205259Z") is appended to the uid ("20160103T202744Z-13410-1000-5369-226_Starship2"). this needs some debugging, i guess.

> Evolution would allow to add Attachments to Calendar and Tasks but i have no > clue how to get them into tine20 even though tine supports at least in the GUI > Attachments.

to allow attachments, you might have a look at the attachments implementation in the calendar converter (Calendar_Convert_Event_VCalendar_Abstract, search for "ATTACH"). maybe there is only a small part missing to make this work. perhaps the code just needs to be moved to the parent class (Tinebase_Convert_VCalendar_Abstract).

Gloirin commented 6 years ago

Comment posted by pschuele on 4 Jan 2016 16:21

ah and one more thing: maybe you would like to use github and open a pull request there (fork our repo first: https://github.com/tine20/Tine-2.0-Open-Source-Groupware-and-CRM). it's much easier to look at the code there.

Gloirin commented 6 years ago

Comment posted by nothere on 4 Jan 2016 22:19

The down thing is i currently do not have a dedicated development system, which is not the optimal situation i know, working on production, but no other coice for now.

Concerning the extra timestamp it seems it is allready inside httprequest, that is the requrest uri before beeing parsed

/calendars/9ca99da90b5ea5f4278475913166d35b79569060/8/20160103T202744Z-13410-1000-5369-226_Starship2-20160104T220844Z.ics

As you can see the extra timestamp after Starship2 is already there. Seems as if Evoulution is encoding the creation time modification time there CREATED LAST-MODIFIED show the same time stamp value

BEGIN:VCALENDAR^M CALSCALE:GREGORIAN^M PRODID:-//Ximian//NONSGML Evolution Calendar//EN^M VERSION:2.0^M BEGIN:VTODO^M UID:20160103T202744Z-13410-1000-5369-226@Starship2^M DTSTAMP:20160103T151214Z^M SUMMARY:test task to share with tine again and again^M DUE;VALUE=DATE:20160217^M DTSTART;VALUE=DATE:20160106^M CLASS:PUBLIC^M PERCENT-COMPLETE:30^M STATUS:IN-PROCESS^M PRIORITY:5^M URL:http://www.out-world.com^M SEQUENCE:35^M CREATED:20160104T220844Z^M LAST-MODIFIED:20160104T220844Z^M DESCRIPTION:test for implementing first tine20 evolutioin importer\n^M END:VTODO^M END:VCALENDAR^M

aa5b7 christoph - 2016-01-04T22:08:45+00:00 ERR (3): Tasks_Frontend_WebDAV_Task::create::126 Array ( [container_id] => 8 [last_modified_time] => [seq] => 1 [id] => 20160103T202744Z-13410-1000-5369-226_Starship2-20160104T220844Z [percent] => 30 [completed] => [due] => 2016-02-16 23:00:00 [class] => PUBLIC [description] => test for implementing first tine20 evolutioin importer

[organizer] => ace0fc1a480597c3fd0c629664f0edd80f9a2af3
[originator_tz] => Europe/Berlin
[priority] => NORMAL
[status] => IN-PROCESS
[summary] => test task to share with tine again and again
[uid] => 20160103T202744Z-13410-1000-5369-226@Starship2
[dtstart] => 2016-01-05 22:59:59
[alarms] => Array
    (
    )

[created_by] => ace0fc1a480597c3fd0c629664f0edd80f9a2af3
[creation_time] => 2016-01-04 22:08:45
[last_modified_by] =>
[is_deleted] => 0
[deleted_time] =>
[deleted_by] =>

)

So one would have to strip that timestamp or come up with a proper solution to to convert to tine20 request uri

So far for today

Gloirin commented 6 years ago

Comment posted by nothere on 27 May 2017 12:19

Update, currently working on committing gnome evolutioin support on git. The tasks would be the last patch to add, for now. And i came across the issue about the id again. See request #0011010. Any hint where to best fix and/or workarround the issue would be helpful to be able finish the support for gnome Evolution (at leleast version 3.10.04)

Gloirin commented 6 years ago

Comment posted by nothere on 12 Jun 2017 20:46

Finally managed to test also with Evolution 10.18.5.2 Ubuntu 16.04. Besides some minor fixes everything worked properly. Plenty of fields Evoltuion supports still not existent in tine20 Database and model therefore not convertable.

Attach another example of VCARD to view all the provided fields.

But for now this requrest/bug can be closed (imho).

The only thing is missing is merging of evolution-bindings branch with head after tasks and calendars have been tested and verified with newer version of gnome evolution too