[turba] Turba fields

Scott Greenberg me at gogogadgetscott.info
Tue Aug 2 20:12:47 PDT 2005


Both object_id and object_uid are created when adding a new turba object
(contact).  The initialization varers based on the turba driver.  Below I have
listed info for the sql driver.  If you are using another option refer to
./turba/lib/Driver/*.php > function _makeKey, id is the same in all cases.

<?php
if (!isset($GLOBALS['conf']['server']['name'])) {
    $GLOBALS['conf']['server']['name'] = $_SERVER['SERVER_NAME'];
}

$user = 'user';

$contacts = array(
    array('Test1', 'test1 at none.net'),
    array('Test2', 'test2 at none.net'),
    array('Test3', 'test3 at none.net')
    );

foreach ($contacts as $contact) {

    $id = md5(uniqid(mt_rand(), true));

    $uid = date('YmdHis') . '.' . substr(base_convert(microtime(), 10, 
36), -16)
. $GLOBALS['conf']['server']['name'];

    $sql = "INSERT INTO `turba_objects` (`object_id` , `owner_id` ,
`object_type` , `object_uid` , `object_members` , `object_name` ,
`object_alias` , `object_email`) VALUES ('$id', '$user', 'Object', '$uid',
NULL, '$contact[0]', '', '$contact[1]');";

    echo $sql . "\n";
}
?>


-- 
Scott Greenberg
me at gogogadgetscott.info
GoGoGadgetScott.info


Quoting Kevin Konowalec <kevin at ualberta.net>:

> Awesome!  That should work nicely!
>
> Now all I need to know is what to do with the object_id and
> object_uid fields and we'll be in business.....
>
> Thanks Kevin!
>
>
> On Aug 2, 2005, at 12:01 PM, Kevin Druff wrote:
>
>> http://dev.mysql.com/doc/mysql/en/load-data.html
>>
>> Kevin Druff
>> MySQL Database Administrator
>> Tim Kaine for Governor
>> www.kaine2005.org
>> (804) 673-2100x2258
>>
>>
>> -----Original Message-----
>> From: turba-bounces at lists.horde.org [mailto:turba-
>> bounces at lists.horde.org]
>> On Behalf Of Kevin Konowalec
>> Sent: Tuesday, August 02, 2005 1:55 PM
>> To: turba at lists.horde.org
>> Subject: [turba] Turba fields
>>
>> I've been trying to figure out how to do a mass (50,000+ users)
>> import of addressbooks from our existing system over to turba.
>> Supposedly there are mysql scripts out there that will do this but I
>> can't seem to find any of them.  So I started looking into how to do
>> it myself but I found that there are 2 fields, object_id and
>> object_uid, that are generated by the server somehow and I'm not sure
>> what to do about them.  Do I ignore them and just load up the table
>> with entries or do I somehow have to generate them?
>>
>> If anyone has the mysql scripts that could be used for this task, or
>> has any insight into how to mass import to mysql from csv files
>> please let me know.
>>
>> Thanks.
>> --
>> Turba mailing list - Join the hunt: http://horde.org/bounties/#turba
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: turba-unsubscribe at lists.horde.org
>>
>>
>>
>>
>
> --
> Turba mailing list - Join the hunt: http://horde.org/bounties/#turba
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: turba-unsubscribe at lists.horde.org
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Powered by SEG Technology hosting.



More information about the turba mailing list