Ticket #572 (closed defect: fixed)

Opened 7 years ago

Last modified 4 years ago

vconvert does not convert xml-format back to vcard

Reported by: felixmoeller Owned by: prahal
Priority: normal Milestone: OpenSync 0.40
Component: OpenSync 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 6 years ago.
This use OSYNC_CONVERTER_DECAP to prevent file-sync from using it by default to store its data.

Change History

comment:1 Changed 7 years ago by cstender

  • Status changed from new to assigned
  • Milestone set to OpenSync 0.40

comment:2 Changed 6 years 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.

comment:3 Changed 6 years ago by cstender

Sorry, I mean r2499.

comment:4 Changed 6 years 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.

comment:5 follow-up: ↓ 6 Changed 6 years 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?

comment:6 in reply to: ↑ 5 Changed 6 years 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.

comment:7 Changed 6 years 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 6 years ago by prahal

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

comment:8 Changed 6 years ago by prahal

  • Owner changed from dgollub to prahal

The patch also prevents

comment:9 Changed 6 years ago by prahal

  • Status changed from new to closed
  • Resolution set to fixed

comment:10 Changed 4 years ago by sim

decoration Changed 1 year ago by admin

bathtub Changed 1 year ago by admin

solar system Changed 1 year ago by admin

stair parts Changed 1 year ago by admin

solar supply Changed 1 year ago by admin

Note: See TracTickets for help on using tickets.