Ticket #572 (closed defect: fixed)

Opened 14 months ago

Last modified 3 months ago

vconvert does not convert xml-format back to vcard

Reported by: felixmoeller Owned by: prahal
Priority: normal Milestone: 0.40
Component: Engine Version: 0.34
Severity: normal Keywords:
Cc: cstender, dfriedrich

Description

I just tried to convert a vcard to the xml-format:

# vconvert cell32/card.vcf --to-xmlformat --out card.xml // does work
# vconvert card.xml --to-vcard30 // does not work

In line 79 of vconvert.c osync_objformat_get_name(sourceformat) gives "plain". After osync_data_set_objformat(data, sourceformat); it is just "".

A little hack enables me to convert to a vcard: ;) Editting in vconvert.c line 311

 OSyncObjFormat *dummyformat = osync_objformat_new("plain", "data", &error);

to:

 OSyncObjFormat *dummyformat = osync_objformat_new("xmlformat-contact-doc", "data", &error);

and commenting out in opensync/data/opensync_data.c line 120:

        if (data->objformat)
              osync_objformat_unref(data->objformat);

btw. vconvert is not in the osbs.

Attachments

reenable_plaintoxmlformatdoc_whilepreserving_filesync.diff (1.5 KB) - added by prahal 3 months ago.
This use OSYNC_CONVERTER_DECAP to prevent file-sync from using it by default to store its data.

Change History

  Changed 14 months ago by cstender

  • status changed from new to assigned
  • milestone set to OpenSync 0.40

  Changed 14 months ago by cstender

  • cc dfriedrich added

Well, of course this is no solution. The problem is commit r2449. I'm not sure, why Daniel removed this functionality.

  Changed 14 months ago by cstender

Sorry, I mean r2499.

  Changed 13 months ago by felixmoeller

  • version changed from 0.33 to 0.34

Just to keep the ticket up to date. This is still present with 0.34. To be more precise r2779.

follow-up: ↓ 6   Changed 11 months ago by cstender

  • owner changed from cstender to dgollub
  • status changed from assigned to new
  • component changed from Plugin: vformat to OpenSync

Daniel, do you know why this was removed with commit r2499? Can we get it back?

in reply to: ↑ 5   Changed 6 months ago by dgollub

  • summary changed from vconvert does not voncert xml-format back to vcard to vconvert does not convert xml-format back to vcard
  • milestone changed from 0.40 to 0.38

Replying to cstender:

Daniel, do you know why this was removed with commit r2499? Can we get it back?

The r2499 commit comment describes some unintended conversion path. Needs more careful review.

  Changed 3 months ago by dgollub

  • milestone changed from 0.38 to 0.40

The commit message is from r2499 is really not helpful at all. There is no format "xmlformat-doc". So i don't see the problem for conversion path like: file -> plain -> xmlformat-$objtype-doc -> xmlformat-$objtype

The only downside i can see, is that file-sync might store by "default" xmlformat-$objtye-doc encasplutated - which will confuse lots of people. OTOH, when people start storing xmlformat on a disk - we have to "SUPPORT" this format very very carefully over several releases. But this should be O.K., when handling different versions with XSLT conversion stylesheets.

Not quite sure if we should support this or not.

I keep this up for discussion for upcoming Developer Meeting:

Pro: - easy access to XMLFormat and to dump it as plain text file

Con: - once dumped on disk we have to support all different version of XMLFormat!

Btw. we should introduce a XMLformat compontent in TRAC.

Changed 3 months ago by prahal

This use OSYNC_CONVERTER_DECAP to prevent file-sync from using it by default to store its data.

  Changed 3 months ago by prahal

  • owner changed from dgollub to prahal

The patch also prevents

  Changed 3 months ago by prahal

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.