Commit graph

105 commits

Author SHA1 Message Date
Patrick Ohly
3cfc889178 configuration: renamed evolutionsource->database, evolutionuser/password->evolutionUser/Password
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.
2011-01-18 16:16:52 +01:00
Patrick Ohly
a6c245580c configuration: added possibility to define property name aliases
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.
2011-01-18 15:18:21 +01:00
Patrick Ohly
a61b8590f3 backend API cleanup: removal of "const char *" return types
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.
2011-01-18 15:15:09 +01:00
Patrick Ohly
549e1d69a8 nightly testing: fix for CmdlineTest::testOldConfigure
The previous commit broke the test because now ConsumerReady is
set after migration.
2011-01-18 14:35:13 +01:00
Patrick Ohly
cc90383f13 config migration: special handling for config visibility of <1.2 configs
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.
2011-01-17 21:48:57 +01:00
Patrick Ohly
922ac79d17 config migration: renamed configs get ConsumerReady flag removed
The "*.old" configs get their ConsumerReady flag removed so that UIs
can decide whether they still need to be shown to the user.  The
command line will show them, the GTK sync-ui is meant to hide them
(but doesn't to it yet).
2011-01-17 15:00:50 +01:00
Patrick Ohly
c1e0eef73d command line tool: fix incorrect --migrate of configuration in different context
Migrating a config in a context wasn't necessary so far, but also
wasn't explicitly forbidden or prevented. It did not work correctly
when the config was identified without explicit context on the command
line, because that short-hand was only mapped correctly before
renaming the config, but not anymore afterward. As a result, the
config was moved into the @default context or possibly some other
context which had a peer with the same name.

Cleaned up the m_server parsing (duplicate code?!) and fixed this
problem by setting m_server to the fully-qualified configuration name,
including a @default suffix. This is user-visible in error messages,
which actually may be a good thing.
2011-01-11 17:43:23 +01:00
Patrick Ohly
ea78f2e1cf on-disk format: bumped per-peer version to 1
The goal is to release SyncEvolution 1.2 with a more recent
libsynthesis, which rewrites its on-disk binfiles such that
older releases are forced to do slow syncs.

This versioning change forces old configs to be migrated.  This
affects both the old .sync4j style config (as represented by the
testOldConfigure test) as well as unshared
~/.config/syncevolution/<peer> configs.
2011-01-11 16:42:16 +01:00
Patrick Ohly
38e3a29b5a compilation: distinguish between stable releases and pre-releases
gen-autotools.sh now detects pre-releases: have "99" in the version or
the source isn't cleanly tagged. "syncevolution --version" includes
"(pre-release)" if in pre-release mode, otherwise just the version (as
before).
2011-01-11 16:42:16 +01:00
Patrick Ohly
5684718722 config handling: added versioning
This patch adds version numbers to the on-disk config and files. The
goals are:
1. refuse to use a config which was written by a SyncEvolution release
   in a format that is too recent to be handled correctly by the
   current release ("detect invalid downgrades")
2. refuse to modify a config in such a way that the previous release
   using that config will not be able to use it anymore ("prevent
   unintentional upgrade of config")

In the first case the user is told:
  SyncEvolution <version> is too old to read configuration '<config>',
  please upgrade SyncEvolution.

In the second case the user is told to migrate the configuration manually:
  Proceeding would modify config '<config>' such that the
  previous SyncEvolution release will not be able to use it.
  Stopping now. Please explicitly acknowledge this step by
  running the following command on the command line:
  syncevolution --migrate '<config>'

These are printed as [ERROR] messages on the command line and shown as
error codes 22004 resp. 22005 in front-ends which don't know about these
scenarios.

The first problem should be rare, so presenting a nicer error messages
in UIs is not essential. But the second problem will occur. The plan
(not implemented yet) is to automatically migrate in stable releases
without asking.
2011-01-11 16:42:02 +01:00
Patrick Ohly
543ec4b4d8 command line: prevent incomplete migration of context
"--migrate @<context name>" would have happily migrated the non-peer
properties, but would not copy the peers inside that context. Wasn't
needed so far, but shouldn't have been allowed either.
2011-01-10 15:51:10 +01:00
Patrick Ohly
ed05a9ab51 Merge commit 'syncevolution-1-1-1'
Conflicts:
	configure-pre.in
	src/syncevo/SyncContext.cpp
	src/syncevo/configs/datatypes/10calendar-fieldlist.xml
	test/ClientTest.cpp
	test/client-test-main.cpp
	test/synccompare.pl

Conflicts all resolved by using the code from "master" branch. Caused
by similar changes on release branch.
2010-12-26 21:29:00 +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
79deb4025a dumpData config option: make database backups optional
Database backups used to be created unconditionally, even if not
needed for comparison. Now the new "dumpData" variable is
checked. If change printing is enabled, dumping data is implied.
2010-12-01 12:32:46 +01:00
Patrick Ohly
ffa3f58475 Cmdline: keep report about executed sync
If the operation is to run a sync, then having the report available
afterwards is useful in code which uses Cmdline as a convenience
class.
2010-12-01 12:32:46 +01:00
Patrick Ohly
16cde385d6 Cmdline: added varargs constructor
Passing a NULL terminated list of parameters is sometimes a convenient
way of executing certain complex operations. Cmdline testing already did
it, now this is also in the Cmdline class itself.
2010-12-01 12:32:46 +01:00
Patrick Ohly
55ada103c4 SyncSourceParams: introduced context information
Backends like XMLRPC need information about URL, proxy and SSL
settings, etc. This can be done via source specific properties, like
evolutionsource, but this is not how this is normally done. It would
be nicer if the exising per-peer properties could be used. The goal is
that a normal peer configuration can be created from a template with
the necessary information to enable sources using that information.

This patch makes this possible by adding a context parameter to
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
     *                       config inside the config context of the source.
     *                       Testing uses "source-config@client-test". On the
     *                       command line, this is the config chosen by the
     *                       user, which may or may not have peer-specific settings!

Note that this still doesn't solve the problem for XMLRPC to SyncML
peer sync, because in that case ("normal sync") the context will be
the one describing the peer. SyncURL is already used and proxy
settings might not match.

The XMLRPC backends therefore was not changed and continues to use
evolutionsource.
2010-12-01 12:32:43 +01:00
Patrick Ohly
776c1522b8 command line: --delete-items ... * deletes all items
There was no obvious way of deleting all items. Added * as wildcard
for that. It can be specified in addition to other luids, which
will be ignored if a star is given.
2010-10-26 10:24:48 +02:00
Patrick Ohly
a56fa43d33 command line: split properly at empty line during --import (BMC #7664)
The --import operation was specified as splitting at a blank line and
was meant to work for vCard 3.0 and iCalendar 2.0 files. However, if
the blank line between items used DOS line ends (\r\n) like the items
themselves, then splitting them didn't work because of the literal
match with "\n\n".

This patch introduces a special semantic for the "\n\n" delimiter:
it also matches "\n\r\n" when splitting. This is implemented by
the custom FindDelimiter class.
2010-09-30 17:20:15 +02:00
Patrick Ohly
cb67e29e0a command line: fixed configuring of context (BMC #7181)
A context holds a set of source settings, without any peer-specific
properties like "sync mode". The code for configuring such a context
tried to set the sync mode and thus failed.

This patch unifies the check for "configuring context" in one place.

It also slightly modifies the set of sources which are configured:
traditionally, all sources were configured, but only the listed ones
were enabled. This makes sense because users then can enable the source
selectively, either during --run or with --configure without access to
the original template.

For a context, there is no concept of a "disabled" source. Adding
those makes no sense and thus is not done anymore.

Configuring a single source in a new context, adding a second source
and adding a peer is now tested in CmdlineTest::testConfigureSources.
Note that this contains a hack to reflect the broken behavior in BMC
fixed.
2010-09-29 15:07:35 +02:00
Patrick Ohly
5a8574b7b1 nightly testing: adapted Cmdline test to string changes 2010-09-09 11:38:05 +02:00
Patrick Ohly
21f76cff07 command line: code clean-up around LUID escaping
Using std::string for both local IDs as respresented by the backend
and encoded as printed by the command line was confusing. It didn't
help that the m_luids member contained encoded strings, instead of
normal luids.

This patch introduces a dedicated class which holds an encoded luid,
and provides the necessary conversion functions. m_luids now really
contains plain luids, so its values can be passed to the backends
directly.
2010-09-01 15:48:29 +02:00
Patrick Ohly
1b243b7b83 D-Bus API: added Server.ConfigChanged signal (BMC #3558)
Watching for configuration changes (e.g., for refreshing the list of
servers in the GUI) currently is a bit cumbersome. It requires
watching for SessionChanged, request GetConfigs, and look if
the configs have changed. This is not really a problem, but it
might be more convenient to get notifications about config
changes directly.

This patch introduces a Server.ConfigChanged signal which is at the
end of a session if and only if it modified (removed, updated, added)
a config. This includes the Session.SetConfig() as well as command
line operations executed inside the server.

Testing the signal can only proof that it is emitted. Checking that it
is not emitted would have to block waiting for something, and it is
uncertain what that should be. SessionChanged may be emitted before
the ConfigChange signal and thus isn't suitable.
2010-08-25 23:09:28 +02:00
Patrick Ohly
1b62240708 command line: allow creating contexts without peers
When configuring a context for local sync, no peer is needed
inside that context. Therefore "--configure" without "--template"
is valid, because the templates only differ in peer-specific
properties.

This patch uses the "SyncEvolution" template as automatic fallback
for context configs. A change to FileConfigTree ensures that the
"peers" directory is created, as expected by the code which checks
for new-style configs.
2010-08-24 09:36:15 +02:00
Patrick Ohly
a3eaf3138b command line: fixed --delete-items/--import for KCalExtended
The --delete-items/--import options did not work with the KCalExtended
backend. The reason was that saving changes is only done in
KCalExtendedSource::endWrite(), which wasn't called because the command
line did not invoke endDataWrite().

That used to be intentional to avoid updating change tracking state in
other backends, but clearly was a hack. Because the sources are now
instantiated without change tracking, endDataWrite() is safe to call,
which fixes the issue with KCalExtended.
2010-08-23 18:20:01 +02:00
Zhu, Yongsheng
e38a479a6c client-test: ignore comments for KCalExtended and QtContacts
'isPropAssignment' checks each line and match whether it's
a property assignment according to match '<word> = value'.
Comments for 'KCalExtended' and 'QtContacts' match this pattern.
Obviously, they should be ignored like other backends comments.
2010-07-14 14:13:57 +08:00
Patrick Ohly
b7ef83d6ed documentation + command line: unified source of usage information (MBC #690)
This patch adds an utility script (readme2c.pl) which extracts the
SYNOPSIS and OPTIONS part of README.rst and puts it into C
strings. These are then used inside the SyncEvolution command line for
short help (just the synopsis) and --help (also all options).

This patch also cleans up README.rst so that the OPTIONS part really
documents most options in sufficient detail for --help to be useful.
The USAGE section remains part of the README and the man page where
the different operations are introduced in a more task-oriented way.

This separation is not always easy to make. The --restore operation
and related parameters are only described in the USAGE part because I
couldn't find a way to introduce them briefly and then add a thorough
explanation under OPTIONS.
2010-07-12 16:31:46 +02:00
Zhu, Yongsheng
99c9919b44 Testing: fix failure of evolution testing due to new backends
Some unit tests of CmdlineTest are failed due to new backends
which were newly implemented, including KCalExtended and QtContacts.
Change the reference data.
2010-07-08 13:51:26 +08:00
Patrick Ohly
352610c157 ZYB.com: service goes away end of June 2010, template removed (MBC #3310)
ZYB.com will be replaced with Vodafone 360, which we don't support (yet).
This patch removes the obsolete template for ZYB.com. The sync-UI still
has some strings for it, just in case that someone has an old template
around or runs it against an old syncevo-dbus-server.
2010-06-30 11:59:45 +02:00
Patrick Ohly
d4594d6c4e command line: fix --print-items description luid handling
The luid in --print-items also needs to be demangled before
passing to the source.
2010-06-30 10:37:51 +02:00
Patrick Ohly
3db8fc1eac command line: allow temporary configs in import/export operations
Temporary source properties are needed when the config does not
exist. This patch sets them before creating source nodes and
documents this behavior.
2010-06-30 10:37:51 +02:00
Patrick Ohly
300952c4ef command line: fix for new update/delete operations
Local IDs were not decoded before invoking the underlying SyncSource
operation. As a result, it failed with "item not found" errors for
those items which really had special characters in their IDs.
2010-06-30 10:37:50 +02:00
Patrick Ohly
3c3532c280 command line import/export: failed for non-peer configs
Besides the issue with reading the "type" (MBC #3157),
operations like "--print-items @some-context addressbook"
also failed because the TrackingSyncSource would try to write
updated id/rev pairs into a DevNullConfigNode, set because
there is no tracking node in @some-context.

DevNullConfigNode does not allow writing. This patch uses
a set of config nodes where the tracking node is volatile and
allows writing.

The additional benefit also for peer configs is that the SyncSource
can no longer overwrite the change tracking for that peer
accidentally because it never gets access to that node.
2010-06-30 10:37:50 +02:00
Patrick Ohly
ebe8078624 command line --print-items: added short description
SyncSourceLogging has a functional getDescription() method
in many backends that works with only the local data; use
that to extract a description.
2010-06-16 11:05:19 +02:00
Patrick Ohly
42e3588099 command line: added --delete-items
This complements --import/update/export/list-items. --remove was
already taken, for deleting a configuration.

Because the removal is done via the normal m_deleteItem operation, we
inherit the normal SyncML behavior (logging, no error return code for
non-existent items). It would have been nice to let the user choose
how to handle that situation (like --force in rm), but that can't be
done without SyncSource API changes.
2010-06-16 11:05:19 +02:00
Patrick Ohly
91e4b47931 command line: added --import/export/update/print-items
These operations provide a common interface for manipulating
databases supported by SyncEvolution backends. --delete is
an obvious gap, will be added soon.

The implementation supports all backends offering the SyncSourceRaw
interface (Evolution, Akonadi, XMLRPC, file, but not the sqlite demo),
which is determined via a dynamic cast. SyncSourceRaw is necessary
because it allows direct access to the native data format without
going through the Synthesis engine.

Because the Synthesis engine is not activated, printing the short
description (SyncSourceLogging interface) mentioned in the README.rst
is not possible yet. Having such an engine would be useful also for
importing/exporting data which is not in the native format of the
backend; additional command line parameters will be needed to define
that format.

All of the new operations have in common that they work on one source
and multiple LUIDs. This is a slight deviation from other command line
synopsises where all arguments after the server config refer to sources.
The new m_accessItems flag is set for these special operations; they
also share much of the setup code.

The implementation itself tries to use the generic SyncSource
interface as much as possible. It only falls back to more specialized
implementations where necessary (SyncSourceRaw).

The builtin synopsis and usage was intentionally not updated. The
expection is that before this patch lands in the "master" branch, the
builtin text will come directly from README.rst (which was updated).
2010-06-16 11:05:11 +02:00
Patrick Ohly
3df4855bdd Cmdline::isSync(): cosmetic change
Instead of repeating "return false" multiple times, use one if/else check.
2010-06-16 11:05:10 +02:00
Patrick Ohly
32463d532f command line parsing: check for conflicting operations
Previously, it was possible to list several different operations
on the command line ("--version --configure --run ..."). SyncEvolution
then picked one of them in (for users) unpredictable ways.

Now all requested operations are gathered while parsing the command
line and the tool aborts with an error message listing all of them
if more than one is given.
2010-06-16 11:05:10 +02:00
Patrick Ohly
8e759d4d59 templates: also search in .config/syncevolution-templates (MBC #1208)
With this patch, template files are also found in
.config/syncevolution-templates (or the corresponding directory
pointed to by the XDG env variables).

The tests had to be adapted a) to not find templates installed
by the user in his own home and b) to cover finding templates
via XDG_CONFIG_HOME.
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
Zhu, Yongsheng
cae8cb485a command line: fix a regression checked by nightly
There is a regression caused by a string exception
"basic_string::_S_construct NULL not valid". This is because
I push back a non-existing string into vector when collecting
converted command line arguments.
2010-04-09 11:24:03 +08:00
Patrick Ohly
76a1557232 command line + D-Bus: fix for "some parameters are already handled by parse()" (MB #5013)
The criteria for not invoking Cmdline::run() was a bit too broad.
For "--template ?", "--help", "--version", "?", "--print-servers" no
output was produced in --daemon mode.

Perhaps the whole m_dontrun logic should be updated. In order to
minimize changes, this patch only duplicates the Cmdline::run()
logic.
2010-04-07 18:23:33 +02:00
Patrick Ohly
67b1c0a599 command line + D-Bus: fix for "pass absolute paths to dbus server" (MB #10461)
argv[0] is skipped by Cmdline::parse(), therefore wasn't added to
the updated argument list for the D-Bus, which then basically
ignored the first command line parameter.
2010-04-07 18:21:54 +02:00
Zhu, Yongsheng
867b286a8e command line + D-Bus: pass absolute paths to dbus server (MB#10461)
Convert relative paths into absolute paths before passing arguments
to dbus server because command line and dbus may have different working
directory.
Leave this kind of task in Command line for it knows the meaning of
parameters and convert them if necessary.

Add a new function 'relToAbs' to convert a relative path to a
canonicalized absolute path.
2010-04-07 13:53:24 +02:00
Patrick Ohly
da2568c921 command line + D-Bus: --status help and output (MB #5043)
Added "--status without config name" comment to help output.
Changed the "No running session(s) just now" into a full sentence,
with a slightly more "positive" twist to it:
"Background sync daemon is idle."
2010-03-29 11:01:36 +02:00
Patrick Ohly
d19ca9046f command line + daemon: usability improvements (MB #5043)
This patch changes what is shown to the user and how the user
interacts with the command line. Details below.

"--use-daemon [yes/no]" implies that yes/no is optional (square
brackets!), with "yes" being the option that could be expected for a
plain "--use-daemon" parameter. But the implementation always expects
a "yes" or "no" parameter. The original format suggested was
"--use-daemon[=yes/no]"

This patch switches to that format, changes --use-daemon into --daemon
(to be consistent with --keyring) and enables the same format for
--keyring. Although not documented, 0/f/false and 1/t/true are also
accepted. Because the value becomes part of the parameter, m_argc checks
had to be adapted.

The documentation for "--use-daemon" was inserted in the middle of the
"--keyring documentation".

"Parameter not set" has to be available to the Cmdline caller in the
command line too, in addition to true/false. This was done originally
with a string which is empty, "yes" or "no". Using a tri-state
Cmdline::Bool class makes this a bit more explicit and removes the
ambiguity around what useDaemon() returns (values weren't documented).

When running without --daemon and no daemon available, the
first lines of output were:
ERROR: org.<cryptic error>
[INFO] itodo20: inactive
....

=> The command line should fall back *silently* to running in-process.
=> Error messages should be formatted and logged as such, using SE_LOG_ERROR().
   Old code might not have done that and we need to preserve that for compatibility
   with frontends, but new code should use [ERROR] as output.
=> D-Bus error messages (as in the case above) must have some user (and developer!)
   comprehensible explanation what went wrong. The D-Bus error class itself
   is no enough.

Although I haven't tested it, I suspect that the code also would have
re-run the operation in-process after the D-Bus server already
executed it and failed.

I rewrote this so that a check for "daemon available" without error messages
is done first before committing to using the daemon. Once that decision is made,
the command line will not fall back to in-process execution.

Rewrote several error messages. Telling a user of a distro's binary to
"re-configure" is misleading (he didn't configure himself).
"can't" => "cannot", punctuation changes. Not sure whether is always an
improvement, comments welcome.

Comment on coding style: I've used "if ()" instead of "if()" because that is
the GNU recommendation.
2010-03-29 11:01:36 +02:00
Zhu, Yongsheng
3fc7e529ea Cmdline: move cmdline to dbus server (MB#5043)
Implement cmdline with support of dbus server. To enable cmdline
with dbus server, use the option '--use-daemon yes/no' in case that
you enable dbus service when configuration.

In a typical scenario, a new session is created for the purpose of
execution of arguments. It is scheduled with other sessions but with
a highest priority. Once it becomes active, command line call
'Session.Execute', a newly added method to execute command line
arguments.

The config name of a session should be known for dbus clients like
command line. A new property 'configName' is added in the properties
when calling 'Session.GetConfig'.

CTRL-C handling are processed once executing a real sync to dbus
server. It is mapped to invoke 'Session.Suspend' and 'Session.Abort'.

The meaning of '--enable-dbus-service' is expanded accordingly.

'--status' without server means printing all running session in the
dbus server.
'--monitor' could accept an optional config name. If one is given,
only attach to a session of that config, otherwise print an error.
If none is given, pick the first.
2010-03-29 11:01:35 +02:00
Patrick Ohly
e9d6936c55 Cmdline::run(): context should use same output as command line (MB #5041)
For cases where the Cmdline instance uses a non-standard output stream,
the SyncContext should also use that one. Needs to be tested as
part of MB #5042/5043.
2010-03-29 11:01:35 +02:00
Patrick Ohly
c7aa99e5b2 stdout: never write to std::cout directly (MB #5041)
Cmdline and SyncContext standard output should always go
through a variable that can be pointed towards the actual
output channel.

Cmdline already had m_out for that, but it wasn't used
everywhere. Fixed.

SyncContext now has setOutput()/getOutput() and that is
used in SyncContext.cpp. It is not set anywhere yet.

To catch incorrect use of cout or cerr inside SyncEvolution,
the SyncEvo namespace defines its own cout and cerr which cannot
be used like std::cout/cerr, thus triggering compiler
errors. Use "std::cout/cerr" when necessary.
2010-03-29 11:01:35 +02: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