[turba] IMSP custom driver

Michael Rubinsky mike at theupstairsroom.com
Wed Dec 24 20:13:51 PST 2003


I've been working on and off for a while now on a custom Turba driver for 
an IMSP back-end.  It's based on some php classes I wrote a while ago while 
trying to implement my own contact system from scratch.

At this point,  I've started writing the driver for Turba but can't seem to 
get it to work.  The IMSP server sends out the information, so I know the 
Turba driver is "connecting", and I also see that the driver functions 
search() and read() are returning arrays filled with my addressbook data. 
The problem is that I still get a blank result screen when both searching 
and viewing the addressbook.

I have the imsp addressbook in the sources.php file and believe the 
mappings are correct. I'm testing against an addressbook that I have been 
using from both Mulberry and (gasp) Silkymail.  I am trying  to keep the 
field structures the same, and right now the mappings are as follows:

__key => name
__type=>group
name => fullname
email => email
alias => alias


Right now, the driver is bare-bones...the search() function just returns 
the whole addressbook...any help as to where to start looking to fix this 
would be GREATLY appreciated!


>From Driver/imsp.php

function search($criteria, $fields, $strict_fields = array(), $match = 
TURBA_SEARCH_AND)
{
    $results =  array();
    /**Retrieves list of names in addressbook as array*/
    $names = $this->imsp->searchAddressBook('mrubinsk', '*');

    for ($i = 0; $ i< count($names); $i++) {
        /**Retrieves full entry from the imsp server as a hash*/
        $result = $this->imsp->getAddressBookEntry('mrubinsk',$names[$i]);
        $results[] = $result;
    }
    return $results;
}

 function read($criteria, $id, $fields)
{
     $temp = $this->imsp->getAddressBookEntry('mrubinsk',$id);

        for ($i = 0; $i < count($fields); $i++) {
            $result[$fields[$i]] = $temp[$fields[$i]];
        }

        return $result;
}



--
Michael Rubinsky
TheUpstairsRoom Consulting
www.theupstairsroom.com
mike at theupstairsroom.com

--
Michael Rubinsky
TheUpstairsRoom Consulting
www.theupstairsroom.com
mike at theupstairsroom.com
Voice: (856)863-8576
Cell: (609)220-3544 


More information about the turba mailing list