﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-风雨中漂泊,世俗里浪迹-文章分类-syncml</title><link>http://www.cppblog.com/lihaoyxj/category/10595.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 31 May 2009 13:19:11 GMT</lastBuildDate><pubDate>Sun, 31 May 2009 13:19:11 GMT</pubDate><ttl>60</ttl><item><title>funambol的client api简介</title><link>http://www.cppblog.com/lihaoyxj/articles/83282.html</link><dc:creator>李浩</dc:creator><author>李浩</author><pubDate>Mon, 18 May 2009 07:27:00 GMT</pubDate><guid>http://www.cppblog.com/lihaoyxj/articles/83282.html</guid><wfw:comment>http://www.cppblog.com/lihaoyxj/comments/83282.html</wfw:comment><comments>http://www.cppblog.com/lihaoyxj/articles/83282.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lihaoyxj/comments/commentRss/83282.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lihaoyxj/services/trackbacks/83282.html</trackback:ping><description><![CDATA[<p>/********************此文可以被转发，但请转发者保留作者的署名权<br>
****李浩<br>
****msn:lihao_nx@hotmail.com<br>
****<br>
****email:lihaoyxj@gmail.com<br>
****出处:lihaoyxj.cublog.cn</p>
<p>&nbsp;&nbsp;&nbsp; http://www.cppblog.com/lihaoyxj,cublog太不稳定，挪个窝<br>
*******************************************************/</p>
<p>在以上篇幅中介绍了开源库FUNAMBOL，本节中介绍一下，使用funambol的client api。</p>
<p>
funambol的客户端在https://www.forge.funambol.org/download/index.zh-cn.html有相关
的安装包下载，它包含了windows,windows mobile,black berry,所有支支持j2me的平台下的客户端。<br>
</p>
<p>笔者在进行基于symbian部分客户端开发时，funambol还没有提供 symbian的源码。故在对funambol windows mobile的源码进行了分析，以funambol c++ api开发出了symbian的SYNCML客户端。<br>
</p>
<p>笔者认为，开发基于funambol client api最主要的类为二个：DMTClientConfig用于配置同步项；SyncSourc用于同步在前边所配置的同步项。</p>
<p>&nbsp;DMTClientConfig在这里就不进行过多介绍。</p>
<p>&nbsp;由于SyncSource类为虚类，那么在你的客户端中就要去实现它的相关方法，方法清单如下：</p>
<p>&nbsp;SyncItem* getFirstItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the next SyncItem of all.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * It is used in case of slow or refresh sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the entire data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getNextItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the first SyncItem of new one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getFirstNewItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the next SyncItem of new one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getNextNewItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the first SyncItem of updated one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getFirstUpdatedItem() ;<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the next SyncItem of updated one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getNextUpdatedItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the first SyncItem of updated one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getFirstDeletedItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the next SyncItem of updated one. It is used in case of fast sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve the new data source content.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getFirstItemKey();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Return the key of the next SyncItem of all.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * It is used in case of refresh sync<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and retrieve all the keys of the data source.<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getNextItemKey();<br>
<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SyncItem* getNextDeletedItem();<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; void setItemStatus(const WCHAR* key, int status);<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int addItem(SyncItem&amp; item);<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int updateItem(SyncItem&amp; item);<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int deleteItem(SyncItem&amp; item);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int removeAllItems(); //Not implemented<br>
<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int beginSync();<br>
<br>
</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; int endSync();</p>
只要实现了这些方法，那么意味着你的客户端实现了<img src ="http://www.cppblog.com/lihaoyxj/aggbug/83282.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lihaoyxj/" target="_blank">李浩</a> 2009-05-18 15:27 <a href="http://www.cppblog.com/lihaoyxj/articles/83282.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>