"Roland Winkler" <wink...@gnu.org> writes:

> On Mon Jun 4 2012 Johnny wrote:
>> lookout.el is however using a bbdb function, *bbdb-add-new-field*,
>> that has *disapeared* in bbdb3. As a lisp amateur, I plunged ahead and
>> copied across the function from bbdb 2.35, but of course this doesn't
>> work (theres a bbdb-propnames that has since been obsoleted, and this is
>> omnipresent in the old code and nowhere to be found in the new code).
>> 
>> Has the 'bbdb-add-new field' been replaced in bbdb3, or is it removed?
>> In short, how can I restore it to make lookout.el and csv.el work?
>
> A quick look into the old code of BBDB 2.35 tells me that
> bbdb-add-new-field was not used at all within BBDB 2.35. That was
> probably the reason why it got removed. I have to look into what
> lookout.el is trying to achieve by calling bbdb-add-new-field (plus
> other functions from BBDB). I expect that these things can be
> greatly simplified. (I need to look more carefully, but I expect
> that calling something like bbdb-add-new-field is not at all needed
> anymore.)
>

Hi Roland and thanks for the quick reply! 

To my untrained eyes it looks like lookout.el is trying to define new
BBDB fields to use for undefined fields in the csv file generated by
Outlook; these fields will be defined by a user set variable as
"otherfields". It seems these are added to the 'bbdb-props' list, and I
guess that these are subsequently used when importing the data. 

I just did a write-up of how to use csv.el and lookout.el with BBDB 2.35
to successfully import contacts if this may help.



Import Outlook contacts to BBDB (using v.2.35)
==============================================


* Import Outlook contacts 
  + Export Outlook contacts 
    To import Outlook contacts to BBDB, the first step is to open
    Outlook and export all contacts as csv (comma separated values).
  + Get lookout.el and csv.el 
    Get [lookout.el] and [csv.el] (both at [Ulf Jasper's emacs page]). Add
    these to your load path and require.

    [lookout.el]: http://ulf.epplejasper.de/downloads/lookout.el
    [csv.el]: http://ulf.epplejasper.de/downloads/csv.el
    [Ulf Jasper's emacs page]: http://ulf.epplejasper.de/Emacs.html

  + Customise lookout-bbdb-mapping-table 
    The 'lookout-bbdb-mapping-table' tells lookout how to map the
    field names encountered in the .csv file to bbdb. The easiest
    way to do this is probably to define a new mapping constant in
    .init.el. In lookout.el, there's a default mapping for a German
    Outlook (not sure if this is up to date, but it shows the
    principles). Copy this to your init file and edit the fields as
    necessary. I chose the following mapping for my English Outlook. 
    
      (defconst lookout-bbdb-mapping-table-outlook-english
        '(
    ("firstname" "Title" "First Name" "Middle Name")
    ("lastname" "Last Name" "Suffix")
    ("company" "Company" "Department" "Job Title")
    ("net" "E-mail Address" "E-mail 2 Address")
    ("phones" "Home Phone" "Home Phone 2" "Mobile Phone" "Business Phone" 
"Business Phone 2" "Other Phone")
    ("addr1" "Home Street" "Home City" "Home Postal Code" "Home Country")
    ("addr2" "Business Street" "Business City" "B
      usiness State" "Business Postal Code" "Business Country")
    ("addr3" "addr3")
    ("notes" "Notes")
    ("otherfields"
     "Web Page"
     "Office Location"
     "Business Fax"
     "Other Fax"
     )
        "Mapping table, usable for input from English M$ Outlook (based on 
German example in lookout.el)."
      "this is a description of the variable")
      )
    
    (you should modify the mapping to suit your fields)
    Then use this constant as the mapping by adding to the init file:
    (setq lookout-bbdb-mapping-table 
'lookout-bbdb-mapping-table-outlook-english)
  + BACK UP YOUR DATABASE 
    Before you start the import, make sure you have backed up your
    database, as the import may overwrite existing records (but
    should prompt), and in general anything may go awry. Test with a
    blank database and then do a merge if it looks ok.
  + USE THE RIGHT VERSION OF BBDB! (= BBDB v.2.35) 
    BBDB v.3 cannot use lookout.el, due to it's usage of e.g. 
    'bbdb-add-new-field', 'bbdb-propnames' and
    'bbdb-record-getprop', which have all been removed from BBDB
    v.3. Maybe there's a replacement and BBDB v.3 or lookout.el can
    be fixed, but in the meantime, make sure to use BBDB v2.35 with
    lookout.el.
  + Import your contacts 
    All this done, simply run
    lookout-create-bbdb
    and when prompted point to your csv-file and all data should be
    imported. 


Regards

-- 
Johnny

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to