Open Bug 219559 Opened 21 years ago Updated 15 years ago

Some AddressBook Outlook fields not displayed

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: wind.li, Assigned: wind.li)

References

Details

Attachments

(1 file, 7 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030918
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030918

See Enabling Outlook and Outlook Express (http://abzilla.mozdev.org/#Outlook).
1. Outlook is capable of running in Outlook Internet Local (OIL) and Outlook
Corporate/Workgroup Local (OCL) modes. When Outlook is configuerd in
Corporate/Workgroup mode, then some data does not appear in OOo. The following
fields do not display any data:

a. Nickname 
b. Home web page
c. Work web page
d. Birth Year, Birth Month, Birth Day (all set to 0)
e. Comments

2. Additional Email does not work in either mode. 

But Mozilla import feature  successfully imports nickname,
additional email, and home web page in all mode.


Reproducible: Always

Steps to Reproduce:
1.activate the Mozilla integration with OutLook
2.set outlook in OCL modes
3.use outlok address
Status: UNCONFIRMED → NEW
Ever confirmed: true
good work
Assignee: sspitzer → wind.li
add depdends
Depends on: 213274
blocks
Blocks: 213274
No longer depends on: 213274
Are there any plans on integrating this into the core Mozilla addressbook
codebase?  If so, you'll want to start setting review and superreview flags...
->Are there any plans on integrating this into the core Mozilla addressbook
codebase?
Yes,we have this plan.But we are consummating the patch,it is so big,so we need
time.
This patch use IMsgStore to rewrite the outlook address book relative code.
Mozilla will get benefit from it in these ways:
 1.Make mozilla can read all outlook address book.Before we can use only
outlook PAB address book.
 2.Get back some fields.As I said in this bug's Description.
    a. Nickname
    b. Home web page
    c. Work web page
    d. Birth Year, Birth Month, Birth Day (all set to 0)
    e. Comments

 3.Add new fields we never support before.
    a.screen name
    b.Additional Email
 4.better performance
    This patch increases the speed of the query on the outlook address book,
especially in OCL mode.
Attachment #131664 - Attachment is obsolete: true
Comment on attachment 134105 [details] [diff] [review]
Rewrite mozilla outlook address book componets

Thx David.
Attachment #134105 - Flags: review?(bienvenu)
+        if (!m_AddressList)
+        {
+            NS_NewISupportsArray(getter_AddRefs(m_AddressList));
+        }
+        else
+        {
+            m_AddressList = nsnull;
+            NS_NewISupportsArray(getter_AddRefs(m_AddressList));
+        }

this can just be

NS_NewISupportsArray(getter_AddRefs(m_AddressList)); 

the comptr will handle the null assignment on overwrite for you.

here, you don't need to check for non-null - delete handles getting a null pointer.

+        if (m_pUniBuff)
+            delete [] m_pUniBuff;
+        m_pUniBuff = NULL;
+        m_uniBuffLen = 0;
+        if (m_pCStrBuff)
+            delete [] m_pCStrBuff;
+        m_pCStrBuff = NULL;
+        m_cstrBuffLen = 0;


same thing here:
+    if (wLen >= m_uniBuffLen) {
+        if (m_pUniBuff)
+            delete [] m_pUniBuff;

also, this code is formatted oddly. The indentation looks wrong. Are there tabs?

+void nsAbWinHelper::CStrToUnicode( const char *pStr, nsString& result)
+{
+    result.Truncate( 0);
+    int wLen = MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
+    if (wLen >= m_uniBuffLen) {
+        if (m_pUniBuff)
+            delete [] m_pUniBuff;
+        m_pUniBuff = new PRUnichar[wLen + 64];
+        m_uniBuffLen = wLen + 64;
+            }
+    if (wLen) {
+        MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
+        result = m_pUniBuff;
+        }
+}


why are you writing your own conversion routines to convert from cstrings to
unicode?

why did you comment out the code that creates a new thread? Was it not needed?

Does this patch add Address book support to our MAPI 0 support?

some minor style things:

+BOOL nsMapiAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction
aRestriction,
+                                nsMapiEntryArray *aList, ULONG aMapiType)
+{
+    if (aList != NULL) { aList->CleanUp(); }

can you just do this:

     if (aList)
       aList->CleanUp();

here,
+BOOL nsMapiAddressBook::IsOK(void)
+{
+    return mRootSession != NULL && mLibUsage;
+}
this can just be 

return mRootSession && mLibUsage;

+    if (!lpMsgStore)
+    {
+        return FALSE;
+    }

no need for the extra braces here - the code's a little easier to read (less
lines) if you just do this:

if (!lpMsgStore)
   return FALSE;


+    return lpMsgStore;
+}
\ No newline at end of file

can you put a newline at the end of this file?


this is a huge patch so I haven't been able to fully understand it. In general,
it looks OK, but I'll need some help understanding all it does. thx, - David
Attached patch updated (obsolete) — Splinter Review
Attachment #134105 - Attachment is obsolete: true
Attachment #134117 - Attachment is obsolete: true
Attached patch updated (obsolete) — Splinter Review
David:
  We can add these lines to out prefs.js to make Mozilla can directly read
outlook address book:
user_pref("ldap_2.servers.mapi_op.description", "mapi_op");
user_pref("ldap_2.servers.mapi_op.dirType", 3);
user_pref("ldap_2.servers.mapi_op.filename", "mapi_op.mab");
user_pref("ldap_2.servers.mapi_op.position", 21);
user_pref("ldap_2.servers.mapi_op.replication.lastChangeNumber", 0);
user_pref("ldap_2.servers.mapi_op.uri", "moz-aboutlookdirectory://op/");

And OpenOffice use this function to access outlook address book too.
But they use outlook PAB api(same as access outlook express),so there will be
some thing can not to do.Such as  lose some fields,can't do a full query,bad
performance......
So I rewrite it use MAPI api(IMsgStore interface),the same way as we use in
import modules.Bug 149961.

->why did you comment out the code that creates a new thread?
Sorry.I forgot to resume it.I commented it just for debug.
->Does this patch add Address book support to our MAPI 0 support?
Sorry,I don't what is MAPI 0 support.
->why are you writing your own conversion routines to convert from   strings to
unicode?
This is a win32 special patch,so I use use win32 special api to get better
performace.
Thx
Attachment #134141 - Attachment is obsolete: true
I have got a little code from
http://bugzilla.mozilla.org/show_bug.cgi?id=135689.
It enables the quick query on outlook express address book.The code is base on
a strange bug of microsoft.If we query all fields,the restriction on it will do
it work.If we just query what we want,the restriction  will fail.
Attachment #134142 - Attachment is obsolete: true
Attachment #134159 - Flags: review?(bienvenu)
+           
+            if (PROP_TYPE( values [i].ulPropTag) != PT_ERROR && values
[i].Value.l != MAPI_E_NOT_FOUND) 
+            {
+            //if (PROP_ID(values [i].ulPropTag) == PROP_ID(aPropertyTags [i]))
+            //{

could you just remove the lines that are commented out, or if there's some
reason to leave the commented lines in, could you comment about what that is?

+static char * stristr(const char *big, const char *little)
+{
+    PRUint32 len;
+
+    if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
+    if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
+
+    len = strlen(little);
+
+    for( ; *big; big++ )
+        if( 0 == _strnicmp (big, little, 1))
+            if( 0 == _strnicmp (big, little, len) )
+                return (char *)big;
+
+    return (char *)0;
+}

isn't this simply:

if (!big || !little || !*big || !*little)
  return 0;
len = strlen(little);

for( ; *big; big++ )
   if(!_strnicmp (big, little, 1) && ! _strnicmp (big, little, len) )
      return (char *)big;

return (char *)0;

this method returns a pointer to the little string in the big string, is that right?

BOOL nsMapiAddressBook::CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG
aRestrictionNum, LPSRestriction aRestriction)

this always returns TRUE; Is that intended?

all these places where you have:

+    if (...)
+    {
+        return FALSE;
+    }

could you just do 

if ()
  return FALSE;

+    int objectType = ContentsColumnObjectType ;
+
+    if (aRestriction != NULL) 

last line should just be:
  if (aRestriction)
Attached patch update (obsolete) — Splinter Review
->static char * stristr(const char *big, const char *little)
I could not find out a function which finds the first occurrence of a substring
within a string and the comparison is case insensitive.So I wrote one referring
to PL_strstr. str*i*str ,"i" means case insensitive.
Attachment #134159 - Attachment is obsolete: true
Attachment #134105 - Flags: review?(bienvenu)
Attachment #134159 - Flags: review?(bienvenu)
Attachment #134248 - Flags: review?(bienvenu)
Attachment #134248 - Flags: review?(bienvenu)
Comment on attachment 146678 [details] [diff] [review]
Make patch up to date and change some code which related to load and unload mapi32.dll

Hi,Seth
Can you please have a look at this?
Attachment #146678 - Flags: review?(sspitzer)
Comment on attachment 146678 [details] [diff] [review]
Make patch up to date and change some code which related to load and unload mapi32.dll

Hi,
Can you please have a look at this?
Thanks
Attachment #146678 - Flags: review?(sspitzer) → review?(mscott)
Product: Browser → Seamonkey
Comment on attachment 146678 [details] [diff] [review]
Make patch up to date and change some code which related to load and unload mapi32.dll

David said he'll have a look at this...
Attachment #146678 - Flags: review?(mscott) → review?(bienvenu)
David, have you had time to look at the patch here?

(Cleaning up old review requests.)
QA Contact: nbaca → addressbook
I doubt very much that this patch still applies...
Comment on attachment 146678 [details] [diff] [review]
Make patch up to date and change some code which related to load and unload mapi32.dll

Clearing the review request then.
Attachment #146678 - Flags: review?(bienvenu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: