>>      Should be 'reasonably' easy to parse so 
>>      i think i can do it fairly quickly.
>
>Cool!
>

        I modified the query string spec to use
        'and', 'or' and 'not' instead of the symbols
        because the '|' is not a recommended character
        in the URI spec.
        
        Last week i got Org LDAP entries into the
        address book using the query string. Given
        some minor code modifications it should
        also work for the MDB and MAPI implementations,
        so it should be possible to search all types
        of address book via a search GUI.
        I had to change the directory data source to
        use synchronous proxy observers just like the js
        LDAP data source so it can be really slow.
        Getting 100 address book entries is about 5x slower
        using a debug mozilla build than 4.x,
        .... but it works!
        Now have to get a GUI working which appends a
        generated query string to the currently selected
        address book before the child cards are obtained...
        

        Attached is the Mozilla card to LDAP attribute
        mapping that is currenly used. This is based on
        the LDIF conversion code.
        At some point it might be advantageous to have
        a mapping table in the preferences, or changes to
        the default. I presume this would be required by
        some enterprise clients?

Thanks,
Paul.

| ? + ? = To question
----------------\
   Paul Sandoz
        x19219
+353-1-8199219
 
/*
        Table defining the relationship between
        mozilla card properties and corresponding
        ldap properties.

        Multiple entries for a mozilla property define
        there is a many to one relationship between
        ldap properties and the mozilla counterpart.

        There is a one to one relationship between
        a mozilla property and the ldap counterpart.
        If there are multiple entries for a mozilla
        property the first takes precedence.

        This ensures that
        
                1) Generality is maintained when mapping from
                   ldap properties to mozilla.
                2) Consistent round tripping when editing 
                   mozilla properties which are stored on
                   an ldap server
*/

MozillaLdapPropertyRelation mozillaLdapPropertyTable[] =
{
        {MozillaProperty_String, "FirstName",           "givenname"},
        {MozillaProperty_String, "LastName",            "sn"},
        {MozillaProperty_String, "LastName",            "surname"},
        {MozillaProperty_String, "DisplayName",         "cn"},
        {MozillaProperty_String, "DisplayName",         "commonname"},
        {MozillaProperty_String, "DisplayName",         "displayname"},
        {MozillaProperty_String, "NickName",            "xmozillanickname"},
        {MozillaProperty_String, "PrimaryEmail",        "mail"},
        {MozillaProperty_String, "SecondEmail",         "xmozillasecondemail"},
        {MozillaProperty_String, "WorkPhone",           "telephonenumber"},
        {MozillaProperty_String, "HomePhone",           "homephone"},
        {MozillaProperty_String, "FaxNumber",           "fax"},
        {MozillaProperty_String, "FaxNumber",           "facsimiletelephonenumber"},
        {MozillaProperty_String, "PagerNumber",         "pager"},
        {MozillaProperty_String, "PagerNumber",         "pagerphone"},
        {MozillaProperty_String, "CellularNumber",      "mobile"},
        {MozillaProperty_String, "CellularNumber",      "cellphone"},
        {MozillaProperty_String, "CellularNumber",      "carphone"},

        // No Home* properties defined yet

        {MozillaProperty_String, "WorkAddress",         "postofficebox"},
        {MozillaProperty_String, "WorkAddress",         "streetaddress"},
        {MozillaProperty_String, "WorkCity",            "l"},
        {MozillaProperty_String, "WorkCity",            "locality"},
        {MozillaProperty_String, "WorkState",           "st"},
        {MozillaProperty_String, "WorkState",           "region"},
        {MozillaProperty_String, "WorkZipCode",         "postalcode"},
        {MozillaProperty_String, "WorkZipCode",         "zip"},
        {MozillaProperty_String, "WorkCountry",         "countryname"},

        {MozillaProperty_String, "JobTitle",            "title"},
        {MozillaProperty_String, "Department",          "ou"},
        {MozillaProperty_String, "Department",          "orgunit"},
        {MozillaProperty_String, "Department",          "department"},
        {MozillaProperty_String, "Department",          "departmentnumber"},
        {MozillaProperty_String, "Company",             "o"},
        {MozillaProperty_String, "Company",             "company"},
        {MozillaProperty_String, "WorkCountry",         "countryname"},

        {MozillaProperty_String, "WebPage1",            "homeurl"},
        {MozillaProperty_String, "WebPage2",            "workurl"},

        {MozillaProperty_String, "BirthYear",           "birthyear"},

        {MozillaProperty_String, "Custom1",             "custom1"},
        {MozillaProperty_String, "Custom2",             "custom2"},
        {MozillaProperty_String, "Custom3",             "custom3"},
        {MozillaProperty_String, "Custom4",             "custom4"},

        {MozillaProperty_String, "Notes",               "notes"},
        {MozillaProperty_String, "Notes",               "description"},

        {MozillaProperty_Boolean, "SendPlainText",      "xmozillausehtmlmail"},
        {MozillaProperty_Int, "LastModifiedDate",       "modifytimestamp"}
};

Reply via email to