On May 22, 2012, at 2:45 AM, BN wrote:
> Hey Evert,
>
> It is now working in Lightning. I am not quite sure exactly what I changed, but I don't believe I was getting my errors. I have successfully gotten my test CardDAV server to sync with SOGo Connector and Apple Addressbook, and the test CalDAV server to sync with Mozilla Lightning and Apple iCal.
>
> Now my goal is to implement SabreDAV into my own application. I have read through the documentation and I understand that I need to create my own backend classes. I have looked through the backend classes on:
>
http://code.google.com/p/sabredav/wiki/IntegrationGuide#Backends
>
> And I am still a little cloudly on how I can integrate SabreDAV into my app. I will give a brief overview. From my app, each user has contacts and calendars that belong to them. These contacts and calendars are tied to the user through foreign keys.
>
> I guess my biggest confusion lies within how I can integrate SabreDAV into my app when my database looks different. Looking through the Backend classes, such as Sabre_CardDAV_Backend_PDO, I can see that its main purpose is to create, update, retrieve, and delete contact data. And in this class, I can see that it is geared specifically toward the default database schema provided in the example mysql files.
>
> My contacts database has separate columns for things like first name, surname, work email, phone, etc. It also has a vcard column which is just a text type, contains straight vcard data and is updated whenever a user updates one of the contact fields. I see that the SabreDAV table "cards" is probably the closest thing to this.
>
> 1) How much am I allowed to modify the databases that were setup in the examples/sql files. For example, does my contacts table have to be called "cards"? And can I append extra columns on to my contacts such as "first name", "last name", "email", etc? More specifically, are all the database queries for performing create/update/retrieve/delete to contact data all specified within the "Sabre_CardDAV_Backend_PDO"? Or are there other classes in SabreDAV that depend on, for example, the vcard field to be called "carddata"?
>
> 2) An extension of #1, so basically the purpose of these backend classes is to handle update/create/retrieve/delete? And as long as I implement and follow the abstract class, and as long as my functions output the data in the same format, I am on the right track?
Yes, you should just extend the abstract classes, and make sure you are returning the correct responses from these methods.
The classes themselves have a lot of documentation embedded, so it shouldn't be too terribly difficult.
The caveat is that you need return actual 'vcards' and 'icalendar' objects. If your database has these in separate fields,
it means that your backend classes must generate these on the fly.
The Sabre_VObject library is specifically for parsing, creating and manipulation of these objects.
HOWEVER
If a client, such as Thunderbird of OS X addressbook uploads a vcard, this means you have to parse it and split
up the information in your separate database fields.
But some clients really dislike it when they upload a new contact, retrieve it again and notice it has changed
in the meanwhile.
So you can give this a shot, but I would recommend actually *also* storing the entire vcard and icalendar object
the client sends.
I hope this makes sense..
Evert
>
> Sorry if my questions are too general, I am still just wrapping my head around this.
>
> On Monday, May 21, 2012 3:04:38 AM UTC-7, Evert Pot wrote:
> On May 20, 8:10 am, BN <
brett.shigoto.c...@gmail.com> wrote:
> > Thank you very much, Evert. That was definitely the problem.
> >
> > I am also having problems with the CalDAV with Mozilla Lightning.
> >
> > I created a new CalDAV calendar with the url as:
http://www.test.tst/calendarserver.php/calendars/admin/[name]
> >
> > I created new events, and as soon as I hit "Synchronize", the events
> > disappeared from my Lightning calendar. I visited the address
> > (
http://www.test.tst/calendarserver.php/calendars/admin/[name]) in my web
> > browser, and saw that an iCal file was created for each event. Although
> > when I synchronize, why does it not also pull the events into my Lighting
> > Calendar?
>
> This *should* work. Are you getting any errors at all? The best way to
> really find out what may be wrong is to setup Charles HTTP proxy and
> see if there are any errors.
>
> When you setup the calendar, there should be a number of REPORT http
> requests that return the events.
>
> Let me know if you can find out :)
>
> Evert
>
> --
> You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
> To view this discussion on the web visit
https://groups.google.com/d/msg/sabredav-discuss/-/UiShcRjNbQkJ.
> To post to this group, send email to
sabredav...@googlegroups.com.
> To unsubscribe from this group, send email to
sabredav-discu...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/sabredav-discuss?hl=en.