[SyncEvolution] Cannot set calendar properties with SetValue
by Roger KeIrad
Hello,
I am trying to develop the readItemAsKey() function in my sqlite backend for
calendar wusing the setValue() api.
The function doesn't return anyy error but there is no field inserted in xml
logs. I just have an embty VCAL :
<![CDATA[BEGIN:VCALENDAR
VERSION:1.0
END:VCALENDAR
]]>
Do I miss any config or a something like that?
This is what I wrote :
if(sysync::LOCERR_OK != getSynthesisAPI()->setValue(aItemKey, "SUMMARY", "My
event")){
printf("Cannot set field <SUMMARY> \n");
}
The type of field "SUMMARY" is multiligne does it differ from type string?
I note that I can easily retreive fields with getValue() api.
Thanks in advance for help.
Regards.
9 years, 3 months
Re: [SyncEvolution] sqlite backend enhancement
by Lukas Zeller
Hi Roger,
On Sep 26, 2011, at 14:24 , Roger KeIrad wrote:
> Hi Lukas,
> I ve got 2759 which is correct in the first and second call which is the right size of the thumbnail.
> The problem is that when I write the buffer to a file I only get 4 bytes (size of the buffer).
> The file is dumped in PHOTO field in incoming item.
> Is there a mistake in the manner I use the extracted buffer? because I try to put the buffer on a file by character.
That is binary data. If you have that processed by a character API, probability is high that processing will stop at the first 0x00 / NUL character, because in text data this is usually the terminating character, while in binary it is a part of the data like all other values from 0x00..0xFF.
So I assume that the data you get into your buffer is fine, but has a 0x00 as the fifth byte, which then stops the code you are using to write that to disk.
Plain fwrite should work, but not fputs for example, as this stops at the first 0x00 encountered.
Best Regards,
Lukas
> 2011/9/26 Lukas Zeller <luz(a)plan44.ch>
> Hello Roger,
>
> the code looks fine, exactly the way I am doing it to get the PHOTO data in my own plugin I have for iOS address book.
> So there's something else that must be wrong.
>
> You say you get 2759 as size. Is this valsize in the first call?
> And then in the second call you get only 4 bytes back? What does valsize return for the second call? Also 4 or 2759?
>
> Do you have a logfile where you see the incoming item dumped? If so, what does it show for the PHOTO field?
>
> Best Regards,
>
> Lukas
>
>
> On Sep 26, 2011, at 11:32 , Roger KeIrad wrote:
>
> > Hi Lukas
> > Thanks for the response. I followed your tips but It didn't work here is my code :
> >
> > TSyError res = this->ui.GetValueByID(this,
> > aItemKey,
> > valueId,
> > idx,
> > sysync::VALTYPE_BUF,
> > NULL,
> > 0,
> > &valsize
> > );
> > if(!res && valsize){
> > data = SharedBuffer(new char[valsize*1024*1024 + 1], valsize);
> > data[valsize] = 0;
> > res = this->ui.GetValueByID(this,
> > aItemKey,
> > valueId,
> > idx,
> > sysync::VALTYPE_BUF,
> > data.get(),
> > valsize + 1,
> > &valsize
> > );
> > }
> >
> > I ve got size = 2759 but i always extract 4 bytes.
> > Can you help me please?
> > Thank you in advance
> > Regards
> >
> > 2011/9/22 Lukas Zeller <luz(a)plan44.ch>
> > Hello Roger,
> >
> > On Sep 22, 2011, at 16:25 , Roger KeIrad wrote:
> >
> > > Hello,
> > > It is me again.
> > > I have some troubles with PHOTO for synchronised contact.
> > > I used the same idea to extract encoded value to decode it.
> > > I tried with GetValue and GetValueByID but no chance.
> >
> > Both should work (the PHOTO is not an array field).
> >
> > Just pass VALTYPE_BUF as type, and provide a buffer large enough to get the binary photo data.
> >
> > To find out in advance how large the buffer needs to be, just call GetValue once with a NULL pointer as buffer or zero buffer size. This will return the needed size in the aValSize parameter, which you can use to allocate a buffer large enough to get the entire PHOTO.
> >
> > If you pass a buffer that is too small for the entire PHOTO data, you'll get LOCERR_TRUNCATED status.
> >
> > The data you get is binary data, usually a JPG. If you save the data 1:1 into a file, any image viewer program should be able to show it.
> >
> > Best Regards,
> >
> > Lukas
Lukas Zeller, plan44.ch
luz(a)plan44.ch - www.plan44.ch
9 years, 3 months
Re: [SyncEvolution] sqlite backend enhancement
by Lukas Zeller
Hello Roger,
On Sep 16, 2011, at 16:28 , Roger KeIrad wrote:
> hello,
> any help please?
> thanks in advance.
There are a number of GetValueXXX variants. GetValue() is only for single values.
For arrays, you need to use GetValueByID(), which has a arrIndex parameter. To get the ID for a name, use GetValueID(). You can get the size of the array by appending VALSUFF_ARRSZ to the array field name, and call GetValue() with that - you'll get the number of elements back.
See sysync_SDK/Sources/enginemodulebase.h for more detailed description of all the Get/SetValue functions, and engine_defs.h for the VALNAME_xxx and VALSUFF_xxx explanations.
Pseudo code to get all elements of an array would look like:
// get size of array
uInt16 arraySize;
memsize n;
GetValue("arrayFieldName" VALSUFF_ARRSZ, VALTYPE_INT16, &arraySize,sizeof(arraySize),n);
// get elements of array
long arrayFieldID = GetValueID("arrayFieldName");
for (int i=0; i<arraySize; i++) {
GetValueByID(arrayFieldID, i, VALTYPE_XXX, &buffer, maxSize, n);
// do something with the value
}
Below is a more elaborate routine, which prints out all values for a given aItemKey, including array fields:
/* Show all fields/variables of item represented by aItemKey */
static void ShowFields(DB_Callback cb, appPointer aItemKey)
{
const stringSize maxstr = 128;
appChar fnam[maxstr];
appChar fval[maxstr];
appChar ftz[maxstr];
uInt16 fvaltype;
uInt16 farrsize;
uInt16 arridx;
bool fisarray;
uInt32 valsize;
TSyError err;
uInt32 valueID,nameFlag,typeFlag,arrszFlag,tznamFlag;
// set desired time mode
cb->ui.SetTimeMode(cb, aItemKey, TMODE_LINEARTIME+TMODE_FLAG_FLOATING);
// get flags that can be combined with valueID to get attributes of a value
nameFlag = cb->ui.GetValueID(cb, aItemKey, ".FLAG.VALNAME");
typeFlag = cb->ui.GetValueID(cb, aItemKey, ".FLAG.VALTYPE");
arrszFlag = cb->ui.GetValueID(cb, aItemKey, ".FLAG.ARRAYSIZE");
tznamFlag = cb->ui.GetValueID(cb, aItemKey, ".FLAG.TZNAME");
// iterate over all fields
// - start iteration
valueID = cb->ui.GetValueID(cb, aItemKey, VALNAME_FIRST);
while (valueID != KEYVAL_ID_UNKNOWN && valueID != KEYVAL_NO_ID) {
// get field name
err = cb->ui.GetValueByID(cb,
aItemKey,
valueID + nameFlag,
0,
VALTYPE_TEXT,
fnam,
maxstr,
&valsize
);
// get field type
err = cb->ui.GetValueByID(cb,
aItemKey,
valueID + typeFlag,
0,
VALTYPE_INT16,
&fvaltype,
sizeof(fvaltype),
&valsize
);
// check if array, and if array, get number of elements
err = cb->ui.GetValueByID(cb,
aItemKey,
valueID + arrszFlag,
0,
VALTYPE_INT16,
&farrsize,
sizeof(farrsize),
&valsize
);
fisarray = err==LOCERR_OK;
if (!fisarray) {
// single value
err = cb->ui.GetValueByID(cb, aItemKey, valueID, 0, VALTYPE_TEXT, fval, maxstr, &valsize);
if (err==LOCERR_OK) {
if (fvaltype==VALTYPE_TIME64) {
// for timestamps, get time zone name as well
cb->ui.GetValueByID(cb, aItemKey, valueID+tznamFlag, 0, VALTYPE_TEXT, ftz, maxstr, &valsize);
DEBUG_(cb, "- %-20s (VALTYPE=%2hd) = %s timezone=%s",fnam,fvaltype,fval,ftz);
}
else
DEBUG_(cb, "- %-20s (VALTYPE=%2hd) = '%s'",fnam,fvaltype,fval);
}
else
DEBUG_(cb, "- %-20s (VALTYPE=%2hd) : No value, error=%hd",fnam,fvaltype,err);
}
else {
// array
DEBUG_(cb, "- %-20s (VALTYPE=%2d) = Array with %d elements",fnam,fvaltype,farrsize);
// show elements
for (arridx=0; arridx<farrsize; arridx++) {
err = cb->ui.GetValueByID(cb, aItemKey, valueID, arridx, VALTYPE_TEXT, fval, maxstr, &valsize);
if (err==LOCERR_OK) {
if (fvaltype==VALTYPE_TIME64) {
// for timestamps, get time zone name as well
cb->ui.GetValueByID(cb, aItemKey, valueID+tznamFlag, arridx, VALTYPE_TEXT, ftz, maxstr, &valsize);
DEBUG_(cb, " %20s[%3hd] = %s timezone=%s",fnam,arridx,fval,ftz);
}
else
DEBUG_(cb, " %20s[%3hd] = '%s'",fnam,arridx,fval);
}
else
DEBUG_(cb, " %20s[%3hd] : No value, error=%hd",fnam,arridx,err);
}
}
// next value
valueID = cb->ui.GetValueID(cb, aItemKey, VALNAME_NEXT);
} // while more values
} /* ShowFields */
9 years, 3 months
[SyncEvolution] Nokia 7020 sync issues
by Ernest Sales
I am syncing a Nokia 7020 (S40) over bluetooth, through sync-ui, and I
ran into two issues:
* General: The syncing process does not honor the one-way sync
chekboxes. However I check only 'Send changes to...', the syncing is
bidirectionnal.
* Contacts: Postal mail addresses are transmitted from Evolution to the
Nokia 7020, but not the other way: if a contact is updated in the phone,
on syncing, all its postal addresses are blanked out from Evolution.
Any clue?
My config:
# uname -a
Linux escampalaboira 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011
x86_64 GNU/Linux
Evolution 3.0.3
# syncevolution --version
SyncEvolution 1.1.99.5a
9 years, 3 months
[SyncEvolution] RRULE fieds : occurence vs untilDate
by Roger KeIrad
Hello,
is there a way in RRULE property to mention the occurence value of an event
cause always we get the End fields that indicate until date ?
i take that exemple :
Daily for 10 occurrences:
D1 #10
Daily until 12/24/94:
D1 19941224T000000Z
by getting the RRULE fields for these two ewamples (Interval , Freq
,Fmask, Lmask , End ) we can't determine either an event is an event
with until date or an event with occurence.
THX.
9 years, 3 months
[SyncEvolution] two issues with Nokia 7020
by Ernest Sales
I am syncing a Nokia 7020 over bluetooth, through sync-ui, and I ran
into two issues:
* General: The syncing process does not honor the one-way sync
chekboxes. However I check only 'Send changes to...', the syncing is
bidirectionnal.
* Contacts: Postal mail addresses are transmitted from Evolution to the
Nokia 7020, but not the other way: if a contact has been updated in the
phone, after syncing its mail addresses dissappear from Evolution.
Certainly Evolution knows of three types of postal address while the
Nokia allows only one, but I suppose that wiping out all the fields that
don't correspond exactly is not the intended strategy to cope with
differences in formats.
Any clue? Thanks in advance.
9 years, 3 months
[SyncEvolution] Unable to create a new service in sync-ui
by Tino Keitel
Hi,
I tried to test sync-ui for adding a new service but nothing happens
when I click on "Add new service". The only message I see in the
console is this:
"(sync-ui:19005): GLib-CRITICAL **: g_hash_table_unref: assertion `hash_table != NULL' failed"
There are some other console messages, I don't know if they are
related:
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/everdroid
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/egroupware
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/funambol
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/gmail
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/memotoo
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/everdroid
** (sync-ui:19005): WARNING **: only file:// icon uri is supported:
** image://themedimage/icons/services/ovi
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
(sync-ui:19005): Gtk-CRITICAL **: IA__gtk_widget_set_sensitive:
assertion `GTK_IS_WIDGET (widget)' failed
Does that ring any bells?
Regards,
Tino
9 years, 4 months
[SyncEvolution] Memotoo refresh + empty data
by Patrick Ohly
Hello Thomas!
Can you remind me how Memotoo handles refresh-from-client and syncs
without data?
According to past discussions and our README.memotoo, Memotoo used to do
a slow sync when it had no data. That broke our testRefreshStatus test.
But now this test seems to run fine.
Instead testDeleteAllRefresh fails now. This test copies some items to
the server, then deletes everything locally and does a
refresh-from-client sync. The expected outcome is that the server
deletes all its items. The actual outcome is that the client is sent all
items on the server.
See http://syncev.meego.com/latest/head-testing-amd64/nightly.html for
examples.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
9 years, 4 months
[SyncEvolution] sqlite backend enhancement
by Roger KeIrad
Hello,
I am trying to understand how sqlite backend is implemented. Acually, all
fields that are inserted via SQLiteContactSource::insertItemAsKey doesn't
include those who have complex values like "TEL" field.
Does getSynthesisAPI()->getValue permit to get values like TEL or RRULE
ones?
How can i specify a complexe values like TEL or RRULE when doing readitem
operation via getSynthesisAPI()->setValue api ?
How can i differenciate between AALARM, DALARM when doing readitem operation
cause there is no global fieldname for these properties in xml config files
?
THX.
9 years, 4 months
[SyncEvolution] Syncevo & funambol (Android)
by Justas Poderys
Hi all,
I'm trying to sync my HTC Desire Z to my laptop running Ubuntu. On my
phone I use Funambol Android Sync Client ver 10.0.6. My laptop is
running latest version of syncevolution:
justas@Zaibukas:/$ syncevolution --version
SyncEvolution 1.1.99.6
using libedataserver-1.2.so.14
using libebook-1.2.so.10
using libecal-1.2.so.8
using libecal-1.2.so.8 - might not be compatible!
using libbluetooth.so.3
Loading backend library /usr/lib/syncevolution/backends/syncsqlite.so
Loading backend library /usr/lib/syncevolution/backends/syncecal.so
Loading backend library /usr/lib/syncevolution/backends/syncdav.so
Loading backend library /usr/lib/syncevolution/backends/syncfile.so
Loading backend library /usr/lib/syncevolution/backends/syncakonadi.so
Loading backend
library /usr/lib/syncevolution/backends/syncqtcontacts.so
Loading backend
library /usr/lib/syncevolution/backends/syncaddressbook.so
Loading backend
library /usr/lib/syncevolution/backends/synckcalextended.so
Loading backend library /usr/lib/syncevolution/backends/syncebook.so
Loading backend library /usr/lib/syncevolution/backends/syncxmlrpc.so
Loading backend library /usr/lib/syncevolution/backends/syncmaemocal.so
When I sync via http server I get this output:
[INFO] syncevo-http: new SyncML session for 192.168.2.141
[INFO] sync: matched deviceID fac-352212045389751 against config jphtc
(/home/justas/.config/syncevolution/default/peers/jphtc)
<snip>
[INFO] sync: addressbook: starting first time sync, two-way
[INFO] sync: Local data changes to be applied during synchronization:
[INFO] sync: *** addressbook ***
[INFO] sync: no changes
[INFO] sync:
[INFO] sync: addressbook: started
[INFO] sync: addressbook: first time sync done unsuccessfully
[ERROR] sync: SML (or SAN) error processing incoming message (local,
status 20007)
<snip>
[INFO] sync: First ERROR encountered: SML (or SAN) error processing
incoming
message (local, status 20007)
[INFO] sync:
Data modified locally during synchronization:
[INFO] sync: *** addressbook ***
[INFO] sync: no changes
evolution-log.html is not very helpful as well:
<snip>
[2011-09-11 21:59:57.208] addressbook: started
[2011-09-11 21:59:57.209] ===> smlProcessData failed, returned 0x200B
–
[2011-09-11 21:59:57.209] 'SessionAbort' - Aborting Session,
Status=20007,
</snip>
Any ideas why sync is not working? I can see the syncevolution access my
addressbook without problems, but I can't sync contacts from my phone.
Thanks,
jP
9 years, 4 months