Creating a calendar backend

Announcements etc.

Re: Creating a calendar backend

Postby bas » Tue Mar 18, 2008 9:06 am

The only different property is the timezone property. Maybe is it the timezone information the device needs.
I'll check what needs to be in there, you can try the output from the dump:

Code: Select all
<?php
$message1
->timezone = 'iP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAEAAAAAAAAAxP///w==';
    
bas
 
Posts: 75
Joined: Thu Oct 04, 2007 7:55 am
Location: NL: Brielle

Re: Creating a calendar backend

Postby bas » Tue Mar 18, 2008 9:15 am

This will give you no timezone (UTC):
Code: Select all
<?php
$message1
->timezone = base64_encode(
    
pack("la64vvvvvvvv" . "la64vvvvvvvv" . "l",
        
0, "", 0, 0, 0, 0, 0, 0, 0, 0,
        
0, "", 0, 0, 0, 0, 0, 0, 0, 0,
        
0
    
));
  
bas
 
Posts: 75
Joined: Thu Oct 04, 2007 7:55 am
Location: NL: Brielle

Re: Creating a calendar backend

Postby eksek » Tue Mar 18, 2008 9:24 am

Great, now it worked! Thank you very much.
eksek
 
Posts: 37
Joined: Thu Mar 06, 2008 2:55 pm

Re: Creating a calendar backend

Postby eksek » Wed Mar 26, 2008 2:21 pm

More questions. I have the events in my own database now and the mobile is able to read and delete items. Now i'm creating the insert but how should i deal with the new item and it's id? Can i just discard the id and use my own database autoincrement or does the protocol require that the id is not modified (mobile compares the id's?). If it's so then i must make a new column for the client key and use the autoincrement field as a server key.

Are the possible values and meanings for sensitivity and busystatus somewhere?
eksek
 
Posts: 37
Joined: Thu Mar 06, 2008 2:55 pm

Re: Creating a calendar backend

Postby bas » Wed Mar 26, 2008 2:48 pm

The client id can be ignored, you only have to set your own server id.

busystatus:
  • 0 (Free)
  • 1 (Tentative)
  • 2 (Busy)
  • 3 (Out of Office)

sensitivity:
  • 0 (None)
  • 1 (Personal)
  • 2 (Private)
  • 3 (Company Confidential)
bas
 
Posts: 75
Joined: Thu Oct 04, 2007 7:55 am
Location: NL: Brielle

Re: Creating a calendar backend

Postby eksek » Thu Mar 27, 2008 8:32 am

It seems that the mobile device queries the event immediately after it has been added. Now for some reason the mobile says that sync failed. If i start from a "clean table" and leave everything to the database and the phone gets the item as a new item from server, everything works. So the problem is that some fields are not the same when the phone inserts the entry and then gets it from the db. Which fields should have the same content? All times are now the same (start,end,modified) and so are body and subject. Id is different and at least the timezone binary looks different (how is the timezone formed and how can i extract information about it)?

UPDATE:
I made a little test, cleared everything. First sync, nothing moves because there is no messages neither in server or mobile. I modified the server so that it sends the exactly same item back (using temp variable) and then i add a new event to the mobile and sync. It still fails... var_dump shows the same content for both (in and out) items (the id is changed).

Log: http://pastebin.com/m7a2bb797

UPDATE:
Ok, it now works ;D I didn't notice that the Change should return an array like StatMessage...
eksek
 
Posts: 37
Joined: Thu Mar 06, 2008 2:55 pm

Re: Creating a calendar backend

Postby bas » Thu Mar 27, 2008 9:26 am

uid seems to be NOT a hex variable for you (illegal hex digit error in pack), but the streaming is expecting hex.
That uid should not change.
I thought you meant the id returning in the statmessage function, that can be the index of your table.

EDIT:
Good to know it works now :D
bas
 
Posts: 75
Joined: Thu Oct 04, 2007 7:55 am
Location: NL: Brielle

Re: Creating a calendar backend

Postby eksek » Thu Mar 27, 2008 11:20 am

How should i actually deal with the id? Currently when new event is inserted by the mobile, i just insert a new row to the database and return the array (id,mod,parent) which has the database id.
eksek
 
Posts: 37
Joined: Thu Mar 06, 2008 2:55 pm

Re: Creating a calendar backend

Postby bas » Thu Mar 27, 2008 11:59 am

Returning the database id is correct.

I will make some documentation about the timezone stuff.
bas
 
Posts: 75
Joined: Thu Oct 04, 2007 7:55 am
Location: NL: Brielle

Re: Creating a calendar backend

Postby eksek » Thu Mar 27, 2008 12:11 pm

Ok, that sounds good. Should i be concerned about the hex problem, can it cause troubles in the diffbackend?
Should the 'dtstamp' be unaltered or can i use my own lastUpdate-stamp and return it in the 'mod' (and what should i return in the GetMessage, the original dtstamp or my own mod-stamp)?
The problem is that if dtstamp has different timezone or it just is different than the current server time(), it may cause problems to other sources that sync with the same db.
eksek
 
Posts: 37
Joined: Thu Mar 06, 2008 2:55 pm

PreviousNext

Return to General discussion

Who is online

Users browsing this forum: Germanml and 1 guest

cron