Ticket #753 (closed task: fixed)

Opened 6 years ago

Last modified 6 years ago

Get rid of osxml API

Reported by: dgollub Owned by: dgollub
Priority: normal Milestone: 0.37
Component: OpenSync Version: 0.36
Severity: normal Keywords:
Cc: bricks

Description

Get rid of entire osxml_ API and replace it entirely by osync_xmlfield_ and osync_xmlforamt_ Even format plugins should use osync_xmlfield_/osync_xmlformat_ if needed.

Change History

comment:1 follow-up: ↓ 2 Changed 6 years ago by bricks

Currently OSyncXMLFormat uses osync_xml_validate_document to validate against a XML schema file. Should that also be replaced? Do you want to remove all the osync_xml_ functions? Maybe it is possible to bypass http://article.gmane.org/gmane.comp.misc.opensync.devel/2794 in the same step.

comment:2 in reply to: ↑ 1 Changed 6 years ago by dgollub

Replying to bricks:

Currently OSyncXMLFormat uses osync_xml_validate_document to validate against a XML schema file. Should that also be replaced? Do you want to remove all the osync_xml_ functions? Maybe it is possible to bypass http://article.gmane.org/gmane.comp.misc.opensync.devel/2794 in the same step.

Good point. Yes, i would be great if we got remove all osync_xml_ functions. Moving osync_xml_validate_document() complete to osync_xmlformat_validate() hopefully doesn't cause any problems. (Maybe we have adjust some unittests?)

comment:3 Changed 6 years ago by dgollub

  • Cc bricks added
  • Status changed from new to closed
  • Resolution set to fixed

Implementation by bricks: (r3362), r3366, r3367, r3368, r3369, r3370

comment:4 follow-up: ↓ 5 Changed 6 years ago by bricks

  • Status changed from closed to reopened
  • Resolution fixed deleted

Not finished and committed yet. Daniel could you please review my last patch http://www.nabble.com/Re%3A-osync_xmlformat_validate()-in-format-plugins-p18131202.html

Also the palm plugin needs some updates to remove osxml function calls.

grep -inHR --exclude-dir .svn osxml *

palm/src/palm_format.c:104:	xmlNode *root = osxml_node_add_root(doc, "vcal");
palm/src/palm_format.c:368:		osxml_node_add(current, "Category", tmp);
palm/src/palm_format.c:376:	osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s",
osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil");
palm/src/palm_format.c:390:	osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", 
osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil");
palm/src/palm_format.c:413:	root = osxml_get_node(root, "Event");
palm/src/palm_format.c:438:	xmlNode *cur = osxml_get_node(root, "Description");
palm/src/palm_format.c:446:	cur = osxml_get_node(root, "Summary");
palm/src/palm_format.c:454:	cur = osxml_get_node(root, "DateStarted");
palm/src/palm_format.c:456:		cur = osxml_get_node(cur, "Content");
palm/src/palm_format.c:486:	cur = osxml_get_node(root, "DateEnd");
palm/src/palm_format.c:488:		cur = osxml_get_node(cur, "Content");
palm/src/palm_format.c:517:	cur = osxml_get_node(root, "Alarm");
palm/src/palm_format.c:522:		xmlNode *sub = osxml_get_node(cur, "AlarmTrigger");
palm/src/palm_format.c:524:			sub = osxml_get_node(sub, "Content");
palm/src/palm_format.c:611:	cur = osxml_get_node(root, "RecurrenceRule");
palm/src/palm_format.c:725:	xmlXPathObject *xobj = osxml_get_nodeset((xmlDoc *)input, "/vcal/Event/ExclusionDate");
palm/src/palm_format.c:733:		cur = osxml_get_node(cur, "Content");
palm/src/palm_format.c:746:	cur = osxml_get_node(root, "Categories");
palm/src/palm_format.c:993:	xmlNode *root = osxml_node_add_root(doc, "vcal");
palm/src/palm_format.c:1064:		osxml_node_add(current, "Category", tmp);
palm/src/palm_format.c:1072:	osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil");
palm/src/palm_format.c:1088:	osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil");
palm/src/palm_format.c:1103:	root = osxml_get_node(root, "Todo");
palm/src/palm_format.c:1121:	xmlNode *cur = osxml_get_node(root, "Priority");
palm/src/palm_format.c:1139:	cur = osxml_get_node(root, "Completed");
palm/src/palm_format.c:1144:	cur = osxml_get_node(root, "Summary");
palm/src/palm_format.c:1152:	cur = osxml_get_node(root, "Description");
palm/src/palm_format.c:1160:	cur = osxml_get_node(root, "DateDue");
palm/src/palm_format.c:1169:	cur = osxml_get_node(root, "Categories");
palm/src/palm_format.c:1953:	xmlNode *root = osxml_node_add_root(doc, "Note");
palm/src/palm_format.c:1980:		osxml_node_add(current, "Category", tmp);
palm/src/palm_format.c:1988:	osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil");
palm/src/palm_format.c:2007:	osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil");
palm/src/palm_format.c:2029:	cur = osxml_get_node(root, "Summary");
palm/src/palm_format.c:2034:	cur = osxml_get_node(root, "Body"); 
palm/src/palm_format.c:2047:	cur = osxml_get_node(root, "Categories");

comment:5 in reply to: ↑ 4 Changed 6 years ago by dgollub

Replying to bricks:

Not finished and committed yet. Daniel could you please review my last patch http://www.nabble.com/Re%3A-osync_xmlformat_validate()-in-format-plugins-p18131202.html

Replied: http://article.gmane.org/gmane.comp.misc.opensync.devel/2883

Also the palm plugin needs some updates to remove osxml function calls.

[...] I created for this a ticket: #772

comment:6 Changed 6 years ago by bricks

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

Committed in r3427, r3428 and r3432

Note: See TracTickets for help on using tickets.