Authors (NotesDocument - JavaScript™)
Read-only. The names of the people who have saved a document.
Defined in
NotesDocumentSyntax
getAuthors() : java.util.Vector
Usage
If a name is hierarchical, this property returns the fully distinguished name.This property does not return
the names of people who have permission to edit a document (as found
in an item of type Authors
). Therefore, the people
returned by the Authors
property and the people listed
in an Authors
item may differ.
Examples
This button gets all the authors in a database or a subset of a database.// Open database - get name from user
var db:NotesDatabase = session.getDatabase(null, requestScope.query, false);
if (db == null) {
requestScope.status = "Cannot open " + requestScope.query;
} else {
requestScope.status = "Opened " + requestScope.query;
var limit:int = 0;
var dc:NotesDocumentCollection = db.getAllDocuments();
if (dc.getCount() == 0) {
requestScope.status += "\nNo documents";
return;
}
// Get authors for each document - eliminate duplicates
var doc:NotesDocument = dc.getFirstDocument();
var authorsAll:java.util.Vector = new java.util.Vector();
var authors:java.util.Vector = new java.util.Vector();
while (doc != null) { // append authors to allAuthors
authors = doc.getAuthors();
var ai = authors.iterator();
while (ai.hasNext()) { // remove duplicates
if (authorsAll.contains(ai.next())) {
ai.remove();
}
}
authorsAll.addAll(authors);
authors.clear();
if (++limit > 1024) break; // for big database, just do first 1000
var tmpdoc = dc.getNextDocument();
doc.recycle(); // recycle to avoid memory problems
doc = tmpdoc;
}
// Display each element of the compiled list
ai = authorsAll.iterator();
while (ai.hasNext()) {
requestScope.status += "\n" + ai.next().toString();
}
}