// Sorts a NotesDocumentCollection by item name // @param col, unsorted NotesDocumentCollection // @param iName, the name of the item to sort the collection by. // @return sorted NotesDocumentCollection // @author Ulrich Krause // @version 1.0 function sortColByItemName(col:NotesDocumentCollection, iName:String) { var rl:java.util.Vector = new java.util.Vector(); var doc:NotesDocument = col.getFirstDocument(); var tm:java.util.TreeMap = new java.util.TreeMap(); while (doc != null) { tm.put(doc.getItemValueString(iName), doc); doc = col.getNextDocument(doc); } var tCol:java.util.Collection = tm.values(); var tIt:java.util.Iterator = tCol.iterator(); while (tIt.hasNext()) { rl.add(tIt.next()); } return rl; }