Commit graph

39 commits

Author SHA1 Message Date
Patrick Ohly
115137b8b4 templates: don't store username/password for SyncEvolution client
The client template is also used in cases where passwords are not
needed (local sync) and where passwords cannot be stored in a keyring
due to the missing syncURL/remoteDeviceID. Therefore don't set dummy
username/password values in the template.
2013-10-01 09:28:38 +02:00
Patrick Ohly
f418481057 WebDAV: improved --configure
Added INFO output about checking sources. This helps with WebDAV when
the server cannot be contacted (dead, misconfigured) because otherwise
there would be no indication at all why the --configure operation
seems to hang.

Here is some example output, including aborting:
$ syncevolution --configure --template webdav \
                syncURL=http://192.168.1.100:9000/ \
                username=foo password=bar retryDuration=2s \
                target-config@webdav-temp
[INFO] creating configuration target-config@webdav-temp
[INFO] addressbook: looking for databases...
[INFO] addressbook: no database to synchronize
[INFO] calendar: looking for databases...
[INFO] calendar: no database to synchronize
[INFO] memo: looking for databases...
[INFO] memo: no database to synchronize
[INFO] todo: looking for databases...
[INFO] todo: no database to synchronize

It timed out fairly quickly here because of the retryDuration=2s. That
also gets placed in the resulting config, which is probably not desired.

$ syncevolution --configure \
                --template webdav \
                syncURL=http://192.168.1.100:9000/ \
                username=foo password=bar \
                target-config@webdav-temp
[INFO] creating configuration target-config@webdav-temp
[INFO] addressbook: looking for databases...
^C[INFO] Asking to suspend...
[INFO] Press CTRL-C again quickly (within 2s) to stop immediately (can cause problems in the future!)
^C[INFO] Aborting immediately ...
[ERROR] error code from SyncEvolution aborted on behalf of user (local, status 20017): aborting as requested by user

It would be good to make the CTRL-C handling code aware that it can
abort immediately instead of doing the intermediate "asking to suspend"
step, which only makes sense for sync sessions.

Also added task and memo sources to the WebDAV template.

Both requires changes to the testing. Instead of updating the C++
CmdlineTest, the affected tests were removed and only the
corresponding Python tests were updated.
2012-06-20 12:34:24 +02:00
Patrick Ohly
b32b506837 sync: refresh-from-server implementation configurable
Google does not implement refresh-from-server, therefore using it has
to be made configurable. It is enabled by default for Funambol and
disabled for everything else.

Existing user configs must be updated to use refresh-from-server with
Funambol:
   syncevolution --configure enableRefreshSync=1 funambol
2012-06-15 12:25:52 +02:00
Patrick Ohly
05445b7645 Mobical: must force vCard 2.1
Mobical has problems with vCard 3.0 (encoding/decoding done incorrectly).
Therefore the sync format must be set to vCard 2.1 with:
   syncFormat = text/x-vcard

The template now has this setting. Existing configurations must be updated
manually:
   syncevolution --configure syncFormat=text/x-vcard mobical

This became necessary for Evolution because the backend no longer
defaults to vCard 2.1. Other backends always required this config change.
2012-05-23 07:13:10 +00:00
Patrick Ohly
4fc6c3e2c4 Merge remote-tracking branch 'origin/syncevolution-1-2-branch'
Conflicts:
	configure.ac
	src/syncevo-dbus-server.cpp
	src/syncevo/Cmdline.cpp
	test/ClientTest.cpp
	test/ClientTest.h
	test/generate-html.xsl
	test/runtests.py

Conflicts caused by backporting + merging back slightly modified
backports.
2011-11-28 10:16:57 +01:00
Patrick Ohly
c319e0eb31 Nokia: prevent accidental usage of "calendar" or "todo" sources
Nokia phones use a combined "calendar+todo" source for syncing. The
"calendar" and "todo" sources also exist because that is where local
databases are configured.

In such a setup, syncing always has to use "calendar+todo". For example,
to refresh from the Linux desktop to the phone, use:
   --sync refresh-from-server <config> calendar+todo

To work with items (restore, show local content), use the underlying sources,
as in:
   --print-items <config> calendar

It was possible to accidentally sync with the "calendar". This commit
prevents that by adding an invalid URI setting to the "calendar" and
"todo" sources in the Nokia and Ovi templates. Existing configs are not
touched, so beware when you already have configured your Nokia phone.
2011-11-18 15:17:21 +00:00
Patrick Ohly
220d60caae GTK UI + config: fix "custom server" setup (BMC #13511)
When the "default" config template (= ScheduleWorld) was downgraded to
"not consumer ready" in SyncEvolution 1.1.0.99.1, setting up a custom
SyncML service in the GTK UI stopped working because the UI wouldn't
show the "not consumer ready" config.

Fixed by changing the "default" config:
- always has ConsumerReady = 1
- PeerName empty
- based on SyncEvolution server template (not essential,
  but has saner, minimal settings for all sources and
  will make it easier to remove the ScheduleWorld template)

It is uncertain why the initial bug report says that the failure is
random and why Jussi was unable to reproduce the problem. The problem
describe above is deterministic. So perhaps there is also another,
related issue.
2011-11-18 15:15:36 +00:00
Patrick Ohly
64942372d6 autotools: fixed "make dist[check]" in non-recursive Automake
The bundled libsynthesis source needs to go into "src/synthesis".

None of the XML config files and templates were installed when using
out-of-tree compilation in a clean build directory, because then the
$(wildcard) macro didn't actually match any files. Now it checks the
source directory and the extra directory prefix is removed before
using the resulting file list.
2011-09-02 09:20:23 +00:00
Krzesimir Nowak
a7ad98fabc Port build system to non-recursive Automake.
All but toplevel Makefile.am are replaced with their non-recursive
counterparts. The generation of configure.in was removed (and thus
configure-{pre,post}.in are also removed) in favor of configure.ac
and m4 macros adding backend specific configure parts.

Version number is generated like in old build system.

There are still many things to improve, but for now there are no
immediate regressions. AUTOTOOLS-TODO contains a list of possible
improvements and fixes. AUTOTOOLS-TESTING contains what was tested
with current build system (configure flags, make options).
2011-08-30 16:38:34 +02:00
Chris Kühl
d41a28378c testing: Added some simple tests for Bluetooth devices 2011-08-26 14:23:41 +02:00
Patrick Ohly
84eb04d291 config templates: added IconURI to all templates (BMC #20750)
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.
2011-07-12 18:30:02 +02:00
Patrick Ohly
3d20ede9a6 templates: added generic WebDAV template
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.
2011-07-06 19:47:07 +02:00
Patrick Ohly
8032247a5a 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
2011-06-28 18:42:43 -07:00
Patrick Ohly
34e6667e14 templates: Add PeerName field, part II
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.
2011-06-28 18:38:38 -07:00
Gabriel Schulhof
535c4ea9df templates: Add PeerName field 2011-06-28 01:26:24 +03:00
Patrick Ohly
528f8ef5a8 WebDAV templates: avoid complete data dump
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.
2011-06-24 17:09:18 +02:00
Gabriel Schulhof
a23751b68b templates: Add IconURI to src/templates/contexts/Google-Calendar.ini 2011-06-22 13:20:16 +03:00
Patrick Ohly
4dde831dd5 config templates: added missing .ini templates for servers
The "webdav-config" branch didn't have all files committed
and thus lacked the traditional set of SyncML servers.
2011-06-08 23:10:23 +02:00
Patrick Ohly
33f0c9c3f6 WebDAV: added templates for Yahoo and Google
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.
2011-06-08 12:19:51 +02:00
Patrick Ohly
bfb7a85f84 configuration: removed builtin templates
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.
2011-06-08 12:19:51 +02:00
Patrick Ohly
388f72b369 config: replaced overloaded "type" with "backend/databaseFormat/syncFormat/forceSyncFormat" (BMC #1023)
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".
2011-02-03 12:59:02 +01:00
Patrick Ohly
e47c7ff970 ScheduleWorld: disabled configuration, replaced in examples
The ScheduleWorld service shut down end of November 2010.
Removing it completely from SyncEvolution is a bit
intrusive (it is used as reference configuration and in
unit tests), so this patch only makes it invisible to
sync-ui users and replaces it in the examples with
Memotoo.
2010-12-14 14:29:00 +01:00
Patrick Ohly
fa9c4c6bb9 phone templates: updated, copied from syncevolution.org Wiki (BMC #5727)
Merged all Nokia templates (S40, S60, Maemo) into one, because the
settings were the same anyway. The rationale is that it reduces the
number of options the user has to choose from.

Added Sony Ericsson, based on K750i.

Added names of working phones based on Wiki entries.
2010-08-27 13:30:05 +02:00
Zhu, Yongsheng
d32026ead2 config: add 'calendar+todo' source for nokia configs (MBC#2101)
Templates for Nokia phones all have the same problem we stated
in bug#2101. So change them all by adding the source.
2010-05-18 14:19:44 +08:00
Zhu, Yongsheng
b5903618be config: add 'calendar+todo' source for nokia7210c config (MBC#2101)
sync-ui can't create correct config for nokia s40 series phone
because config.ini doesn't include 'calendar+todo' source.
Add it now and then the config is correctly used to sync.
2010-05-18 12:45:10 +08:00
Patrick Ohly
29e0b8eac1 templates: use single-file format (MBC #1208)
This patch switches reading of templates on disk from the previous,
one file per .ini file format to the single-file format produced
by the syncevo-phone-config utility. This makes creating templates
much easier, also when using just an editor instead of the tool.

The existing Cmdline tests cover this code pretty well, as demonstrated
by the number of fixes that were necessary in the previous patches
when running the tests. Therefore it should be safe to use this in
SyncEvolution 1.0.
2010-05-04 09:39:20 +02:00
Patrick Ohly
4d5a1ba273 RetryInterval: 0 for Funambol, 2M for everyone else (MB #10451)
A user reported that the default 1 minute resend interval did not work
for him with his own Funambol server installation. The Funambol
developers are notified, but won't be able to do much about this
in the near future.

Therefore this patch disables message resend in the Funambol server
template. Existing configurations have to be updated manually, both
to suppress the resending and to enable it again later.

The default resend interval is also increased from 1 minute to 2
minutes, to help other slow servers which might have problems handling
resends when they arrive to quickly.
2010-04-19 14:06:55 +02:00
Jussi Kukkonen
9259c9e193 templates: add N85 (Nokia S60) template 2010-04-14 13:58:45 +02:00
Jussi Kukkonen
cd65c118c6 templates: set N900 as consumerReady (MB #10336)
We want the N900 template to show up in the UI
2010-04-09 14:55:44 +03:00
Chen Congwu
b89d85e5f3 Config Templates: Add 'templateName' optional property (MB10406)
'templateName' property is introduced to present the 'device class'
for a matching device.
The property is optional. There might be templates which only
match one specific model or where the class is so obscure that
showing it is useless.

There are 'template id' and 'template name' concepts inside the core,
'template id' is the handle of the template, user can later use it
to uniquely retrieve the corresponding template, 'template name' on
the other hand is an explict property 'templateName' inside the
template metadata, describing the class of the devices for UI.

'template id' is only used by Cmdline and it use the first entry of
the fingerprint.
2010-03-26 10:23:01 +01:00
Patrick Ohly
e3399289ab templates: keep fingerPrint a list of models
We decided against "abusing" the first entry in the
fingerPrint list as the name of the device family/class.
The reason is that there might be templates which have
no such class, which would be impossible to determine
if only "fingerPrint" is available.

Instead the plan is to introduce a separate "templateName"
property.

Note that the sync-ui currently still assumes that the first
fingerPrint entry can be shown to the user. To avoid confusion
(device is called "Nokia N85", shown as "Nokia 7210c") we have
to keep one template per model.
2010-03-24 10:23:20 +01:00
Chen Congwu
bafde8080f Configuration template: fingerprint changes
The first entry in the fingerprint is used to uniqely identify the template
(a.k.a template name), it was formulated like 'nokia_7210c' which is not
friendly to user. This patch changed the naming to 'Nokia 7210c', other existing
templates is also updated accordingly.
2010-03-24 08:58:06 +01:00
Chen Congwu
e1d8e4108f Configuration template: reuse 'peerIsClient' in config.ini (mb#10224)
'peerIsClient' was duplicated in config.ini and template.ini, this
patch reused this field.
The patch also removed the 'default' template for server side, that is not
needed and broken.
2010-03-18 18:40:48 +01:00
Chen Congwu
c854be6236 Configuration Template: Add Nokia N900 template (MB#10224) 2010-03-18 18:40:48 +01:00
Chen Congwu
d3b362b643 SyncEvolutionClient template: do not match "SyncEvolution"
Change the fingerprint to not match "SyncEvolution", this is no
longer correct because "SyncEvolution" is used to match client side
templates (once identified by "SyncEvolutionServer").
2010-03-01 08:22:25 +01:00
Chen Congwu
bc1aba2c37 Configuration template: more teaks
1) .template.ini renamed to template.ini
2) removed duplicated configuration templates in the test directory, we will use
the real templates for testing.
3) change default template for Nokia phones to Nokia_7210c
2010-01-20 14:09:02 +01:00
Patrick Ohly
53e0c61e2b resolved template merge bug
Somehow after merging, src/templates/Funambol and src/templates/ScheduleWorld
came back. The WebURL change for ScheduleWorld did not make it into all
the right places on master.
2010-01-19 19:17:31 +01:00
Chen Congwu
d71aa7b2ac Configuration templates matching: match templates based on metadata
Introduced TemplateConfig to abstracting the template configuration structure,
the template metadata used for matching is also parsed here.
The fields introduced in the metadata are:
PeerIsClient: identify whether this is a server side configuration or a client
side configuration.
Fingerprint: the matching string for this template, it is a comma separated string
with each string modeled as: "Manufacture_Model". The first substring is also
used as the name to identify this template so that user can select the template
by this name.
eg:
Nokia 7210c: Nokia_7210c
SyncEvolution server: SyncEvolutionServer, SyncEvolution
ScheduleWorld: ScheduleWorld,default
SyncEvolution client: SyncEvolutionClient, SyncEvolution

Description: this is a just a descriptive string not used for matching.

GetServerTemplates is changed to add another "devices" parameter to identify
it is asking for templates for a list of "devices". Each device is a tuple
<matchstring (devicename), matchMode (server/client/all)>.
TemplateList as the return type, which is a list of class TemplateDescription
so that we can also return enough information for corresponding templates. This
list is sorted by the 3-tuple <finger, rank, name>.

Add MatchServerTemplates method which will iterating all templates inside the
folder and match against the input parameter and finally return a sorted
list of matched templates.

The atcually fuzzy match algorithm is based on a LCS (added in the following
commit).

Cmdline interface is changed accordingly:
--template ? is changed to --template ?[string], so that user use the former
case to match all templates for a tradiontial SyncML client and the latter case
to match templates related to an input string.

SyncConfig API is also renamed (Server -> Peer) because both server/client
configuration/template are handled.

The original configuration template (Funambol and ScheduleWorld) has been moved
to the new template structure (under servers), they also have a .template.ini
file added so that they can be matched and picked up. All templates for
supported servers still have built-in template support in the code as before.
Templates for SyncEvolution based server is also added.

Server side templates are added (Nokia default, Nokia_7210c and SyncEvolutionServer).

Add unit test for the new template match use case.
2010-01-19 18:06:20 +01:00
Patrick Ohly
0944e3eda5 installation: templates now in $(datadir)/syncevolution/templates (MB #7808)
The previous location was /usr/etc/syncevolution. It should have been
/etc/syncevolution in our debs, with proper declaration as system
config files. The intention was that system admins can add or modify
templates.

Not particularly likely, so now template files are only searched in
/usr/share/syncevolution/templates (or whatever was chosen with
configure --datadir).

Also added a README to that directory, warning that copying these
files will lead to incomplete configs. Each main config.ini carries
a similar comment, for those who miss the README.
2009-11-27 14:43:22 +01:00