Ticket #1084 (closed task: fixed)
Make OSyncCapabilities and the use of Merger/Demerge format independent
| Reported by: | dgollub | Owned by: | dgollub |
|---|---|---|---|
| Priority: | highest | Milestone: | OpenSync 0.39 |
| Component: | OpenSync: Format-Plugin API | Version: | 0.38 |
| Severity: | critical | Keywords: | |
| Cc: |
Description
To avoid that the OSyncCapabilties interface and the MErger/Demerge gets dependent on one single format (e.g. XMLFormat) we should make this more future proof and prepare that it's possible to have sevearl "common formats" like xmlforamt.
So it's easier to switch away from XMLFormat if there is a better alternative one day.
To be clear: Currently there is no alternative to XMLFormat! Keep going with XMLFormat - but don't make yourself depending on it inside your sync plugin!
Some initial notes have been made on http://www.opensync.org/wiki/trunk/features/mergerCapabilities Also helpful: http://www.opensync.org/wiki/trunk/features/mergerFormatConversion
Attachments
Change History
comment:1 Changed 3 years ago by dgollub
- Priority changed from high to highest
- Status changed from new to assigned
Changed 3 years ago by dgollub
-
attachment
ticket1084_capformats_v1.diff
added
Initial API desgined for OSyncFormatMerger and changes on OSyncCapabilites and retgister interface for OSyncFormatEnv - stil NOOP
comment:4 Changed 3 years ago by dgollub
Proposal from Patrick Ohly:
Drop the separate merger/demerger concept. Move that functionality into the format conversion. When converting towards OpenSync, the format plugin works with an item in the "foreign", limited format, a capabilities description that describes the format used by the peer, and a complete item in the internal format. The result is an updated internal item with information from the peer mixed in, or a complete copy of the incoming item when there is no internal item yet. When sending towards a peer, the format plugin only needs to pick properties from the internal item according to the peers capabilities. "Only read what you need" looks more natural to me than the current concept of "strip an item, then convert the stripped down version". The additional advantage is that this conversion has full access to all available information, which may be an advantage when going beyond a static capabilities-based conversion towards a scripted one which also uses dynamic configuration.
http://thread.gmane.org/gmane.comp.misc.opensync.devel/3787/focus=3800
Changed 3 years ago by dgollub
-
attachment
ticket1084_conversion-merge.diff
added
Initial implementation of a combied conversion-merge function which get capabilities and archive_data passed
comment:5 Changed 3 years ago by dgollub
Next:
- porting file-sync
- porting xmlformat plugin
- porting vformat plugin
- test file-sync <-> file-sync group with vcard21 and vcard30 and different caps
comment:6 follow-up: ↓ 7 Changed 3 years ago by bricks
If I understand the new approach correctly it contains a problem with the conversion path. The capabilities have to be used only at the edges of the conversion path towards the sync plugins. E.g. if you have a path like
syncplugin1<->formatA<->commonformat<->formatB<->formatC<->syncplugin2
formatA and formatC are at the edges. FormatB can ignore the capabilities. Therefore who decides (and when) a format has to use the capabilities within the conversion.
comment:7 in reply to: ↑ 6 Changed 3 years ago by dgollub
Replying to bricks:
If I understand the new approach correctly it contains a problem with the conversion path. The capabilities have to be used only at the edges of the conversion path towards the sync plugins. E.g. if you have a path like
syncplugin1<->formatA<->commonformat<->formatB<->formatC<->syncplugin2formatA and formatC are at the edges. FormatB can ignore the capabilities. Therefore who decides (and when) a format has to use the capabilities within the conversion.
Björn, thanks pointing this out!
I would say we could handle this inside osync_format_env_convert().
This function knows the conversion path - and could determine if it's on the edge. Actually you have to see this conversion chain as two separated paths!
- formatA <-> commonformat
- formatC <-> commonformat
Also see the diagrams at (ignore merge/demerge) http://www.opensync.org/wiki/trunk/features/mergerFormatConversion
comment:8 Changed 3 years ago by dgollub
This was the last mail on the discussion: http://thread.gmane.org/gmane.comp.misc.opensync.devel/3787/focus=3818
I try to look into this this week - sorry for not being more active the last days.
comment:10 Changed 3 years ago by dgollub
comment:11 Changed 3 years ago by dgollub
comment:12 Changed 3 years ago by dgollub
comment:13 Changed 3 years ago by dgollub
comment:14 Changed 3 years ago by dgollub
comment:15 Changed 3 years ago by dgollub
comment:16 Changed 3 years ago by dgollub
comment:17 Changed 3 years ago by dgollub
comment:18 Changed 3 years ago by dgollub
comment:19 Changed 3 years ago by dgollub
comment:20 Changed 3 years ago by dgollub
comment:21 Changed 3 years ago by dgollub
comment:22 Changed 3 years ago by dgollub
comment:23 Changed 3 years ago by dgollub
comment:24 Changed 3 years ago by dgollub
comment:25 Changed 3 years ago by dgollub
comment:26 Changed 3 years ago by dgollub
comment:27 Changed 3 years ago by dgollub
comment:28 Changed 3 years ago by dgollub
(In [5682]) Add missing parsing of the CapsFormat? name
refs #1084
comment:29 Changed 3 years ago by dgollub
On some call Daniel Friedrich came up with a solution to still work with one merger - but still kepp the capabilities independent:
- still a generic way to store native capabilties is required (see #1084 branch)
- move translation(-tables) from the sync-plugin into a tiny format-plugin
- the tiny format plugin has the possibilty to get called with specific capabilities-translator function - for a specific format (function register per format)
- this makes the sync-plugin independent of common formats
WIP: PoC for evo2-sync and syncml-obex-client
comment:30 follow-up: ↓ 37 Changed 3 years ago by dgollub
Discussion with Björn Ricks at Linux Tag. For multi-capabilities-format support we do follwoing introductions:
- merge/demerge objformat registrion get extended with "capsformat"
- so merger/demrege get registed with a objformat/capsformat tuple
- + OSyncMerger *osync_merger_new(const char *objformat, const char *capsformat, OSyncError error)
- + osync_format_env_register_merger(OSyncFormatEnv *, OSyncMerger *)
- - osync_objformat_set_{,de}merge_func()
- Struktur OSyncMerger
- int ref_count
- char *capsformat
- char *objformats
- init_func/fainlize_func
- objformat get a new format plugin function called "caps_converter"
- osync_bool (* caps_converter) (OSyncCapabilities *old, OSyncCapabilities new, OSyncError error)
comment:31 Changed 3 years ago by bricks
comment:32 Changed 3 years ago by bricks
comment:33 Changed 3 years ago by bricks
comment:34 Changed 2 years ago by dgollub
comment:35 Changed 2 years ago by dgollub
comment:36 Changed 2 years ago by dgollub
comment:37 in reply to: ↑ 30 Changed 2 years ago by dgollub
Replying to dgollub:
Discussion with Björn Ricks at Linux Tag. For multi-capabilities-format support we do follwoing introductions:
- merge/demerge objformat registrion get extended with "capsformat"
- so merger/demrege get registed with a objformat/capsformat tuple
done
- + OSyncMerger *osync_merger_new(const char *objformat, const char *capsformat, OSyncError error)
done
- + osync_format_env_register_merger(OSyncFormatEnv *, OSyncMerger *)
done
- - osync_objformat_set_{,de}merge_func()
got dropped, done
- Struktur OSyncMerger
- int ref_count
- char *capsformat
- char *objformats
- init_func/fainlize_func
done
Additionally
- merger_func
- demerger_func
got added.
- objformat get a new format plugin function called "caps_converter"
- osync_bool (* caps_converter) (OSyncCapabilities *old, OSyncCapabilities new, OSyncError error)
TODO - going to open for this last item a seperated ticket ... this one is getting to heavy.
comment:38 Changed 2 years ago by dgollub
- Status changed from assigned to closed
- Resolution set to fixed
Last item got handled in #1146
