[turba] Updating the Turba Schema

Michael Rubinsky mrubinsk at horde.org
Tue Sep 14 13:47:35 UTC 2010


Quoting Simon Brereton <simon.brereton at dada.net>:

> Hi
>
> With the advances in Funambol and sync in general it's now possible  
> for me to put almost all my information in the cloud (read: on the  
> server) and access it from anywhere (netbook, phone, PC, etc).
>
> There's one small problem.  My legacy address is book is Outlook -  
> which has space for up to 3 email addresses.  Indeed Thunderbird 3  
> even supports two and my phone (Android) also support 3 (home, work  
> and other) and I can't imagine the iPhone is any different.  The  
> weak link is Turba - which only supports one.  Up until now, that  
> hasn't been a problem, because my main data source has been on the  
> PC and when I copy the address book to Turba, it just imports the  
> default mail address (although not being able to email friends at  
> work from Horde has become increasingly annoying).
>
> I found this on how to increase the number of address fields in Turba.
>
> http://edeca.net/wp/2010/01/modifying-fields-in-the-turba-addressbook/
>
> Which should essentially work.  And whilst I'm happy to do that in  
> the short-term, I have two immediate concerns.
>
> How will synch work (rpc.php)?
>
> And if a future version of Turba supported multiple email addresses  
> for a contact (I'm using H3 (2.3.4)) what would happen to my changes  
> (I'd presume there'd be an updates .sql to run and that could  
> effectively complicate the DB if not exactly breaking it)?
>
> Ideally you'll tell me there's a new version of Turba that supports  
> it (and therefore sync is supported as well) and I'll wait and just  
> install that.
>
> Any information gratefully received.

Maybe I misunderstand what you are asking, but Turba, itself, can  
support as many email address fields as you want. You can configure  
Turba to contain *any* field you want.  What you need to do, as the  
blog entry you linked to shows, is to add the field to your storage  
backend e.g., create a database field named something like  
object_homeemail, object_workemail.  Then make sure the field has an  
attribute entry in config/attributes.php. Turba ships with the  
definitions already there for homeEmail and workEmail.  Then, add  
those two fields to the entry in config/backends.php (formally called  
sources.php).

Now, what the sync client sends is a different story.  Looking at the  
code in Turba_Driver#toHash, it looks like Turba expects the client to  
send either a HOME or WORK type, then maps that to homeEmail and  
workEmail.  If neither of those get set, it then then looks for a  
plain email value. So, if your client doesn't send the desired,  
multiple emails as HOME and WORK, then we might have to look at  
tweaking the code.

-- 
Mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

Mike

?The only reason for time is so that everything doesn't happen at  
once." - A. Einstein



More information about the turba mailing list