Domino Code Fragment
Code Name* Making a Notes newsletter | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.52.14.126.74 | |
Description* 1. This agent creates a newsletter consisting of links to all the documents in the current database that contain the word "arachnid" and mails the newsletter to the current user. | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class newsletter1agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Database db = ac.getCurrentDatabase();
db.updateFTIndex(true);
DocumentCollection dc = db.FTSearch("arachnid", 15);
if (dc.getCount()>0)
{
Newsletter news = s.createNewsletter(dc);
news.setSubjectItemName("Subject");
news.setDoSubject(true);
Document doc = news.formatMsgWithDoclinks(db);
doc.appendItemValue("Form", "Memo");
doc.appendItemValue("Subject", "The Arachnid Report");
doc.send (false, s.getUserName());
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}