This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 22, 2013, 4:34 PM
31 Posts
topic has been resolvedResolved

<xe:namePicker> & <xe:namePickerAggregator> - how to concat personal NAB ?

  • Category: Extension Library
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: NAB,name picker,Extension Library
  • Replies: 1
I'm trying to get the Ext.Lib. name picker to include the user's personal names.nsf along with all of the public NABs in the drop-down list but so far have not had much luck.
The code below results in all public NABs to be displayed in the list, but not the personal NAB (I am logged in using basic authentication).
 
    <xe:namePicker id="namePicker7"
                for="sendTo">
            <xe:this.dataProvider>
                <xe:namePickerAggregator>
                    <xe:this.dataProviders>
                        <xe:dominoNABNamePicker
                            nameList="people" addressBookSel="all">
                        </xe:dominoNABNamePicker>                       
                    </xe:this.dataProviders>
                </xe:namePickerAggregator>
            </xe:this.dataProvider>
        </xe:namePicker>
 
If I access the Db using localhost mode, the same code results in the personal NAB in the drop-down list.
 
How can I get the Address Book drop-down list to work more like it does in the Notes client where it includes the personal names.nsf?
TIA.
 

Jan 31, 2013, 2:45 PM
31 Posts
Re: <xe:namePicker> & <xe:namePickerAggregator> - how to concat personal NAB ?
What I ended up doing may not be ideal but it will work in 90% of the cases at this shop.
  1. See if the user has synchronized their contacts to their mail file.  If yes, then use their mail file as the source for their contacts.
  2. If no, then (at this company) attempt to locate the backed up server replica of their personal names.nsf.  This won't always work since the server .nsf name isn't always consistent, but it's better than nothing.
  3. If neither of the above methods results in a hit, then display a "can't find personal nab" label in the name picker address book drop-down.  I couldn't figure out how to hide the data provider if the personal contacts couldn't be found.
Improvement suggestions are always welcome.
In the afterPageLoad event:
if (session.isOnServer()){
    /* 
        First, locate the current user's person document in the public NAB.
        See if the user has synchronized their contacts from their personal names.nsf into their mail file.
        If yes, then use that to display their personal contacts as a choice.
        If no, then attempt to locate the server backup replica of their personal names.nsf.
    */
    viewScope.personalNAB = "not found";
    viewScope.personalNABTitle = "Personal Address Book Unavailable";
    var userName:NotesName = session.createName(session.getEffectiveUserName());
    var nab:NotesDatabase = session.getDatabase(session.getServerName(),"names.nsf",false);
    if (nab){
        var lkupView:NotesView = nab.getView("($VIMPeople)");
        if (lkupView != null){
            var personDoc:NotesDocument = lkupView.getDocumentByKey(userName.getAbbreviated(),true);
            if (personDoc != null){
                var mailServer:String = personDoc.getItemValueString("MailServer");
                var mailFile:String = personDoc.getItemValueString("MailFile") + ".nsf";
                var shortName:String = personDoc.getItemValueString("ShortName");
                var nabBkp:String = "personal\\nab\\" + @LowerCase(shortName) + "names.nsf";
               
                var tryNAB:NotesDatabase = session.getDatabase(mailServer,mailFile,false);
                if (tryNAB){
                    var contactsView:NotesView = tryNAB.getView("($VIMPeople)");
                    if (contactsView){
                        if (contactsView.getAllEntries().getCount() > 0){
                            var personalNamesNSF:String = mailServer + "!!" + mailFile;
                            viewScope.personalNAB = personalNamesNSF;
                            viewScope.personalNABTitle = userName.getCommon() + "'s Address Book";
                            return "Synchronized contacts! " + personalNamesNSF;           
                        }
                    }
                };
                 //try to locate the backup of the personal nab
                 var bkpNAB:NotesDatabase = session.getDatabase(mailServer,nabBkp,false);
                 if (bkpNAB){
                     var personalNamesNSF:String = mailServer + "!!" + nabBkp;
                     viewScope.personalNAB = personalNamesNSF;
                     viewScope.personalNABTitle = userName.getCommon() + "'s Address Book";
                     return "Personal NAB backup! " + personalNamesNSF;            
                }else{
                    return "not synchronized & cannot locate pnab backup";
                };
            }else{
                return "no person doc found";
            };
        }else{
            return "no ($VIMPeople) view found in NAB";
        };
    }else{
        return "NAB not found";
    };
}else{
    return "not on server";
};

Then, the namePicker:
<xe:namePicker id="namePicker1" for="fld_copyto_recipients">

                <xe:this.dataProvider>
                    <xe:namePickerAggregator>
                        <xe:this.dataProviders>
                            <xe:dominoNABNamePicker addressBookSel="all"
                                nameList="peopleAndGroups">
                            </xe:dominoNABNamePicker>
                            <xe:dominoViewNamePicker labelColumn="$1"
                                viewName="($VIMPeople)" databaseName="#{javascript:viewScope.personalNAB;}"
                                label="#{javascript:viewScope.personalNABTitle;}">
                            </xe:dominoViewNamePicker>
                        </xe:this.dataProviders>
                    </xe:namePickerAggregator>
                </xe:this.dataProvider>
            </xe:namePicker>
 
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal