// do some fun with the checkin
System.err.println("Current docs:");
List<CHKDocument> docs = ctlib.getCheckInService().getDocuments();
for (int i = 0; i < docs.size(); i++) {
CHKDocument doc = docs.get(i);
ctlib.getCheckInService().fillDocument(doc);
System.err.println("\tDoc: " + doc.getTitle());
for (int j = 0; j < doc.getAssignees().size(); j++) {
CDBPerson p = doc.getAssignees().get(j);
System.err.println("\t\t" + p.getName() + " " + p.getLastName());
}
}
System.err.println("------");
// New document
CHKDocument doc = new CHKDocument();
doc.setTitle("Doc for " + new Date());
doc.setDescription("test doc");
ctlib.getCheckInService().setDocument(doc); // Register new document in the db
Random rnd = new Random();
rnd.setSeed(new Date().getTime());
for (int i = 0; i < rnd.nextInt(persons.size()); i++) {
doc.pushPerson(persons.get(rnd.nextInt(persons.size())));
ctlib.getCheckInService().addPerson(doc);
}
}