在IBM Lotus Domino Designer中使用Java构建应用程序 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-20
|
personDocument = view.getFirstDocument();
while (personDocument != null)
{
Database mailDatabase;
try {
mailDatabase = session.getDatabase (
personDocument.getItemValueString("MailServer"),
personDocument.getItemValue String ("MailFile"));
temp = "Mail Owner: " + personDocument.getItemValueString("FullName")
+ " Size: " + mailDatabase.getSize()
+ " _ bytes Template: " + mailDatabase.getDesignTemplateName();
mailDatabase.recycle();
} catch (Exception e) {
temp = "Could not open mail file for: " +
personDocument.getItemValueString("FullName") + " Server: " +
personDocument.getItemValueString("MailServer") + " , " +
personDocument.getItemValueString("MailFile");
}
richTextItem.appendText(temp);
richTextItem.addNewLine(1);
temp = "";
tempDocument = view.getNextDocument(personDocument);
personDocument.recycle();
personDocument = tempDocument;
}
report.send(false, "Enter_Email_Address_Here");
if (session !=null)
session.recycle();
if (agentContext !=null)
agentContext.recycle();
if (nab != null)
nab.recycle();
if (reportDatabase !=null)
reportDatabase.recycle();
if (personDocument !=null)
personDocument.recycle();
if (report !=null)
report.recycle();
if (view !=null)
view.recycle();
if (richTextItem !=null)
richTextItem.recycle();
} catch(Exception e) {
e.printStackTrace();
}
}
}
壓IBM Lotus Domino Designer嶄聞喘Java更秀哘喘殻會(15)
扮寂:2011-01-24 IBM Oscar Hernandez
燕 8 祉悳阻曾嶽囂冱議曳熟。
燕 8. 幣箭 3 曾嶽囂冱岻寂議曳熟
LotusScript |
Java |
幣箭 3?喘喨周方象垂佚連伏撹烏御
Dim session As New Notessession
Dim nab As New Notesdatabase(
"Enter_Server_Name_Here",
"names.nsf")
Dim reportDatabase As Notesdatabase
Dim personDocument As NotesDocument
Dim report As NotesDocument
Dim view As NotesView
Dim temp As String
Set reportDatabase = session.CurrentDatabase
Set report = reportDatabase.CreateDocument
Call report.ReplaceItemValue("Form" , "Memo")
Call report.ReplaceItemValue("Subject" ,
"MailApplications Report")
Dim richTextItem As New NotesRichTextItem(report,
"Body")
Set view = nab.GetView("People")
Set personDocument = view.GetFirstDocument
While Not personDocument Is Nothing
On Error Resume Next
Dim mailDatabase As New NotesDatabase(
personDocument.mailserver(0),
personDocument.mailfile(0))
If mailDatabase.IsOpen Then
temp = "Mail Owner: " &
personDocument.fullname(0) &
"Size: " & Cstr(mailDatabase.size) &
" _ bytes Template: " +
mailDatabase.DesignTemplateName
Else
temp = "Could not open mail file for: " &
personDocument.fullname(0) &
"Server: " &
personDocument.mailserver(0) &
" , " & personDocument.mailfile(0)
End If
richTextItem.AppendText(temp)
richTextItem.AddNewline(1)
temp = ""
Set personDocument=view.GetNextDocument(
personDocument)
Wend
Call report.Send(False,"Enter_Email_Address_Here") |
|
幣箭 3?喘喨周方象垂佚連伏撹烏御
Session session = getSession();
AgentContext agentContext =session.getAgentContext();
Database nab;
nab = session.getDatabase("Enter_Server_Name_Here",
"names.nsf");
Database reportDatabase;
Document personDocument;
Document report;
Document tempDocument;
View view;
String temp;
reportDatabase =agentContext.getCurrentDatabase();
report = reportDatabase.createDocument();
report.replaceItemValue("Form" , "Memo");
report.replaceItemValue("Subject" ,
"MailApplications Report");
RichTextItem richTextItem;
richTextItem = report.createRichTextItem("Body");
view = nab.getView("People");
personDocument = view.getFirstDocument();
while (personDocument != null)
{
Database mailDatabase;
try {
mailDatabase = session.getDatabase(
personDocument.getItemValueString("MailServer"),
personDocument.getItemValueString("MailFile"));
temp = "Mail Owner: " +
personDocument.getItemValueString("FullName") +
"Size: " + mailDatabase.getSize() +
" _bytes Template: " +
mailDatabase.getDesignTemplateName();
mailDatabase.recycle();
} catch (Exception e) {
temp = "Could not open mail file for: " +
personDocument.getItemValueString("FullName") + "
Server: " +
personDocument.getItemValueString("MailServer") +
" , " +
personDocument.getItemValueString("MailFile");
}
richTextItem.appendText(temp);
richTextItem.addNewLine(1);
temp = "";
tempDocument = view.getNextDocument(personDocument);
personDocument.recycle();
personDocument = tempDocument;
}
report.send(false,"Enter_Email_Address_Here");
if (session !=null)
session.recycle();
if (agentContext !=null)
agentContext.recycle();
if (nab != null)
nab.recycle();
if (reportDatabase !=null)
reportDatabase.recycle();
if (personDocument !=null)
personDocument.recycle();
if (report !=null)
report.recycle();
if (view !=null)
view.recycle();
if (richTextItem !=null)
richTextItem.recycle();
|
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn
为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!
|