int dateCount = 0;
Session s = Factory.getSession();
Name sname = s.getUserNameObject();
DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss");
System.out.println(df.format(new Date()) + " Name: " + sname.getCanonical());
Database db = s.getDatabase("", "events4.nsf");
if (!db.isOpen()) {
db.open();
}
Vector<Form> forms = db.getForms();
System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Forms");
for (Form form : forms) {
// System.out.println("Form : " + form.getName() + " (" + DominoUtils.getUnidFromNotesUrl(form.getNotesURL()) + ")");
Document d = form.getDocument();
Vector<Object> v = d.getItemValue("$UpdatedBy");
Name n = s.createName((String) v.get(0));
nameCount++;
docCount++;
// System.out.println("Last Editor: " + n);
}
System.out.println("ENDING ITERATION of Forms");
Set<Document> secondReference = new HashSet<Document>();
Set<Document> thirdReference = new HashSet<Document>();
System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Documents");
DocumentCollection dc = db.getAllDocuments();
for (Document doc : dc) {
docCount++;
Vector<Object> v = doc.getItemValue("$UpdatedBy");
for (Object o : v) {
if (o instanceof String) {
Name n = s.createName((String) o);
nameCount++;
}
}
// if (docCount % 1000 == 0) {
// secondReference.add(db.getDocumentByID(doc.getNoteID()));
// }
if (docCount % 1000 == 0) {
secondReference.add(db.getDocumentByID(doc.getNoteID()));
System.out.println("Created second reference for " + doc.getNoteID());
}
if (docCount % 2000 == 0) {
thirdReference.add(db.getDocumentByUNID(doc.getUniversalID()));
System.out.println("Created second reference for " + doc.getUniversalID());
}
DateTime toxic = doc.getLastModified();
String busyWork = toxic.getGMTTime();
DateTime toxic2 = doc.getLastModified();