Use Java to access Domino resources and implement RSS for Domino Mail

Source: Internet
Author: User
Source code (Please forgive me for writing rough grass ):

 Package net. jite. jitebook. servlet;

Import java. Io. fileoutputstream;
Import java. Io. printwriter;
Import javax. servlet. http. httpservlet;
Import Lotus. Domino. database;
Import Lotus. Domino. Document;
Import Lotus. Domino. notesfactory;
Import Lotus. Domino. Session;
Import Lotus. Domino. view;

Import com. rsslibj. elements. channel;
Public class rssservlet extends httpservlet {
Public static void main (string [] ARGs) throws instantiationexception, classnotfoundexception,
Illegalaccessexception {
Try {
Session session = notesfactory. createsession ("127.0.0.1: 63148", "R/chengs", "7758521 ");
Database mail = session. getdatabase ("", "mail \ r. nsf ");
View view = Mail. getview ("($ inbox )");
Document Doc = view. getfirstdocument ();
Channel channel = new channel ();
Channel. setdescription ("this is my first channel .");
Channel. setlink ("http: // l93851.7/mail/R. nsf ");
Channel. settitle ("Domino Mail ");
Channel. setimage ("http: // l93851.7 /",
"The channel image ",
"Http: // localhost/foo.jpg ");
While (Doc! = NULL ){
Channel. additem ("http: // 192.168.1.7/mail/" + mail. getfilename () + "/0/" + Doc. getnoteid (), Doc. getitemvaluestring ("subject"), Doc. getitemvaluestring ("body ")). setdccontributor ("ROC ");
Doc = view. getnextdocument (DOC );
}
Printwriter PW = new printwriter (New fileoutputstream ("e :\\ Software \ Lotus \ domino \ data \ domino \ HTML \ mail. xml "));
PW. Print (Channel. getfeed ("RSS "));
PW. Close ();
}
Catch (exception e ){
E. printstacktrace ();
}

}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.