Synthesis AG - SyncML Discussion Forum

Synthesis AG - SyncML Discussion Forum (http://forum.synthesis.ch/index.php)
-   SyncML Servers (Linux, Windows, MacOS X) (http://forum.synthesis.ch/forumdisplay.php?f=3)
-   -   Problem with array field mapping (http://forum.synthesis.ch/showthread.php?t=1966)

spiky 2009-10-28 10:13

Problem with array field mapping
 
Hello,

We have a problem with array fields. I am trying to create a master/detail structure for instance for vcard URL elements.

Here is a fragment of my <fieldlist> declaring the array field:

---------------------
<!-- organisation -->
<field name="ORG_NAME" type="string" compare="slowsync" merge="fillempty"/>
<field name="ORG_DIVISION" type="string" compare="conflict" merge="fillempty"/>

<!-- web addresses -->
<field name="WEBS" array="yes" type="url" compare="never" merge="fillempty"/>
---------------------

And the property in <mimeprofile>:

---------------------
<property name="URL">
<value field="WEBS"/>
<position repeat="array"/>
</property>
---------------------

Fraction from <fieldmap>:

----------------------
<array sizefrom="WEBS">

<selectarraysql>SELECT %N FROM web WHERE contactid = %k</selectarraysql>
<insertelementsql>INSERT INTO web (contactid,%N) VALUES (%k,%v)</insertelementsql>
<deletearraysql>DELETE FROM web WHERE contactid = %k</deletearraysql>

<maxrepeat>0</maxrepeat> <!-- no limit, we are using dynamic array fields -->
<repeatinc>1</repeatinc>
<storeempty>no</storeempty>

<map name="web" references="WEBS" type="string" mode="rw" size="127"/>
</array>
---------------------

With this configuration the first URL goes into the DIVISION field. As seen from the log:

----------------------
[2009-10-28 09:50:22] Item_Parse - parsing SyncML item, SyncOp=add, RemoteID=7
[2009-10-28 09:50:22] Created new item of datatype 'vcard21', localID='' remoteID='7'
[2009-10-28 09:50:22] Parsing:
[2009-10-28 09:50:22] BEGIN:VCARD
[2009-10-28 09:50:22] VERSION:2.1
[2009-10-28 09:50:22] REV:20091027T153120Z
[2009-10-28 09:50:22] N:Simpson;Homer;;;
[2009-10-28 09:50:22] TEL;CELL:+1125551234
[2009-10-28 09:50:22] TEL;VOICE:*1135554321
[2009-10-28 09:50:22] EMAIL;INTERNET;ENCODING=QUOTED-PRINTABLE:homer=40hotmail.com
[2009-10-28 09:50:22] URL:http://www.simpsons.com
[2009-10-28 09:50:22] URL;WORK:http://www.burns.com
[2009-10-28 09:50:22] EMAIL;INTERNET;HOME;ENCODING=QUOTED-PRINTABLE:marge=40simpsons.com
[2009-10-28 09:50:22] EMAIL;INTERNET;HOME;ENCODING=QUOTED-PRINTABLE:bart=40simpsons.com
[2009-10-28 09:50:22] END:VCARD
[2009-10-28 09:50:22] Successfully parsed:
[2009-10-28 09:50:22] Item LocalID='', RemoteID='7', operation=add, size: [maxlocal,maxremote,actual]
[2009-10-28 09:50:22] - 0 : timestamp REV [ 256, 0, 16] : 20091027T153120Z
[2009-10-28 09:50:22] - 1 : integer SYNCLVL [ n/a, 0, 12] : <unassigned>
[2009-10-28 09:50:22] - 2 : string N_LAST [ 256, 63, 7] : Simpson
[2009-10-28 09:50:22] - 3 : string N_FIRST [ 256, 63, 5] : Homer
[2009-10-28 09:50:22] - 4 : string N_PREFIX [ 256, 31, 7] : <empty>
[2009-10-28 09:50:22] - 5 : string TITLE [ 256, 31, 7] : <empty>
[2009-10-28 09:50:22] - 6 : string CATEGORIES [ n/a, 127, 12] : <unassigned>
[2009-10-28 09:50:22] - 7 : string CLASS [ n/a, 63, 12] : <unassigned>
[2009-10-28 09:50:22] - 8 : string ORG_NAME [ 256, 63, 7] : <empty>
[2009-10-28 09:50:22] - 9 : string ORG_DIVISION [ 256, 63, 23] : http://www.simpsons.com
[2009-10-28 09:50:22] - 10 : url WEBS [ n/a, 127, 23] : <array with 1 elements>
[2009-10-28 09:50:22] -- element 0 : <empty>
--------------------------

It looks like a bug to me. Any ideas how to make this work?

Thanks!

spiky 2009-11-03 08:29

Re: Problem with array field mapping
 
There was some configuration error. It works now.


All times are GMT +2. The time now is 08:58.

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.