Calendar:Feature Implementations:Timezones: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 5: Line 5:
<i> Discussion in mozilla.dev.apps.calendar</i>
<i> Discussion in mozilla.dev.apps.calendar</i>


<i> "To understand timezones, it really, really helps to be drunk." Stephen Mook</i>
<i> "To understand timezones, it really, really helps to be drunk." -- Stephen Mook</i>


So, here we are for round three. We are thinking to use an extension to manage the timezone database since the general database server (as discussed below) is not looking to happen any time soon.  So, in order to do this in an extension, we need to stub in an interface that the extension can then implement.  This interface will be the calITimezoneResolver. Providers that use server stored timezones which are different from the Olsen timezone database (I'm looking at you, Outlook), can implement this interface also and provide their own timezone definitions.
So, here we are for round three. We are thinking to use an extension to manage the timezone database since the general database server (as discussed below) is not looking to happen any time soon.  So, in order to do this in an extension, we need to stub in an interface that the extension can then implement.  This interface will be the calITimezoneResolver. Providers that use server stored timezones which are different from the Olsen timezone database (I'm looking at you, Outlook), can implement this interface also and provide their own timezone definitions.
Line 12: Line 12:


calITimezoneResolver:
calITimezoneResolver:
* AddTimezone(in string Tzid,  
<pre>
              in string icalString of timezone data to add,
AddTimezone(in string Tzid,  
              out TimezoneEntry of timezone added/found)
            in string icalString of timezone data to add,
** Attempts to find this Tzid in the timezone database and if it is found, returns successfully and returns the timezone found
            out TimezoneEntry of timezone added/found)
** If the Tzid is not found in the database, then this adds the timezone to the database, and returns the timezone added
</pre>
* GetTimezone(in string Tzid,
* Attempts to find this Tzid in the timezone database and if it is found, returns successfully and returns the timezone found
              out TimezoneEntry of timezone found/null if not found)
* If the Tzid is not found in the database, then this adds the timezone to the database, and returns the timezone added
** Finds the timezone with the matching tzid in the database
<pre>GetTimezone(in string Tzid,
* GetTimezoneList(out An nsIUTF8StringEnumerator of all Tzid's in the database)
            out TimezoneEntry of timezone found/null if not found)</pre>
** Returns a string enumerator of all known tzid's in the database
* Finds the timezone with the matching tzid in the database
* GetVersion (out string version)
<pre>GetTimezoneList(out An nsIUTF8StringEnumerator of all Tzid's in the database) </pre>
** Returns the version of the underlying timezone datastore
* Returns a string enumerator of all known tzid's in the database
<pre>GetVersion (out string version)</pre>
* Returns the version of the underlying timezone datastore


Putting the timezone database into the extension changes the nature of upgrading the timezone information from a code update into more of a build/release update.  As long as the underlying database structure does not change, there should be no need to update the associated code in the extension.  But, I do think it makes sense to also package the database, the TimezoneStorageService (the C++ wrapper for the database) and the calITimezoneResolver implementation together in the extension.  So, that amount of code will be updated each time the timezone database is updated by the extension update mechanism.
Putting the timezone database into the extension changes the nature of upgrading the timezone information from a code update into more of a build/release update.  As long as the underlying database structure does not change, there should be no need to update the associated code in the extension.  But, I do think it makes sense to also package the database, the TimezoneStorageService (the C++ wrapper for the database) and the calITimezoneResolver implementation together in the extension.  So, that amount of code will be updated each time the timezone database is updated by the extension update mechanism.
Confirmed users
3,816

edits

Navigation menu