The README.rst now introduces some terms in a glossary directly after
the synopsis. The way how config, sources and properties are used on
the command line are also defined first in their own section, instead
of introducing that further down as part of the options.
The output of "--sync/source-property ?" was changed:
- now it includes information about aliases, default values
and sharing state (useful by itself)
- follows reStructured Text format and thus can be embedded
directly inside the README.rst
The Makefile rules for that will be committed in the next patch
(must be done differently on syncevolution-1-2 and master branch,
whereas this commit applies cleanly to both).
The previous commit 7411f7e had the password check in the code branch
for --print-items. --import/export/delete-items still had the same
problem. Moved the code.
Source passwords must also be checked, in case that "backendPassword"
is set. Added.
When (auto-)migrating a config, it was possible that a name for the
peer, say foo.old, was chosen for the renamed config although there
was already such a config, for example foo.old in ~/.sync4j. Besides
being confusing for users, this also led to a bug in the code where it
copied from the older config with the foo.old name.
Found when adding unit testing of migrating configs with auto syncing,
because then the content of the migrated config mattered.
The main problem fixed in this commit is the disabling of auto syncing
in the old config. Done similar to ConsumerRead, by reading/writing
the .ini (resp. .txt) file directly.
Use checkPassword() before trying to --print-items. This will either
prompt for the password at command line, or ask it from the keyring
if --keyring is specified (or if using the dbus server).
Most of the selected theme icons don't exist, so adding these values
only provides the possibility to add icons later on.
For Google Contacts, the existing gmail icon is used as a short-term
solution until the theme gets a proper google-contacts icon.
In contrast to the Yahoo template, this one doesn't mention
a specific service and enables both contact and calendar sync.
To be used with a service that supports auto-discovery.
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
The Funambol template hadn't been updated and the command line
tests failed because the didn't expect the PeerName to be set.
The normalization of "= F" to "= 0" broke the "= Funambol" peer name.
Doesn't seem to server any useful purpose anymore, so removed.
Each sync involving WebDAV did a complete data dump (dumpData) and
showed differences (printChanges) for the WebDAV side of the sync.
This could be used to restore the WebDAV server after a sync, but it
seems a bit excessive and not useful for most users because the same
is also done on the local side of the sync.
Therefore this patch sets these two options to off in the
configuration templates.
This patch teaches the command line how to infer the right template
for a source-config@<something> config creation:
syncevolution --configure source-config@google-calendar
For this particular example, "google-calendar" must match the "Google
Calendar" fingerprint in the template. Spaces, hyphen and underscores
are now all considered equal in TemplateConfig::fingerprintMatch().
Also added CmdlineTest::testWebDAV unit test. The test can only run if
WebDAV support is enabled, because otherwise the
backend=CardDAV/CalDAV would be rejected.
This patch introduces the new "peerType" property which marks
templates and configs as something that can be used for the
'source-config@<target>' configs necessary for local sync.
Only "WebDAV" is used. If peerType is not set, the template or config
is traditional SyncML.
This patch also adds two templates, one for Google Calendar and one
for Yahoo CardDAV and CalDAV. Because Yahoo CardDAV is unreliable,
it is not enabled.
The code for builtin templates had side effects, like always adding
all four standard sources to a template, even if the template itself
didn't have all of them defined. It also hid the problem that listing
templates didn't work for templates on disk.
Another benefit is that template files can be packaged separately. By
choosing the packages which are to be installed, a distributor of
SyncEvolution (like MeeGo) can choose which services to offer by
default.
Therefore this patch removes the "builtin templates" feature, which
was only useful in unusual use cases anyway (for example, single-binary
distribution).
Because there are no more default values for source properties, all
templates must specify the "backend" explicitly. syncevo-phone-config
was adapted accordingly, and also updated to use the current names of
the properties in the process.
As part of moving the templates into separate files, some of them
were cleaned up:
- Mobical: now points to Everdroid, its new name
- Google, Ovi: SSL verification is always enabled in the templates;
the workaround for old libsoup should no longer be
necessary for most users
- Google: renamed to "Google_Contacts", with "Google" as alias,
because there will be two Google templates soon
- Scheduleworld: use "server no longer in operation" instead of
an invalid URL
The finger print match had a special case for "default". The exact
intention of that is unknown. Perhaps it was meant to give that
template a boost when it wouldn't match the string that is getting
searched for at all.
But it had the effect that an exact match when searching for the
"default" template was not found and thus that template couldn't be
used in the command line after moving it from builtin to external.
Removed the complete check.
Better check error message before return code. That way
a non-zero error is visible in the output instead of
only the failed run check.
Calling doit() would be shorter, but hide the actual location
of the failure.
Moved removal and creation of the test directory (= "CmdlineTest")
into the test setup method. That way all tests are guaranteed to
start in a clean state, without having to duplicate that all over
the place.
Motivated by the observation that at least one test didn't have the
necessary cleanup, which caused a failure when creating more
templates.
"syncevolution --templates ?" only showed builtin templates
because the scanning for template on disk was called without
any match definition => empty results, only builtin templates
used as fallback.
The distinction between vcard21 and vcard30 became mute in the Evolution
backend a while ago. Both tests ended up using the vCard 3.0 Evolution
tests data and the default uri for each server. This patch removes
the vCard 2.1 special case.
It also renames the tests and test data to reflect that they always
were Evolution specific. The new naming convention, also applied
to file, QtContacts, KCalExtended, XMLRPC, Maemo and Akonadi backends, is
now <backend>_contact/event/task/memo, with eds/file/qt/kcal/maemo/kde
as backend names.
The reasoning is:
- results in unique string (in particular no overlap with
backend type names), easier to search for
- underscore already used before (in contrast to hyphen)
- no plural-s to keep the name shorter
The Akonadi backend should be using its own test data instead of
the Evolution ones.
Specifying an invalid template name continued with an empty template
if enough properties were specified. That's not correct and leads
to unexpected results:
- peerIsClient might have been part of the desired template.
- Set of sources to be created is defined by template.
Now an error is printed for this case.
The device templates contained spaces ("Nokia N900", for example),
which was hard to use on the command line and in scripts. Now
an underscore is used instead of spaces.
This is a better fix for the webDAVCredentialsOkay property
registration: always do it, regardless whether the backend is enabled,
because then the config migration code will always know about it.
Also fixed automated testing to include that property.
The command line instantiated sources with the name "list" (cut-and-paste
error?) instead of using the proper name. As a result, error messages
created by these sources didn't refer back to the configuration. Now
the real name is used.
The intention always was that backends may add their own
properties. For sync properties this seemed less relevant,
so sources only got read access to it.
But the WebDAV backends run with their own "source-config" context
and now need read/write access to store information that is
shared between all sources.
Therefore this patch removes the "const" qualifier from SyncConfig.
The problem with eGroupware is that it doesn't have one fixed syncURL.
Users of the template must remember to change it. To make this more
obvious, it is set to http://set.your.domain.here/rpc.php
The failure to fix the URL is leading to fairly obvious network
errors.
Various people have reported success with eGroupware, the latest
one here: http://www.ruinelli.ch/how-to-sync-egroupware-with-a-tablet-n900-with-syncevolution
Therefore it makes sense to also mark this template as "consumerReady"
and have it shown in the sync UI.
Currently not enabled in compilation by default. If KWallet support is
enabled, it will check whether KDE is running and otherwise fall back
to GNOME keyring.
SyncEvolution used to insist on having a template when creating a
config from scratch. This was meant to address typos like "--configure
sheduleworld". But when the command line contains enough information,
no template is needed.
The same logic was applied to configuring a source: if a source was not
among those defined by the template, configuring it was rejected as a
typo.
With this patch, there are two ways around these checks:
- --template none and/or
- specifying required properties on the command line
This patch also removes the special cases for "your SyncML server
account name/password". Username/password aren't always needed
(previous patch), nor are they always for a SyncML server anymore.
This patch fixes a problem that occured if:
* a peer was configured with a ifferently named template (--configure --template foo bar)
* and there was a config foo@xyz.
Then the nonsense error message "ERROR: template foo must not specify a context."
was printed (nonsense because "foo" does not specify a context) and the operation
failed.
The root cause was that SyncConfig::normalizeConfigString() expanded
the "foo" string to "foo@xyz" (desired when "foo" is a shorthand for
an existing config). This behavior now can be turned off with a
flag. The patch does that by replacing the bool parameter with a bit
field.
When SyncEvolution prefers vCard 3.0, additional properties like
NICKNAME work with Memotoo. This patch a) makes that the default
syncFormat in the Memotoo template and b) automatically sets it
in the "addressbook" source of all migrated configs which sync
with Memotoo (detected based on the syncURL).
The automatic config rewriting is possible because users upgrading
from the previous stable SyncEvolution release need to migrate their
configs anyway. Normally SyncEvolution does not modify configs like
this.
If the context "type" was wrong and only the peer "type" was right,
the old config was usable for syncing. It seems that the "Memotoo"
template created such broken configs. After migration, the wrong
backend was selected based on the context's broken "type", thus
breaking syncing.
This patch fixes that problem by overriding the context "type" with
the corresponding values from one peer which has the source enabled.
The rationale is that this peer used to work and should be kept
working.
There's still a chance that different peers had different backends
configured, which is neither checked nor detected at the moment.
After the removal of the "type" property, listing of sources broke
because the command kind code kept setting that to select a backend.
Fixed by parsing the type and setting "backend" and "databaseFormat"
instead.
Just saying "foo = bar" is enough now. --sync-property and
--source-property are still accepted, in case that "foo" ever becomes
ambiguous (not the case right now).
The meaning of "type" was horribly complex and had effects on the
backend and the peer. It was impossible to specify the sync format to
be used for a specific peer independently of the local backend and its
format, so adding a peer to a context broke the context configuration
(BMC #1023).
This is now fixed by splitting "type" into four independent properties:
- backend = plugin which interfaces with the data
- databaseFormat = data format used inside backend, only relevant for file backend
- syncFormat = data format preferred when talking to peer
- forceSyncFormat = disable format auto-negotiation, use preferred format
With that split, it is now possible to specify the format in which the
file backend stores items independently of the format in which they
are exchanged with the peer.
Old configurations with "type" can still be read. The values specified
inside it are transparently mapped to the new properties. Command line
and D-Bus API users will only see the new properties.
The command line tool still accepts "type" as an alias for the four new
properties. Using that has the same disadvantage as before: it will modify
the context even if only modifying the peer was intended.
The D-Bus API accepts only the new properties. Clients using "type"
must be adapted to the new property names. Clients not using that
continue to run unchanged.
Writing into the configuration requires a migration of the peer config
*and* the context in which it is defined. That is necessary because
the new semantic (independent database format) cannot be stored in the
old format. The migration is handled by rewriting first the context,
then all peers defined inside it.
Other user-visible changes:
- updated help texts
- the canonical "backend" value for the file backend is just "file"
instead of the long "Files in one directory", which is now an alias
(used to be the other way around); done because "type = file"
was expanded to the long name, which was a bit unexpected and showed
how unintuitive the long name is
Internal changes:
- getMimeVersion() is still present, although it hasn't been used
for a long time; FileSyncSource::getMimeVersion() now derives
the version from the supported Mime types, in case that the
function will be needed again in the future
- setSourceType() with string as argument was replaced with one
taking a SourceType instance; to emulate the old behavior if
desired, construct SourceType from an old-style string
- ConfigProperty methods need to be virtual so that derived classes
like SourceBackendConfigProperty can generate content at runtime
(a recent commit broke that feature)
- File templates were stripped down to the essential properties,
with "type" replaced by the per-peer "syncFormat". "type" would
still have been accepted (so it is not necessary to adapt
syncevo-phone-config right away), but has the original
disadvantage of modifying "backend" and "databaseFormat".
Because of the shared source property name changes
(evolutionsource/user/password -> database*), mixing old and new
configs inside the same context is not possible. Bumped
CONFIG_CONTEXT_MIN_VERSION and CONFIG_CONTEXT_CUR_VERSION to reflect
that and added the necessary code for migrating a context and all
peers inside it.
This is triggered by a) an automatic config migration in release mode
and b) an explicit --migrate of *any peer inside the context* or of
the context itself.
When creating a config from scratch, the command line source properties
applying to the default source set in the template were ignored. That's
because createFilters() needs to know about all active sources, otherwise
it won't create the filters for them.
When running a command line failed, an assertion was raised without
ever showing the error output of the failed command line. Now it is
included as message text in the CPPUNIT_ASSERT_MESSAGE() exception.
If --source-property was set while syncing, the intention was to only
apply (and thus potentially enable) the filter to active sources. If
no sources where specified on the command line, then the code looked
at the config to build that list.
That code must have been broken for a long time, because it had a ==
"disabled" check instead of != "disabled", thus enabling exactly the
wrong sources. Fixed.
Probably not relevant for old releases because it only applied to cases
where no source filter was set. That additional shortcut check was
removed when rewriting the property filters, so now it was found.
Now the @context or @peer@context suffix in sync and source properties
on the command line can be used to configure both sides of the sync
differently.
The new format of the property name in --sync-property is:
<name>[@<context>|@<peer>@<context>]
--source-property also allows a source name:
[<source>/]<name>[@<context>|@<peer>@<context>]
This allows to set source properties differently for different
sources in the same command line invocation. The @<context> or
@<peer>@<context> will be used to set properties differently for
main and target context in a local sync (not used yet).
The advantage of this grammar is that a string can be split purely based
on the syntax in PropertySpecifier::StringToPropSpec().
The patch itself is based on the idea of first collecting all of these
config property filters in a new case-insensitive hash structure,
FullProps in ConfigFilter.cpp/h, as part of parsing command line
parameters.
Then once specific filters for sync or sources are needed, they are
generated from FullProps by collecting all that apply, starting with
the ones with lowest priority and overwriting them with more important
(= more specific) ones. This also covers additional filters, like the
shared properties of the target context when printing a template.
Currently FullProps may contain arbitrary source and config
names. Typos are not detected, which is both hard to implement (which
names and configs are valid in the current invocation?) and also
forces users to be very specific (can't apply one set of filters to
different configs) - this is the same conflict of interest as in
"configure", which allows unknown --enable/disable parameters because
they might be relevant in a sub-configure script.
SyncConfig itself still only stores the filters which apply to it, not
the full set of overrides that the Cmdline has in its m_props. The
advantage is that the API remains the same (no change needed or done
in the syncevo-dbus-server). The disadvantage is that in a local
sync, no information is available about the properties applying to the
target context - probably needs to change.
This renames the legacy "evolutionsource/user/password" properties to
"database" and "databaseUser/Password". The justification is that
these properties are also used outside of the Evolution backends.
The change can be done now because the on-disk format has to be
changed anyway in a backward-incompatible way.
The CmdlineTest::testOldConfigure test covers reading an old-style
config.
The goal is to allow multiple names for properties. This will be used
to replace legacy names like "evolutionsource", but it could also be
used to allow abbreviations on the command line.
First the patch replaces the single ConfigProperty::m_name with a list
of names, of which the first one is the current name of the
property.
The name that is to be used depends on the node which is to be
manipulated: if it already has a property under an alias, that alias
is read and also written, so existing configuration continue to use
the old config name (avoids the problem of having to remove the old
name and insert the new one at the same spot in a .ini file). Old
configs continue to parse okay. Writing into node which has none of
the names set, as in migrating into a fresh config, uses the new
names.
Most of the patch deals with the removal of a single, unique name,
either by picking the name so that it matches a node, using the
default name or simply hard-coding a property name ("sync").
The command line accepts all aliases, then uses the main name for
overriding configuration options.
SyncConfig inherited "const char *" from the Funambol C++ API and some
other methods used the same approach for efficient access to plain
strings. However, this has the disadvantage that dynamically generated
strings cannot be returned. SyncConfig had to use an awkward
workaround with a local string cache.
This patch converts most of that code to a normal std::string return
value and removes the string cache.
Out-of-tree backends must be adapted, otherwise they won't compile.
SyncEvolution < 1.2 considered all existing configurations
user-visible in UIs, therefore the ConsumerReady flags was not always
set (done by sync-ui, not done by command line).
In order to keep such old configs visible even when the updated
sync-ui (and soon Genesis) check the flag, the syncevo-dbus-server
transparently adds the flag when it finds a config written by
SyncEvolution < 1.2.
The Cmdline.cpp migration code does the same when rewriting such and
old config for read/write use.