Domino Code Fragment
Code Name* FormatMsgWithDoclinks method; IsDoScore, IsDoSubject, and SubjectItemName properties | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.3.143.9.115 | |
Description* This agent makes a document collection of all documents in the current database containing the word "archanid," then makes a newsletter based on this document collection. The agent formats a messge with links to the newsletter documents and mails it to the current user. | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class formatmsgagent 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", 0);
if (dc.getCount()>0)
{
Newsletter news = s.createNewsletter(dc);
news.setSubjectItemName("Subject");
news.setDoSubject(true);
news.setDoScore(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();
}
}
}