[dev] [Fwd: [cvs] commit: framework/Data/* framework/iCalendar/*

Karsten Fourmont fourmont at gmx.de
Fri Aug 13 12:24:42 PDT 2004


Hi,

I finally managed to finish (and check in) a patch for unifying the 
iCalendar and Data packages. Until now, parsing and exporting of 
icalendar/vcard data has been done in iCalendar as well as in Data with 
different functionality. From now on, it's iCalendar only.

It required quite a few changes to the applications themself, so I hope 
I didn't break anything. I tested it with importing and exporting 
from/to nag,mnemo,kronolith, and turba, displaying of vcard attachments 
in imp and sending invitations for events with kronolith.

As a result the whole icalendar stuff now benefits from the better 
charset handling in the iCalendar package. So vcard 2.1 data with 
charset coded into the text (like FN;ENCODING=UTF8:xxxx) should work 
properly. Display of vcards in the MIME viewer has also been improved.

Unfortunately that's only a partial solution to the charset problem. 
What's still to be done is proper handling of the "global" charset a 
vcard is encoded with. As of vcard 3.0 that's the recommended (read: 
only) way of doing it (i.e. no charset info in the card itself, charset 
must be identify from mime type info or somthing.)

As a start I added a charset parameter to iCalendar.php's parsevCalendar
function. This sould be used like this:

a) Imp (or the mime attachment viewers) should set this parameter 
according to the attachment's charset info.
b) manual Export/Import of Data should have charset selector combos.

I'll look into it.

Finally some internal information about the patch so far:

I moved the toHash/fromHash function from Data to their respective 
applications (like Nag), i.e. into Driver.php (Nag,Mnemo,Kronolith) or 
Source.php (Turba).
They used to be in Data but they're better placed inside the application 
itself as they require information about the internal data structures of 
the Horde applications. Inside the Driver they also have access to 
additional information like the History for creating  MODIFIED: fields.

So by now the borders between the packages are as follows:

1) iCalendar package: handing of parsing/exporting iCalendar data. 
Charset stuff, line folding, converting of dates to Horde's internal 
timestmap format
2) applications: import/export of objects based on Horde_iCalendar's 
subclasses
3) Data: very little functionality. Just a wrapper to make import/export 
of icalendar behave like the other types (csv). Please note that
Data::nextStep(IMPORT_FILE) now might return an array of 
Horde_iCalendar's subclasses rather than an array of hashs. Only the 
classes allow passing _all_ the info.

parsevCalendar in iCalendar.php now looks like this:

-    function parsevCalendar($text, $base = 'VCALENDAR', $clear = true)
+    function parsevCalendar($text, $base = 'VCALENDAR', $charset = 
'utf-8', $clear = true)

I did not find any places where the $clear parameter is explicitly 
specified, so I put charset before clear.

There are still things to do (liker proper distinctions between 2.1 and 
3.0 formats during export) but I wanted to make a start as the patch 
already grew way too  big (diffs are ~3000 lines).

Cheers,
  Karsten

-------- Original Message --------
Subject: [cvs] commit: framework/Data/Data icalendar.php imc.php 
vcard.php vnote.php vtodo.php framework/MIME/MIME/Viewer vcard.php 
framework/iCalendar iCalendar.php package.xml 
framework/iCalendar/iCalendar valarm.php vcard.php vevent.php ...
Date: Fri, 13 Aug 2004 12:11:36 -0700 (PDT)
From: Karsten Fourmont <fourmont at gmx.de>
Reply-To: dev at lists.horde.org
To: cvs at lists.horde.org

karsten     2004-08-13 12:11:36 PDT

   Modified files:
     Data/Data            icalendar.php imc.php vcard.php vnote.php
                          vtodo.php
     MIME/MIME/Viewer     vcard.php
     iCalendar            iCalendar.php package.xml
     iCalendar/iCalendar  valarm.php vevent.php vfreebusy.php
                          vjournal.php vnote.php vtimezone.php
                          vtodo.php
   Added files:
     iCalendar/iCalendar  vcard.php
   Log:
   unification of iCalendar and Data package:
   functionality is now in the iCalendar package,
   The Data package now uses the iCalendar package for vcalendar parsing
   and export.

   Revision  Changes    Path
   1.30      +4 -198    framework/Data/Data/icalendar.php
   1.31      +70 -252   framework/Data/Data/imc.php
   1.32      +17 -422   framework/Data/Data/vcard.php
   1.7       +14 -197   framework/Data/Data/vnote.php
   1.7       +4 -97     framework/Data/Data/vtodo.php
   1.30      +107 -77   framework/MIME/MIME/Viewer/vcard.php
   1.49      +192 -33   framework/iCalendar/iCalendar.php
   1.8       +2 -7      framework/iCalendar/iCalendar/valarm.php
   1.1       +132 -0    framework/iCalendar/iCalendar/vcard.php (new)
   1.30      +6 -8      framework/iCalendar/iCalendar/vevent.php
   1.15      +8 -9      framework/iCalendar/iCalendar/vfreebusy.php
   1.8       +2 -7      framework/iCalendar/iCalendar/vjournal.php
   1.2       +2 -7      framework/iCalendar/iCalendar/vnote.php
   1.8       +2 -17     framework/iCalendar/iCalendar/vtimezone.php
   1.13      +2 -7      framework/iCalendar/iCalendar/vtodo.php
   1.9       +2 -1      framework/iCalendar/package.xml

   Chora Links:
 
http://cvs.horde.org/diff.php/framework/Data/Data/icalendar.php?r1=1.29&r2=1.30&ty=u
 
http://cvs.horde.org/diff.php/framework/Data/Data/imc.php?r1=1.30&r2=1.31&ty=u
 
http://cvs.horde.org/diff.php/framework/Data/Data/vcard.php?r1=1.31&r2=1.32&ty=u
 
http://cvs.horde.org/diff.php/framework/Data/Data/vnote.php?r1=1.6&r2=1.7&ty=u
 
http://cvs.horde.org/diff.php/framework/Data/Data/vtodo.php?r1=1.6&r2=1.7&ty=u
 
http://cvs.horde.org/diff.php/framework/MIME/MIME/Viewer/vcard.php?r1=1.29&r2=1.30&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar.php?r1=1.48&r2=1.49&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/valarm.php?r1=1.7&r2=1.8&ty=u
   http://cvs.horde.org/co.php/framework/iCalendar/iCalendar/vcard.php?r=1.1
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vevent.php?r1=1.29&r2=1.30&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vfreebusy.php?r1=1.14&r2=1.15&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vjournal.php?r1=1.7&r2=1.8&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vnote.php?r1=1.1&r2=1.2&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vtimezone.php?r1=1.7&r2=1.8&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/iCalendar/vtodo.php?r1=1.12&r2=1.13&ty=u
 
http://cvs.horde.org/diff.php/framework/iCalendar/package.xml?r1=1.8&r2=1.9&ty=u

-- 
To unsubscribe, mail: cvs-unsubscribe at lists.horde.org




More information about the dev mailing list