TB address book and mailinglists

Hi, I am searching for help on TB mailinglists. I know a few things 
about nsIAbDirectory and nsIAbCard and worked on TB address book in 
general, but fail to understand mailinglist. I think cards in 
mailinglists are linked to cards in the containing address book, but

1. how do I get the parent address book of a mailinglist?
2. how do i link/add an existing card of an address book to a mailinglist?

Thanks
John
0
John
8/4/2016 3:32:56 PM
mozilla.dev.extensions 5694 articles. 0 followers. Post Follow

4 Replies
480 Views

Similar Articles

[PageSpeed] 51

On 04.08.2016 17:32, John Bieling wrote:
> Hi, I am searching for help on TB mailinglists. I know a few things
> about nsIAbDirectory and nsIAbCard and worked on TB address book in
> general, but fail to understand mailinglist. I think cards in
> mailinglists are linked to cards in the containing address book, but
>
> 1. how do I get the parent address book of a mailinglist?
> 2. how do i link/add an existing card of an address book to a mailinglist?
>
> Thanks
> John
Maybe you can find details in
https://dxr.mozilla.org/comm-central/source/mail/components/addrbook/content/abCardViewOverlay.js
... or search in DXR for it.

0
gNeandr
8/10/2016 10:12:10 PM
Thanks for your reply.

I did get issue #2 working now and I am able to link existing contacts 
into a list. But I still have not found information for issue #1 (get 
parent AB of list)

Is it save to search for the last "/" in the url of the list and cut the 
"MailinglistXY" off the url and use that as the url of the parent AB? It 
is working for me, but will it always work? Are there corner cases, 
where this might fail?

Thanks
John



Am 11.08.2016 um 00:12 schrieb gNeandr:
> On 04.08.2016 17:32, John Bieling wrote:
>> Hi, I am searching for help on TB mailinglists. I know a few things
>> about nsIAbDirectory and nsIAbCard and worked on TB address book in
>> general, but fail to understand mailinglist. I think cards in
>> mailinglists are linked to cards in the containing address book, but
>>
>> 1. how do I get the parent address book of a mailinglist?
>> 2. how do i link/add an existing card of an address book to a 
>> mailinglist?
>>
>> Thanks
>> John
> Maybe you can find details in
> https://dxr.mozilla.org/comm-central/source/mail/components/addrbook/content/abCardViewOverlay.js 
>
> .. or search in DXR for it.
>
> _______________________________________________
> dev-extensions mailing list
> dev-extensions@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions

0
John
8/11/2016 10:13:37 AM
Just two two calls which to get the parent details:

> selectedABURI = GetSelectedDirectory();
> selectedABURI :: "moz-abmdbdirectory://abook.mab/MailList2"
>
> cDirectory = GetDirectoryFromURI(selectedABURI).dirName;
> cDirectory :: "Name of MailList2"

So the 'parent dir' in this example is "moz-abmdbdirectory://abook.mab/"



On 11.08.2016 12:13, John Bieling wrote:
> Thanks for your reply.
>
> I did get issue #2 working now and I am able to link existing contacts
> into a list. But I still have not found information for issue #1 (get
> parent AB of list)
>
> Is it save to search for the last "/" in the url of the list and cut the
> "MailinglistXY" off the url and use that as the url of the parent AB? It
> is working for me, but will it always work? Are there corner cases,
> where this might fail?
>
> Thanks
> John
>
>
>
> Am 11.08.2016 um 00:12 schrieb gNeandr:
>> On 04.08.2016 17:32, John Bieling wrote:
>>> Hi, I am searching for help on TB mailinglists. I know a few things
>>> about nsIAbDirectory and nsIAbCard and worked on TB address book in
>>> general, but fail to understand mailinglist. I think cards in
>>> mailinglists are linked to cards in the containing address book, but
>>>
>>> 1. how do I get the parent address book of a mailinglist?
>>> 2. how do i link/add an existing card of an address book to a
>>> mailinglist?
>>>
>>> Thanks
>>> John
>> Maybe you can find details in
>> https://dxr.mozilla.org/comm-central/source/mail/components/addrbook/content/abCardViewOverlay.js
>>
>> .. or search in DXR for it.
>>
>> _______________________________________________
>> dev-extensions mailing list
>> dev-extensions@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-extensions
>

0
gNeandr
8/11/2016 11:12:56 AM
Hi,

I think I found the correct answer, it is the function

GetParentDirectoryFromMailingListURI(uri)

This is what I have to do:

selectedABURI = GetSelectedDirectory();
selectedABURI :: "moz-abmdbdirectory://abook.mab/MailList2"

parentABURI = GetParentDirectoryFromMailingListURI(selectedABURI);
parentABURI :: "moz-abmdbdirectory://abook.mab"

And this function is indeed doing a little more than just cutting of the 
MailLIst2:
https://dxr.mozilla.org/comm-central/source/suite/mailnews/addrbook/abCommon.js

Thanks for pointing me in the right direction.

John








Am 11.08.2016 um 13:12 schrieb gNeandr:
> Just two two calls which to get the parent details:
>
>> selectedABURI = GetSelectedDirectory();
>> selectedABURI :: "moz-abmdbdirectory://abook.mab/MailList2"
>>
>> cDirectory = GetDirectoryFromURI(selectedABURI).dirName;
>> cDirectory :: "Name of MailList2"
>
> So the 'parent dir' in this example is "moz-abmdbdirectory://abook.mab/"
>
>
>
> On 11.08.2016 12:13, John Bieling wrote:
>> Thanks for your reply.
>>
>> I did get issue #2 working now and I am able to link existing contacts
>> into a list. But I still have not found information for issue #1 (get
>> parent AB of list)
>>
>> Is it save to search for the last "/" in the url of the list and cut the
>> "MailinglistXY" off the url and use that as the url of the parent AB? It
>> is working for me, but will it always work? Are there corner cases,
>> where this might fail?
>>
>> Thanks
>> John
>>
>>
>>
>> Am 11.08.2016 um 00:12 schrieb gNeandr:
>>> On 04.08.2016 17:32, John Bieling wrote:
>>>> Hi, I am searching for help on TB mailinglists. I know a few things
>>>> about nsIAbDirectory and nsIAbCard and worked on TB address book in
>>>> general, but fail to understand mailinglist. I think cards in
>>>> mailinglists are linked to cards in the containing address book, but
>>>>
>>>> 1. how do I get the parent address book of a mailinglist?
>>>> 2. how do i link/add an existing card of an address book to a
>>>> mailinglist?
>>>>
>>>> Thanks
>>>> John
>>> Maybe you can find details in
>>> https://dxr.mozilla.org/comm-central/source/mail/components/addrbook/content/abCardViewOverlay.js 
>>>
>>>
>>> .. or search in DXR for it.
>>>
>>> _______________________________________________
>>> dev-extensions mailing list
>>> dev-extensions@lists.mozilla.org
>>> https://lists.mozilla.org/listinfo/dev-extensions
>>
>
> _______________________________________________
> dev-extensions mailing list
> dev-extensions@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions

0
John
8/12/2016 10:51:00 AM
Reply: