[SyncEvolution] Syncing with webdav in a different evolution database

Renato Filho renato.filho at canonical.com
Fri Feb 28 18:20:33 UTC 2014


Hi guys,

I wrote a small daemon that integrates syncevolution DBUS and online
accounts. Basically it listen for online account
creation/enable/removal and setup the sync configuration on
syncevolution.

This is working fine sync with default evolution address book, but I
want to create one addressbook for each account, right now I am using
eds api for that (I am not sure if syncevolution does that).

But the problem cames when configuring syncevolution to sync with
different database. I am not sure how to do that right now I am
creating the config in this way:

session = server.StartSessionWithFlags("onlineaccount-1". ["all-configs"])

//config target
config = session.getConfig("WebDAV", true);
config[""]["syncURL"] = "https://www.googleapis.com/.well-known/carddav"
config[""]["username"] = "uoa:1,google-carddav"
config[""]["consumerReady"] = "0"
config[""]["dumpData"] = "0"
config[""]["printChanges"] = "0"
config[""]["PeerName"] = "onlineaccount-1"
session.SetNamedConfig("target-config at onlineaccount-1")

//config sync
config = session->getConfig("SyncEvolution_Client", true)

// config server side
config[""]["syncURL"] = "local://@onlineaccount-1"
config[""]["username"] = ""
config[""]["password"] = ""
config[""]["dumpData"] = "0"
config[""]["printChanges"] = "0"

// remove unecessary sources
delete config["source/calendar"]
delete config["source/todo"]
delete config["source/memo"]

session.saveConfig("onlineaccount-1", config)
session.deatach()

// sync
session = server.StartSession("onlineaccount-1")
session.sync("", ("addressbook", "slow"))

This works fine but stores the contacts on default database in evolution.
I want to change that to store each account in a different database, I
tried several configurations changes but does not works.

I tried to set the sync config database like:

config["source/addressbook"]["backend"] = "addressbook"
config["source/addressbook"]["database"] = "logion at gmail.com"

but his cause the default source config
(.config/syncevolution/sources/addressbook.ini) to get update and does
not work for multiple accounts.

I tried add a new source on sync config but the source is not created.
Something like:

config["source/onlineaccount"]["backend"] = "addressbook"
config["source/onlineaccount"]["database"] = "logion at gmail.com"

I am really lost here. Looks like I need to create a source and link
that with my server database but I do not know how to do that with
dbus api.

Thanks
Renato
_______________________________________________
SyncEvolution mailing list
SyncEvolution at syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution



More information about the SyncEvolution mailing list