Re: Inherit from calStorageCalendar
Philipp Kewisch <[email protected]> Thu, 27 Apr 2017 00:32:05 +0200
| Newsgroups | gmane.comp.mozilla.devel.calendar |
|---|---|
| Message-ID | <[email protected]> |
Hi John,
what you want to do is implement a provider that forces use of the cache
("offline mode"). This way you will have a storage calendar available
for synchronization, but can implement the sync methods separately. I'd
suggest to look at the Provider for Google Calendar as a template.
Please check
https://dxr.mozilla.org/comm-central/source/calendar/providers/gdata for
the source code. Note that the directory structure does not match the
xpi directory structure, if you need that please look at the final xpi
from addons.mozilla.org.
To answer your questions specifically:
> 1. How do I generate a unique ID for my provider, can I just pick one?
This is usually a uuid, you can use cal.getUUID()
>
> 2. How do I inherit my custom provider from calStorageCalendar? I do not want to implement all the methods by myself, I want to use everything from the default StorageCalender. So if something changes in future versions of Thunderbird, I do not have to catch up.
See above, you should use an offline cached calendar.
>
> 3. Do I have to choose a different URL schema, or can I use "moz-storage-calendar://" as well?
You should use something different. I used googleapi:// for the Provider
for Google Calendar.
Philipp