JAVA/CORBA CLASSES
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) DocumentCollection dc = agentContext.getUnprocessedDocuments(); Document doc = dc.getFirstDocument(); // If password exists, verify it String password = doc.getItemValueString("Password"); if (password != null && password != "" && password.length() > 0) { String pVerify = doc.getItemValueString("PasswordVerification"); if (pVerify != null && pVerify != "" && pVerify.length() > 0) { if (session.verifyPassword(pVerify, password)) System.out.println("Password verification OK"); else System.out.println("Password verification failed"); doc.replaceItemValue("PasswordVerification", ""); doc.save(true, true, true); } else System.out.println("Password verification not specified"); } else { // if password does not exist, create it String pCreate = doc.getItemValueString("PasswordCreate"); if (pCreate != null && pCreate != "" && pCreate.length() >0) { doc.replaceItemValue("Password", session.hashPassword(pCreate)); doc.replaceItemValue("PasswordCreate", ""); doc.save(true, true, true); System.out.println("Password created"); } else System.out.println("Password not specified"); } } catch(Exception e) { e.printStackTrace(); } } }
See Also