XPages - SSJS - Get ALL profile documents

357 views Asked by At

With LotusScript I can use Set notesDocumentCollection = db.GetProfileDocCollection() to get a collection of ALL the profile documents in a database. I would like to do the same using SSJS. However, database.getProfileDocCollection(profileName) obliges me to use a specific profile name. Is there any way in SSJS of getting a collection of ALL profile documents in a database (as is the case with LotusScript)?

3

There are 3 answers

1
Knut Herrmann On BEST ANSWER

You can get all profile documents with

  var dc:NotesDocumentCollection = database.getProfileDocCollection(null);

Just set null as parameter. Tested it with Domino 8.5.3 FP6 and 9.0.1 FP1.

0
Andre Guirard On

The NoteCollection class should let you find all profiles in a single search.

1
Paul Stephen Withers On

Looking at the Help, in Java there is only the method corresponding to the SSJS version you mentioned, passing a profile form name. It doesn't look like there's a Java equivalent to the LotusScript option of not passing a form name. So there will not be an in-built option.

Profile documents tend to get cached and it is a more significant issue on the web. I hit significant problems when I started with profile documents in XPages Help Application. That's why I changed to creating "pseudo-profile documents" by changing the UNID. See http://www.thenorth.com/apblog4.nsf/0/63F5C6B1F08957AC8525747D005AA429 and http://avatar.red-pill.mobi/nathan/escape.nsf//D6Plinks/NTFN-7GA4FJ