<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.mobile.synthesis">
    <title>gmane.comp.mobile.synthesis</title>
    <link>http://blog.gmane.org/gmane.comp.mobile.synthesis</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/714"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/713"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/712"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/711"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/710"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/709"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/708"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/707"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/706"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/705"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/704"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/703"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/702"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/701"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/700"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/699"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/698"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/697"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/696"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.mobile.synthesis/695"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/714">
    <title>Re: libsynthesis and SonyEricsson Xperia S ownSyncML client</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/714</link>
    <description>&lt;pre&gt;

:-)


This is a SyncML TK error code and means "Document does not conform to SyncML DTD". If you have console output for the library, you'll see the decoding messages there, along with some context where it happens. That would be useful.

By default, libsynthesis does not output console messages, but you can set the config variable "conferrpath" to "console" to have it on stdout or specify a file path for storing the console messages.


Apparently, the xperia has a number of small WBXML issues, so the most interesting part of the logs at this time would be the console messages with the SyncML TK output. Of course, the .html log might also give some more context.


Makes sense. Quoting only the essential lines here is probably most helpful for the list audience.

Best Regards,

Lukas
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-05-24T12:53:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/713">
    <title>Re: libsynthesis and SonyEricsson Xperia S own SyncML client</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/713</link>
    <description>&lt;pre&gt;That was due to one line bug in my HTTP server implementation. 
Authentication works OK after I fixed it. I'm getting however:

2012-05-24 13:19:11.528] Calling smlProcessData(NEXT_COMMAND)
[2012-05-24 13:19:11.528] ===&amp;gt; smlProcessData failed, returned 0x200B
–
[2012-05-24 13:19:11.528] 'SessionAbort' - Aborting Session, 
Status=20007, ProblemSource=LOCAL [--][++] [-&amp;gt;end] [-&amp;gt;enclosing]
[2012-05-24 13:19:11.528] WARNING: Aborting Session with Reason Status 
20007 (LOCAL problem) ***
[2012-05-24 13:19:11.528] --------------- Ignoring all commands in this 
message (after 0 sec. request processing, 0 sec. total) with Status 514 
(0=none) from here on
–
[2012-05-24 13:19:11.528] 'DSAbort' - Aborting datastore sync, 
abortStatusCode=20007, localProblem=yes, resumable=yes [--][++] [-&amp;gt;end] 
[-&amp;gt;enclosing]
[2012-05-24 13:19:11.528] events: testState=FALSE - expected 
state&amp;gt;='sync_set_ready', found state=='server_answered_alert'
–
[2012-05-24 13:19:11.528] 'SaveSuspendState' - Saving state for 
suspend/resume, datastore=events [--][++] [-&amp;gt;end] [-&amp;gt;enclosing]

I'll collect required data (logs, messages) and send them separately 
(perhaps no need to send them to the list).

Andris
&lt;/pre&gt;</description>
    <dc:creator>Andris Pavenis</dc:creator>
    <dc:date>2012-05-24T10:59:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/712">
    <title>Re: libsynthesis and SonyEricsson Xperia S ownSyncML client</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/712</link>
    <description>&lt;pre&gt;Hi Andris,

On 24.05.2012, at 08:33, Andris Pavenis wrote:


Yes, I see that, but I can't find the matching wbxml incoming message dump in the *.wbxml you sent. All those 4 don't have the Cred element, IMHO.


That's wrong on SE's part, and is certainly the reason why Wireshark does not recognize it as SyncML, but apparently is not be a problem for the SyncML TK decoder. If it was a problem, it would not decode anything in that message.

Best Regards,

Lukas
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-05-24T08:08:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/711">
    <title>Re: libsynthesis and SonyEricsson Xperia S own SyncML client</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/711</link>
    <description>&lt;pre&gt;It responds according with authentication to WireShark. Try using 
WireShark on capture file and decode port 9321 as HTTP.
wbxml2xml also fails to extract authentication information.

It seems however that public ID "//SYNCML//DTD SyncML 1.2//ENmlq\0031.2" 
instead of "//SYNCML//DTD SyncML 1.2//EN" also causes some problems. For 
example WireShark shows WBXML tag numbers instead of interpretting them 
as SyncML WBXML tags.

Forcing use of SyncML 1.2 for wbxml2xml does not help (wbxml2xml -l 
SYNCML12 ...)

Thanks.

Andris
&lt;/pre&gt;</description>
    <dc:creator>Andris Pavenis</dc:creator>
    <dc:date>2012-05-24T06:33:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/710">
    <title>Re: libsynthesis and SonyEricsson Xperia S ownSyncML client</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/710</link>
    <description>&lt;pre&gt;Hi Andris,

On 21.05.2012, at 15:43, Andris Pavenis wrote:


I found a bug which was causing this, and commited a fix in the luz branch (see https://gitorious.org/libsynthesis). The problem was that the XML encoder in the SyncML toolkit could not handle empty tags, but the SonyEricsson devInf contains a &amp;lt;OEM&amp;gt;&amp;lt;/OEM&amp;gt; empty tag.

So now the XML conversion of the messages you captured from the Xperia-S (aka LT26i) now work ok.

However, this does not explain the auth problems.


I don't see any authentication in the incoming messages, not in the XML translation and also not when looking at hexdumps of the WBXML. The only thing I see is the &amp;lt;LocName&amp;gt; test, but that's not enough for an auth attempt, there must be some credentials.

It is valid (or even recommended) for a device to try first without any credentials to see what auth method the server requests.

So the first of these attempts is perfectly ok, and the server responds with an authentication challenge for MD5 auth, which is the secure method which does not require user/pw to be transmitted over the line, but only a hash.

However, for some reason the LT26i does not respond to that challenge, but retries the "probe" again.

One reason for this could be that the device does not actually get the response, but just some transport level error, and thus just resends it's first message serveral times.
You said that there was some problem with chunked transport encoding - maybe there's a similar problem in the other direction such that the server result arrives garbled at the phone's end?


I recommend using the luz branch for testing - as it is always ahead of master and contains the latest patches before they are in master.

Best Regards,

Lukas
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-05-23T14:05:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/709">
    <title>libsynthesis and SonyEricsson Xperia S own SyncMLclient</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/709</link>
    <description>&lt;pre&gt;Tried to test whether synchronization works with Xperia-S own SyncML 
client (comes with Android 2.3.7 installed on phone, software version 
6.0.A.3.73) using custom libsynthesis based SyncML server.

- the first problem was chunked transport encoding use by phone software 
initially not supported by mentioned above server software. It was 
however easy enough to fix.
- the next problem is failure of libsynthesis to get authentication 
information sent by phone extracted from messages. Also decoded incoming 
WBXML messages saved into XML format are corrupt. For unknown reason the 
client tries to synchronize at first without authentication even when 
both user name and password are specified in its configuration. 
Authentication is first provided in second attempt of 4 totally. 3 of 4 
incoming WBXML format packets seems to contain authentication 
information but also wbxml2xml does not show it

I'm including:
- wireshark capture of communications between client and server (local 
WLAN used)
- HTML format logs of all 4 attempts
- WBXML messages and decoded (at least tried) XML messages
- server output which allows to identify the order of SyncML sessions

as attached xz packed tar archive

Last tests was done with current GIT version of libsynthesis from master 
branch.

Andris

PS. To be sure verified also that the same server works OK with 
Synthesis SyncML PRO Client for Android version 2.3.2 on ZTE Blade.




_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
&lt;/pre&gt;</description>
    <dc:creator>Andris Pavenis</dc:creator>
    <dc:date>2012-05-21T13:43:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/708">
    <title>Re: scripts + datastore</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/708</link>
    <description>&lt;pre&gt;
Thanks, that worked.

&lt;/pre&gt;</description>
    <dc:creator>Patrick Ohly</dc:creator>
    <dc:date>2012-05-02T14:14:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/707">
    <title>Re: scripts + datastore</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/707</link>
    <description>&lt;pre&gt;Hello Patrick,

On Apr 25, 2012, at 15:11 , Patrick Ohly wrote:


The problem is that CTCap is not necessarily tied to a datastore. It is since SyncML 1.2, but wasn't before. That's also the reason why getRelatedDatastore() can be NULL. It is also NULL when using a type from a script with the MAKETEXTWITHPROFILE et. al. functions.


&amp;lt;insert English word for "Jein"&amp;gt;. The datatype context indeed exists only once per type, so the script variables exist only once.
However, the init script might be called more than once if multiple datastores are using the same type. The TScriptContext object will be the same, but script functions that use fDsP (see below) can return different information. So using these in the initscript usually makes no sense.


For getting the local datastore related to a particular script invocation, there is

  TLocalEngineDS *related = static_cast&amp;lt;TMultiFieldItemType *&amp;gt;(aFuncContextP-&amp;gt;getCallerContext())-&amp;gt;fDsP;

fDsP is one of several variables I'd call "current type usage context", fCurrentSyncOp which feeds the SYNCOP() script function is another one of them (See multifielitemtype.h Line 202 ff).


from fDsP you'd get the pointer to the local datastore (TLocalEngineDS *).

So to reach the remote datastore from a given TMultiFieldItem (which you certainly have at comparescript), I'd rather use

  yourMultiFieldItem-&amp;gt;getRemoteItemType-&amp;gt;getRelatedDatastore()

to get to the datastore that has defined that item's remote type. As said, in SyncML 1.1/1.0 cases you'd get NULL back because the devInf does not associate types with datastores at all. But I'd assume your extension does not have to work below 1.2, so that'll be no problem.

Best Regards,

Lukas
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-04-27T14:27:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/706">
    <title>scripts + datastore</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/706</link>
    <description>&lt;pre&gt;Hello!

I am trying to solve one issue in SyncEvolution: when trying to find
pairs, it needs to know on a per-datastore basis whether both remote and
local storage have truly unique UID/RECURRENCE-ID that can be relied
upon (iCalendar 2.0 semantic).

So far, I am using a compare script for that, but it has to make
assumptions about the peer. To overcome that I added code that allows
clients to add SyncCap entries to the CTCap (similar to the "can restart
flag"). This information is stored at the receiving end in the
TSyncDataStore base class by the TRemoteDataStore while parsing the
SyncCap (again, very similar to "fCanRestart").

But now my problem is: how can the compare script access that
information?

It runs inside the "datatype context". Does that mean that all
datastores sharing the same type also share the same context and that
the &amp;lt;initscript&amp;gt; for the type is only invoked once?

The script functions in multifielditemtype.cpp (like SYNCOP()) looked
promising. It's possible to get a pointer to some kind of datastore:

TSyncDataStore *related = static_cast&amp;lt;TMultiFieldItemType *&amp;gt;(aFuncContextP-&amp;gt;getCallerContext())-&amp;gt;getRelatedDatastore();

But in practice that pointer is always NULL. I wasn't sure anyway
whether I would get the pointer to the local or remote datastore.

Any hints?

&lt;/pre&gt;</description>
    <dc:creator>Patrick Ohly</dc:creator>
    <dc:date>2012-04-25T13:11:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/705">
    <title>Re: Sync server with oracle database</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/705</link>
    <description>&lt;pre&gt;
It would be pretty hard. The HTTP server in SyncEvolution is written in
Python using the Twisted framework and depends on the D-Bus API provided
by the SyncEvolution core, so one also inherits all the rest of
SyncEvolution (own configuration system, backends, etc.).

For writing one's own server, the Synthesis SDK and server will be
easier.

&lt;/pre&gt;</description>
    <dc:creator>Patrick Ohly</dc:creator>
    <dc:date>2012-04-24T08:52:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/704">
    <title>Re: Sync server with oracle database</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/704</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Apr 23, 2012, at 4:06 , zhou lei wrote:


It depends on how complicated your database schema is. If you can map the fields from the &amp;lt;fieldlist&amp;gt; more or less 1:1 to fields in your database, this is indeed easy to do with libsynthesis. You can do the mapping in the XML config, with no need to code anything in Java.
You'd need to install the ODBC driver for Oracle though, as libsynthesis uses ODBC to connect to databases.


Not based on libsynthesis at this time.

Synthesis still provides a full server as a commercial product, and there are free demo and eval packages of a complete server you can download from their site. The database connection part of these is exactly the same as in opensource libsynthesis, so to check if integration with your Oracle DB works you could use the Synthesis EVAL version.
After that, it'll be a make or buy decision wether you want to license the server from them, or build your own based on libsynthesis. The database connection will be the same.

To make a server out of libsynthesis, what needs to be done outside libsynthesis is the connection to the HTTP transport, and session handling (SyncML session objects must be kept around between HTTP requests until the entire session completes or is aborted).

The opensource SyncEvolution project has done this, however SyncEvolution has quite some complexity of its own so I don't know how easy it would be to use the HTTP transport code from SyncEvolution.

Best Regards,

Lukas Zeller, plan44.ch
luz-DkgZRUgWWJ3tRgLqZ5aouw&amp;lt; at &amp;gt;public.gmane.org - www.plan44.ch
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-04-23T20:23:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/703">
    <title>Sync server with oracle database</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/703</link>
    <description>&lt;pre&gt;Hi, Lukas

I am working on Funambol server for a week, and it just could not connect
to the oracle db. And I am not good at java, and using maven an ant is not
that easy.
And I was think about that, if using the libsynthesis it could be easy,
dosen't it?
Is there a usefull demo server for linux ?  If there isn't, how could i
make it?

Thanks
regards
-zhoulei
_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
&lt;/pre&gt;</description>
    <dc:creator>zhou lei</dc:creator>
    <dc:date>2012-04-23T02:06:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/702">
    <title>Re: The sync works now. But some other problemsabout the set value.</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/702</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Apr 1, 2012, at 4:16 , zhou lei wrote:


Glad to hear it works now!


The TEL_FLAGS is just an integer field used as a bitmap to create the TYPE parameter. So bit 0 set will add HOME, bit 1 WORK etc.

So to make a TEL;TYPE=WORK:123456789 telephone number (all three the same in this sample), you would something like:

     // - strings in an array
     sInt32 telFieldID = [aItemKey valueIDByName:"TEL"];
     sInt32 telFlagsID = [aItemKey valueIDByName:"TEL_FLAGS"];
     for (int i=0; i&amp;lt;3; i++) {
       [aItemKey setStringValueByID:telFieldID arrayIndex:i toValue:&amp;lt; at &amp;gt;"123456789"];
       [aItemKey setIntValueByID:telFieldID arrayIndex:i toValue:(1&amp;lt;&amp;lt;1)]; // set bit 1 to make it a WORK number
     }

The other fields, "TEL_LABEL" and "TEL_ID" are to support the custom label feature of the iOS address book, and also to expose the iOS ID of the array elements. If you have your own address book database, you probably don't need these and you could remove these extra fields from the XML config as well.

Please also have a look at the conversion modes and options around page 81 of the "doc/SySync_config_reference.pdf". Also, on page 86 there is a much simpler example of how to map telephone numbers to a few fixed fields (instead of arrays). Depending on your address book, that might make more sense to implement, rather than using the complex mapping needed for the iOS address book which can hold a variable number of TELs for each contact and has custom labels and IDs.

Best Regards,

Lukas Zeller
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-04-01T13:14:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/701">
    <title>The sync works now. But some other problems aboutthe set value.</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/701</link>
    <description>&lt;pre&gt;Hi, Lukas

I just try it as what to told me to do, and the client works. Thank you
very much.

For property "TEL" in the vcard, it just has too many enum values, how
could i set the "TEL" value with its enum flags. If only set it by the
setstringvaluebyname, It may use the default one, but i want to set it
myself.

Thanks
Best Regards
-Zhoulei
_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
&lt;/pre&gt;</description>
    <dc:creator>zhou lei</dc:creator>
    <dc:date>2012-04-01T02:16:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/700">
    <title>Re: os-libsynthesis Digest, Vol 33, Issue 9</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/700</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Mar 31, 2012, at 11:12 , zhou lei wrote:


Exactly. The terms in the plugin are all meant towards the database.


I would really discourage using a mixture of ObjC and parts from the C++ examples. The ObjC wrapper was done exactly because dealing with the fCB and it's members directly is difficult, and you need to do all the memory management on your own.

EXC_BAD_ACCESS is a bus error which is hard to debug, especially as two completely different memory management systems need to cooperate here (ObjC refcounted world with C++/C traditional malloc/free world).

The ObjC wrapper classes however are really simple to use from the ObjC world.

I made a skeleton for the two read* methods to show how to easily access fields from ObjC, without any messing with fCB, and with automatic conversion from NSString (the SettingsKey also gives you convenience methods to access dates as NSDate and integers).


- (TSyError)readNextItemAsKey:(SettingsKey *)aItemKey
  itemIdP:(NSString **)aItemIdP parentIdP:(NSString **)aParentIdP
  statusP:(sInt32 *)aStatusP
  isFirst:(BOOL)aFirst
{
  TSyError sta = LOCERR_OK;

  [self debugOut:[NSString stringWithFormat:&amp;lt; at &amp;gt;"readNextItemAsKey: aFirst=%d", aFirst]];
  // read next item from DB
  if (aFirst) {
    // %%% reset iterator over dataset here
  }
  // get next item
  BOOL found = NO;
  do {
    if (/* %%% no more data items */) {
      *aStatusP = ReadNextItem_EOF;
      break;
    }
    else {
      found = YES;
      // %%% get IDs of records from the database
      //     Note: data is not required at this point, however, if the database is such
      //           that it always reads the data anyway when getting the IDs, the data
      //           CAN be OPTIONALLY read here already (see below)

      NSString *localID = /* %%%% item ID as string */ &amp;lt; at &amp;gt;"dummyID";
      *aItemIdP = localID;

      // %%% find out if it has modified since last time
      if (/* %%% modified since last suspend */)
        *aStatusP = ReadNextItem_Resumed; // changed since last resume (implies changed since last sync also)
      else if (/* %%% modified since last completed sync session */)
        *aStatusP = ReadNextItem_Changed; // changed since last sync (but NOT since last resume)
      else
        *aStatusP = ReadNextItem_Unchanged; // not changed, but caller wants to see all records


      // %%% optionally, you can ready actual item data from the DB here and return it. If you don't deliver
      //     data here, the engine will later call readItemAsKey to get the data

      // %%% just set some sample properties
      // - simple strings
      [aItemKey setStringValueByName:"N_FIRST" toValue:/* dummy first name */ &amp;lt; at &amp;gt;"Theodor"];
      [aItemKey setStringValueByName:"N_LAST" toValue:/* dummy last name */ &amp;lt; at &amp;gt;"Tester"];

      // - strings in an array
      sInt32 telFieldID = [aItemKey valueIDByName:"TEL"];
      for (int i=0; i&amp;lt;3; i++) {
        [aItemKey setStringValueByID:telFieldID arrayIndex:i toValue:/* dummy TEL */ &amp;lt; at &amp;gt;"12345 78 90"];
      }

      // %%% advance iterator to next item (such that next item will be delivered on next call to reasNextItemAsKey
    }
  } while (!found);
  // done
  return sta;
}




- (TSyError)readItemAsKey:(SettingsKey *)aItemKey
  itemID:(NSString *)aItemID parentID:(NSString *)aParentID
{
  TSyError sta = LOCERR_OK;

  [self debugOut:[NSString stringWithFormat:
    &amp;lt; at &amp;gt;"readItemAsKey: itemID=%&amp;lt; at &amp;gt; parentID=%&amp;lt; at &amp;gt;",
    aItemID, aParentID
  ]];

  // %%% read item identified by NSString in aItemID from DB

  if (/* %%% found item with ID aItemID*/) {

    // %%% just set some sample properties
    // - simple strings
    [aItemKey setStringValueByName:"N_FIRST" toValue:/* dummy first name */ &amp;lt; at &amp;gt;"Theodor"];
    [aItemKey setStringValueByName:"N_LAST" toValue:/* dummy last name */ &amp;lt; at &amp;gt;"Tester"];

    // - strings in an array
    sInt32 telFieldID = [aItemKey valueIDByName:"TEL"];
    for (int i=0; i&amp;lt;3; i++) {
      [aItemKey setStringValueByID:telFieldID arrayIndex:i toValue:/* dummy TEL */ &amp;lt; at &amp;gt;"12345 78 90"];
    }

  }
  else {
    // item not found
    sta = DB_NotFound;
  }
  // done
  return sta;
}



Best Regards,

Lukas

PS: please make sure to Cc: your replies to the mailing list (Synthesis &amp;lt;os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;) as well, and not only to me, so everyone on the list can follow the conversation.
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-03-31T11:14:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/699">
    <title>Re: os-libsynthesis Digest, Vol 33, Issue 9</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/699</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Mar 29, 2012, at 5:45 , zhou lei wrote:


That's correct. However, I tried it myself and as you found, there's still that Error 20010, which means that something is wrong in the XML config.
Unfortunately, the sample app did not output the config error messages to the console as it should have. I fixed this, please see the lastest commit in the luz branch on gitorious (the config variable "conferrpath" must be set to "console"). With this, the XCode debug console shows what is the problem:

 Fatal: Module does not understand params passed in &amp;lt;plugin_params&amp;gt;

This is because the sample uses the &amp;lt;datafilepath&amp;gt; &amp;lt;plugin_param&amp;gt;, which is specific to the SDK_textdb plugin, and is not understood by the dummy plugins. So just comment out or remove the entire &amp;lt;plugin_param&amp;gt;, and the sync engine will initialize correctly.

In the same commit, I also added a line to enable syncml engine logs to tmp/sysynclogs for DEBUG builds, so it is easier to get started with the sample and see what the SyncML engine is doing.


The prefs_path just returns the default directory for the platform to store preferences, so you can use it in the XML config or your app to avoid hard-coded paths. 


You just need to set the &amp;lt;sqlitefile&amp;gt; to a path where your SQLite database is. You could use the $(prefs_path) variable to specifiy that path relative to the default preferences location, but you can also use a absolute path. The SyncMLClient class defines a config variable called $(sandbox) to contain the App's sandbox directory, because that's usually the starting point you need.

So usually you would define the SQLlite file like:

  &amp;lt;sqlitefile expand="yes"&amp;gt;$(sandbox)/Library/mydatafile.sqlitedb&amp;lt;/sqlitefile&amp;gt;


The entire point in libsynthesis is that you can adapt it to your own databases.
If the sync should be with one of the iOS built-in data sources, there are the (quite complex) commerical plugins for iOS contacts and iOS calendar.

If you want to design your own address book, it's up to you to design an alternate address book database.


Sync is complex - there's no easy way. SyncML sync is also a niche, and the iOS opensourcing is quite new. I admit that there's no good tutorial yet, but then, this is OpenSource and anyone is welcome to contribute more samples and docs. If I had to write step by step tutorials myself before opensourcing it, libsynthesis wouldn't be opensource yet. What I'm providing is 10 years of condensed SyncML knowhow, in a library that hides a huge amount of complexity from the user, but still admittedly remains non-trivial, and thus needs some diggin in to learn.


The demo as provided does work on iOS, and as you see I try to improve it to make it more accessible and easier to modify. However, I do this unpaid, and writing all that you seem to expect to just be there would take a lot of time. Opensource works by everyone contributing to a project what he or she thinks is missing, not by one party providing everything for everyone else to use for free.
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-03-29T09:32:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/698">
    <title>Re: os-libsynthesis Digest, Vol 33, Issue 9</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/698</link>
    <description>&lt;pre&gt;Hello,

On Mar 28, 2012, at 5:47 , zhou lei wrote:


It depends on what you want to do. Of course, if you need to get Google contacts, there's no choice. But otherwise, there are many services and software that support SyncML - have a look at the wikipedia article for a extensive list: SyncML Wikipedia article


20010 is a XML parsing error (see doc/SySync_config_reference.pdf, page 200). 


Probably because of the XML error, the engine never gets as far to instantiate the plugins.

Best Regards,

Lukas Zeller, plan44.ch
luz-DkgZRUgWWJ3tRgLqZ5aouw&amp;lt; at &amp;gt;public.gmane.org - www.plan44.ch
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-03-28T15:48:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/697">
    <title>Re: os-libsynthesis Digest, Vol 33, Issue 9</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/697</link>
    <description>&lt;pre&gt;Hi, Lukas

If the google sync is not the good one,  which sync server would be better?
If i set the plugin_module to "iPhone_dbplugin1" the client get a 20010
error code.why?
You told me that just modify the code in the sample_dbplugin1.mm.,like "
readItemAsKey". But I found out that, the functions would never been called
in the class of "SamplePluginDB1", even the class "SamplePluginDB1" never
init by the engine.

Thanks
Regards
-Zhoulei

2012/3/23 &amp;lt;os-libsynthesis-request-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
&lt;/pre&gt;</description>
    <dc:creator>zhou lei</dc:creator>
    <dc:date>2012-03-28T03:47:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/696">
    <title>Re: os-libsynthesis Digest, Vol 33, Issue 6</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/696</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Mar 19, 2012, at 3:57 , zhou lei wrote:


Be careful and don't expect too much, Google contact sync is one of the less stellar SyncML implementations :-(


If you use SQLite, you don't need to write your own plugin. libsynthesis has built-in SQLite3 interface, all you need is creating a so-called mapping between the &amp;lt;fields&amp;gt; in the &amp;lt;fieldlist&amp;gt; and your actual database fields. This is done in the &amp;lt;fieldmap&amp;gt; section of the &amp;lt;datastore&amp;gt; in the XML config.

Have a look at  /src/sysync_SDK/configs/sunbird_client.xml, this is a sample of an interface to a SQLite3 backend. The sample looks a bit complicated because of the large scripts handling all the special cases with exceptions etc., but for a plain contact database you probably will not need any scripts at all, so just a few lines of &amp;lt;map&amp;gt; definitions will do.


All you need to do is filling actual DB access code into the methods in sample_dbplugin1.mm that have a comment with //%%% todo, starting with startDataReadWithLastToken.

The wrapper code handles all the rest, instantiates the module and database contexts, and calls the methods you find in sample_dbplugin1.mm.

Best Regards,

Lukas Zeller, plan44.ch
luz-DkgZRUgWWJ3tRgLqZ5aouw&amp;lt; at &amp;gt;public.gmane.org - www.plan44.ch
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-03-22T15:11:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/695">
    <title>Re: what's deference between dbplugin for cocoaand for cpp</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/695</link>
    <description>&lt;pre&gt;Hi Zhoulei,

On Mar 20, 2012, at 10:31 , zhou lei wrote:


This is the C++ branch of things, it is not relevant for iOS (except maybe for general understanding of how the library works on other platforms).


dbplugin_cocoa.m is the wrapper code that handles the somewhat tricky interface between C and ObjC for you. No need to edit this.

The actual plugin code to write will go into sample_dbplugin1.mm (2,3,4...).

All you need to do is implementing the following methods:

- (TSyError)startDataReadWithLastToken:(cAppCharP)aLastToken andResumeToken:(cAppCharP)aResumeToken;

- (TSyError)readNextItemAsKey:(SettingsKey *)aItemKey
  itemIdP:(NSString **)aItemIdP parentIdP:(NSString **)aParentIdP
  statusP:(sInt32 *)aStatusP
  isFirst:(BOOL)aFirst;

- (TSyError)readItemAsKey:(SettingsKey *)aItemKey
  itemID:(NSString *)aItemID parentID:(NSString *)aParentID;

- (TSyError)endDataRead;

- (TSyError)startDataWrite;

- (TSyError)insertItemAsKey:(SettingsKey *)aItemKey
  parentID:(NSString *)aParentID newItemIdP:(NSString **)aNewItemIdP;

- (TSyError)updateItemAsKey:(SettingsKey *)aItemKey
  itemIdP:(NSString **)aItemIdP parentIdP:(NSString **)aParentIdP;

- (TSyError)deleteItem:(NSString *)aItemID parentID:(NSString *)aParentID;

- (TSyError)endDataWriteWithSuccess:(BOOL)aSuccess andNewToken:(NSString **)aNewTokenP;

...plus maybe some of the optional methods if you have advanced features like filtering (but probably not to start with).

These are semantically 1:1 representations in ObjC of the functions you find described in more detail in doc/SDK_manual.pdf and also in the C++ samples. Because of the work the wrapper code does for you, it is only a small subset of what the C plugin ABI consists of. Things like module/db context creation/deletion is done in the wrapper.

One important note: the Cocoa wrapper code only uses the "AsKey" variants from the plugin API. This means that rather than passing items as text strings, a SettingsKey object is passed, on which you can call methods like stringValueByName: / setStringValueByName:toValue: to access individual fields (see SettingsKey.h for all available access methods). Note that this is the same mechanism as for accessing settings, and you'll find examples for SettingsKey usage in the sample iOS app.

Best Regards,

Lukas Zeller, plan44.ch
luz-DkgZRUgWWJ3tRgLqZ5aouw&amp;lt; at &amp;gt;public.gmane.org - www.plan44.ch
&lt;/pre&gt;</description>
    <dc:creator>Lukas Zeller</dc:creator>
    <dc:date>2012-03-22T15:09:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.mobile.synthesis/694">
    <title>what's deference between dbplugin for cocoa andfor cpp</title>
    <link>http://permalink.gmane.org/gmane.comp.mobile.synthesis/694</link>
    <description>&lt;pre&gt;Hi all

We can find "snowwhite" in the doc of the libsynthesis, and in the file
named "dbapi.cpp" we can find it too. And from the demo for IOS, We can
find out that, in cocoa, the lib would using the code in
"dbplugin_cocoa.m". There I found the c functions, like
Module_createContext, and the class snowwhite has these functions too. So I
just think about that could I modefy the dbplugin in the ios demo make it
works like "snowwhite" in cpp. But I cant find out want the session means
in the "snowwhite", and in the dbplugin_cocoa there is a function named
"Session_CreateContext", but do nothing.

Module_CreateContext create the new pluginModule, and init the db with
newpluinDBWithName, but how to init a session. Could anyone can give a
usefull dbplugin?

Thanks
Regards
-Zhoulei
_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA&amp;lt; at &amp;gt;public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
&lt;/pre&gt;</description>
    <dc:creator>zhou lei</dc:creator>
    <dc:date>2012-03-20T09:31:35</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.mobile.synthesis">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.mobile.synthesis</link>
  </textinput>
</rdf:RDF>

