local sync: renamed "source-config" to "target-config"
As discussed on the mailing list, "source-config" is ambiguous because the "addressbook/calendar/..." configs are also called "source configs". Now the naming is "sync" config (for the config with syncURL=local://, because it is used for syncing) and "target" config (because it is used as target in a sync config's syncURL). Rejected: "local" config - because the databases are not necessarily local "source" config - see above "client" or "server" config - because both sides might use local data and/or client/server could refer to the role of the peer or the SyncML client/server model used internally
This commit is contained in:
parent
34e6667e14
commit
8032247a5a
|
@ -178,7 +178,7 @@ bool ButeoBridge::init()
|
|||
}
|
||||
|
||||
// configure local sync of calendar with CalDAV and/or CardDAV
|
||||
std::string config = StringPrintf("source-config@%s", m_config.c_str());
|
||||
std::string config = StringPrintf("target-config@%s", m_config.c_str());
|
||||
if (!SyncConfig(config).exists()) {
|
||||
Cmdline target(std::cout, std::cerr,
|
||||
"buteo-sync",
|
||||
|
|
|
@ -12,7 +12,7 @@ The approach will be something like this:
|
|||
* define "Google Calendar" service using it
|
||||
* configure it in sync UI
|
||||
* during sync, create or update "google@default" local sync
|
||||
config, with "source-config@google" for remote CalDAV access
|
||||
config, with "target-config@google" for remote CalDAV access
|
||||
|
||||
Because of the limited applicability of the plugin, hard-coding
|
||||
specific services is okay.
|
||||
|
|
|
@ -45,7 +45,7 @@ They also use:
|
|||
>= 11: plaintext HTTP authentication
|
||||
|
||||
The recommended way of using the CalDAV and CardDAV backends is to
|
||||
configure a context with the "source-config" peer inside it. Such a
|
||||
configure a context with the "target-config" peer inside it. Such a
|
||||
context then can be used as part of a local sync with other
|
||||
sources. See the Google section below for examples.
|
||||
|
||||
|
@ -115,13 +115,13 @@ syncevolution --configure \
|
|||
username=<your account> \
|
||||
password=<your password> \
|
||||
consumerReady=0 \
|
||||
source-config@google calendar
|
||||
target-config@google calendar
|
||||
|
||||
# list events in the server
|
||||
syncevolution --print-items source-config@google calendar
|
||||
syncevolution --print-items target-config@google calendar
|
||||
|
||||
# show the content of these events on stdout
|
||||
syncevolution --export - source-config@google calendar
|
||||
syncevolution --export - target-config@google calendar
|
||||
|
||||
# set up synchronization, using "google-calendar" as peer name
|
||||
# because "google" is typically used for the SyncML-based
|
||||
|
@ -177,11 +177,11 @@ syncevolution --configure \
|
|||
username=<your account@yahoo.com or some other yahoo domain> \
|
||||
password=<your password> \
|
||||
consumerReady=0 \
|
||||
source-config@yahoo addressbook calendar
|
||||
target-config@yahoo addressbook calendar
|
||||
|
||||
# list items, use "--export -" to see content
|
||||
syncevolution --print-items source-config@yahoo calendar
|
||||
syncevolution --print-items source-config@yahoo addressbook
|
||||
syncevolution --print-items target-config@yahoo calendar
|
||||
syncevolution --print-items target-config@yahoo addressbook
|
||||
|
||||
# configure synchronization, with addressbook not enabled
|
||||
syncevolution --configure \
|
||||
|
@ -207,7 +207,7 @@ SYNCEVOLUTION_DEBUG=1 syncevolution --daemon=no loglevel=4 --print-items @google
|
|||
|
||||
Each sync produces two log files, one for the main config
|
||||
("google-calendar"), one for the target config
|
||||
("source-config@google"). It is possible to choose different log levels:
|
||||
("target-config@google"). It is possible to choose different log levels:
|
||||
|
||||
syncevolution --run \
|
||||
loglevel=1 \
|
||||
|
@ -311,7 +311,7 @@ cover importing/exporting of items and change tracking.
|
|||
client-test needs to be told in the CLIENT_TEST_WEBDAV env variable
|
||||
which CalDAV or CardDAV servers are available and the sync properties
|
||||
for them. It then creates a suitable
|
||||
"source-config@client-test-<server>" config with "caldav" and/or
|
||||
"target-config@client-test-<server>" config with "caldav" and/or
|
||||
"carddav" sources. Sync properties can be specified; if not given, the
|
||||
relevant ones must be set inside that config already.
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace {
|
|||
|
||||
/**
|
||||
* implements one specific source for local testing;
|
||||
* creates "source-config@client-test-<server>" peer config
|
||||
* creates "target-config@client-test-<server>" peer config
|
||||
* and <type> source inside it before instantiating the
|
||||
* source
|
||||
*/
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
|
||||
TestingSyncSource *createSource(bool isSourceA) const
|
||||
{
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig(string("source-config@client-test-") + m_server));
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig(string("target-config@client-test-") + m_server));
|
||||
SyncSourceNodes nodes = context->getSyncSourceNodes(m_type,
|
||||
/* string("_") m_clientID + */
|
||||
string("_") + (isSourceA ? "A" : "B"));
|
||||
|
|
|
@ -490,7 +490,7 @@ private:
|
|||
/** called internally in this class */
|
||||
TestingSyncSource *createNamedSource(const string &name, bool isSourceA) {
|
||||
string database = getDatabaseName(name);
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("source-config@client-test"));
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("target-config@client-test"));
|
||||
SyncSourceNodes nodes = context->getSyncSourceNodes(name,
|
||||
string("_") + m_clientID +
|
||||
"_" + (isSourceA ? "A" : "B"));
|
||||
|
|
|
@ -864,7 +864,7 @@ bool Cmdline::run() {
|
|||
configTemplate =
|
||||
peer = "SyncEvolution";
|
||||
from = SyncConfig::createPeerTemplate(peer);
|
||||
} else if (peer == "source-config") {
|
||||
} else if (peer == "target-config") {
|
||||
// Configuring the source context for local sync
|
||||
// => determine template based on context name.
|
||||
configTemplate = context;
|
||||
|
@ -2678,7 +2678,7 @@ protected:
|
|||
" template name = template description\n"
|
||||
" eGroupware = http://www.egroupware.org\n"
|
||||
" Funambol = http://my.funambol.com\n"
|
||||
" Google_Calendar = event sync via CalDAV, use for the 'source-config@google-calendar' config\n"
|
||||
" Google_Calendar = event sync via CalDAV, use for the 'target-config@google-calendar' config\n"
|
||||
" Google_Contacts = contact sync via SyncML, see http://www.google.com/support/mobile/bin/topic.py?topic=22181\n"
|
||||
" Goosync = http://www.goosync.com/\n"
|
||||
" Memotoo = http://www.memotoo.com\n"
|
||||
|
@ -2688,7 +2688,7 @@ protected:
|
|||
" ScheduleWorld = server no longer in operation\n"
|
||||
" SyncEvolution = http://www.syncevolution.org\n"
|
||||
" Synthesis = http://www.synthesis.ch\n"
|
||||
" Yahoo = contact and event sync using WebDAV, use for the 'source-config@yahoo' config\n",
|
||||
" Yahoo = contact and event sync using WebDAV, use for the 'target-config@yahoo' config\n",
|
||||
help.m_out.str());
|
||||
CPPUNIT_ASSERT_EQUAL_DIFF("", help.m_err.str());
|
||||
}
|
||||
|
@ -3110,12 +3110,12 @@ protected:
|
|||
{
|
||||
TestCmdline cmdline("--configure",
|
||||
"--template", "yahoo",
|
||||
"source-config@my-yahoo",
|
||||
"target-config@my-yahoo",
|
||||
NULL);
|
||||
cmdline.doit();
|
||||
}
|
||||
{
|
||||
TestCmdline cmdline("--print-config", "source-config@my-yahoo", NULL);
|
||||
TestCmdline cmdline("--print-config", "target-config@my-yahoo", NULL);
|
||||
cmdline.doit();
|
||||
CPPUNIT_ASSERT_EQUAL_DIFF(yahoo,
|
||||
removeComments(filterRandomUUID(filterConfig(cmdline.m_out.str()))));
|
||||
|
@ -3124,12 +3124,12 @@ protected:
|
|||
// configure Google Calendar with template derived from config name
|
||||
{
|
||||
TestCmdline cmdline("--configure",
|
||||
"source-config@google-calendar",
|
||||
"target-config@google-calendar",
|
||||
NULL);
|
||||
cmdline.doit();
|
||||
}
|
||||
{
|
||||
TestCmdline cmdline("--print-config", "source-config@google-calendar", NULL);
|
||||
TestCmdline cmdline("--print-config", "target-config@google-calendar", NULL);
|
||||
cmdline.doit();
|
||||
CPPUNIT_ASSERT_EQUAL_DIFF(googlecaldav,
|
||||
removeComments(filterRandomUUID(filterConfig(cmdline.m_out.str()))));
|
||||
|
@ -3139,7 +3139,7 @@ protected:
|
|||
{
|
||||
TestCmdline cmdline("--configure",
|
||||
"--template", "yahooxyz",
|
||||
"source-config@my-yahoo-xyz",
|
||||
"target-config@my-yahoo-xyz",
|
||||
NULL);
|
||||
CPPUNIT_ASSERT(cmdline.m_cmdline->parse());
|
||||
CPPUNIT_ASSERT(!cmdline.m_cmdline->run());
|
||||
|
@ -3149,7 +3149,7 @@ protected:
|
|||
}
|
||||
{
|
||||
TestCmdline cmdline("--configure",
|
||||
"source-config@foobar",
|
||||
"target-config@foobar",
|
||||
NULL);
|
||||
CPPUNIT_ASSERT(cmdline.m_cmdline->parse());
|
||||
CPPUNIT_ASSERT(!cmdline.m_cmdline->run());
|
||||
|
|
|
@ -91,13 +91,13 @@ void LocalTransportAgent::start()
|
|||
}
|
||||
|
||||
// initialize target client so that we can check passwords in the calling process
|
||||
boost::shared_ptr<SyncContext> client(new SyncContext(std::string("source-config") + m_clientContext,
|
||||
boost::shared_ptr<SyncContext> client(new SyncContext(std::string("target-config") + m_clientContext,
|
||||
m_server->getConfigName(),
|
||||
m_server->getRootPath() + "/." + m_clientContext,
|
||||
boost::shared_ptr<TransportAgent>(this, NoopAgentDestructor()),
|
||||
m_server->getDoLogging()));
|
||||
|
||||
// allow proceeding with sync even if no "source-config" was created,
|
||||
// allow proceeding with sync even if no "target-config" was created,
|
||||
// because information about username/password (for WebDAV) or the
|
||||
// sources (for file backends) might be enough
|
||||
client->setConfigNeeded(false);
|
||||
|
@ -113,7 +113,7 @@ void LocalTransportAgent::start()
|
|||
// Copy non-empty credentials from main config, because
|
||||
// that is where the GUI knows how to store them. A better
|
||||
// solution would be to require that credentials are in the
|
||||
// "source-config" config.
|
||||
// "target-config" config.
|
||||
string tmp = m_server->getSyncUsername();
|
||||
if (!tmp.empty()) {
|
||||
client->setSyncUsername(tmp, true);
|
||||
|
|
|
@ -1327,7 +1327,7 @@ static BoolConfigProperty syncPropConsumerReady("ConsumerReady",
|
|||
|
||||
/**
|
||||
* Some guidelines for peerType = WebDAV:
|
||||
* - Such templates may only be used to create the 'source-config@<target>.
|
||||
* - Such templates may only be used to create the 'target-config@<target>.
|
||||
* configurations. Typically <target> can be the same as the template's
|
||||
* name.
|
||||
* - Because determining the default database in WebDAV can be difficult,
|
||||
|
|
|
@ -371,7 +371,7 @@ SyncSource *SyncSource::createSource(const SyncSourceParams ¶ms, bool error,
|
|||
SyncSource *SyncSource::createTestingSource(const string &name, const string &type, bool error,
|
||||
const char *prefix)
|
||||
{
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("source-config@client-test"));
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("target-config@client-test"));
|
||||
SyncSourceNodes nodes = context->getSyncSourceNodes(name);
|
||||
SyncSourceParams params(name, nodes, context);
|
||||
PersistentSyncSourceConfig sourceconfig(name, nodes);
|
||||
|
|
|
@ -48,9 +48,9 @@ struct SyncSourceParams {
|
|||
* @param context Additional non-source config settings.
|
||||
* When running as part of a normal sync, these are the
|
||||
* settings for the peer. When running in a local sync,
|
||||
* these settings come from the "source-config" peer
|
||||
* these settings come from the "target-config" peer
|
||||
* config inside the config context of the source.
|
||||
* Testing uses "source-config@client-test". On the
|
||||
* Testing uses "target-config@client-test". On the
|
||||
* command line, this is the config chosen by the
|
||||
* user, which may or may not have peer-specific settings!
|
||||
* @param contextName optional name of context in which the source is defined,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
=== template.ini ===
|
||||
fingerprint = Google Calendar
|
||||
description = event sync via CalDAV, use for the 'source-config@google-calendar' config
|
||||
description = event sync via CalDAV, use for the 'target-config@google-calendar' config
|
||||
|
||||
=== config.ini ===
|
||||
consumerReady = 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
=== template.ini ===
|
||||
fingerprint = Yahoo
|
||||
description = contact and event sync using WebDAV, use for the 'source-config@yahoo' config
|
||||
description = contact and event sync using WebDAV, use for the 'target-config@yahoo' config
|
||||
|
||||
=== config.ini ===
|
||||
consumerReady = 1
|
||||
|
|
|
@ -2461,7 +2461,7 @@ class TestLocalSync(unittest.TestCase, DBusUtil):
|
|||
def setUp(self):
|
||||
self.setUpServer()
|
||||
# create file<->file configs
|
||||
self.setUpSession("source-config@client")
|
||||
self.setUpSession("target-config@client")
|
||||
self.session.SetConfig(False, False,
|
||||
{"" : { "loglevel": "4" },
|
||||
"source/addressbook": { "sync": "two-way",
|
||||
|
|
Loading…
Reference in New Issue