gpt4 book ai didi

java - 通过 java domino api 从 Lotus 发送日历邀请以进行交换

转载 作者:行者123 更新时间:2023-12-02 05:15:32 25 4
gpt4 key购买 nike

我正在尝试通过 JAVA Domino API 将日历邀请从 Lotus 发送到 Exchange。当我从一个 Lotus 帐户发送邀请到另一个 Lotus 帐户时,它是成功的。但是,当我将其发送到某个 Exchange 邮件帐户时,exchange 并未将其显示为邀请。

我使用的代码如下:

package com.test;

import java.util.Date;
import java.util.Vector;

import lotus.domino.Database;
import lotus.domino.DateTime;
import lotus.domino.Document;
import lotus.domino.NotesFactory;
import lotus.domino.Session;
import lotus.entity.Meeting;

import com.data.Strings;

public class CalenderTest {

public static void main(String[] args){

Vector<String> sendTo = new Vector<String>();
sendTo.add("xxxx.xx.com");

Meeting m = new Meeting();
m.setDate("04-04-2013");
m.setTime("06:06:06");
m.setHours("4");
m.setChair("xxxx.xx.com");
m.setSubject("Testing Calendar");
m.setLocation("TestLocation");
m.setBody("TestBody");
m.setSendTo(sendTo);

try
{
Session s = NotesFactory.createSessionWithIOR(Strings.IOR, "xxxxxxx", "xxxxx");
Database db = s.getDatabase(s.getServerName(), "xxxx");

Document doc1 = db.createDocument();
doc1.appendItemValue("Form","Notice");
doc1.appendItemValue("NoticeType","I");
doc1.appendItemValue("_ViewIcon","133.0");
doc1.appendItemValue("AppointmentType","3");
Session stmp = db.getParent();
String[] date = m.getDate().split("-");
String[] time = m.getTime().split(":");
Date exdate = new Date();
exdate.setDate(Integer.parseInt(date[0]));
exdate.setHours(Integer.parseInt(time[0]));
exdate.setMinutes(Integer.parseInt(time[1]));
exdate.setMonth(Integer.parseInt(date[1])-1);
exdate.setSeconds(Integer.parseInt(time[2]));
exdate.setYear(Integer.parseInt(date[2])-1900);
System.out.println(exdate.toString());
DateTime currTime = stmp.createDateTime(exdate);
doc1.appendItemValue("StartDateTime",currTime) ;
doc1.appendItemValue("CalendarDateTime",currTime);
doc1.appendItemValue("StartDate",currTime) ;
doc1.appendItemValue("StartTime",currTime) ;
currTime.adjustHour(Integer.parseInt(m.getHours()), true);
doc1.appendItemValue("EndDateTime",currTime) ;
doc1.appendItemValue("EndDate",currTime) ;
doc1.appendItemValue("EndTime",currTime) ;
doc1.appendItemValue("$NoPurge",currTime) ;
doc1.appendItemValue("Subject",m.getSubject());
doc1.appendItemValue("Location",m.getLocation());
doc1.appendItemValue("Body",m.getBody());
doc1.appendItemValue("From",s.getUserName());
doc1.appendItemValue("Chair",m.getChair());
doc1.appendItemValue("RequiredAttendees",m.getSendTo());
doc1.appendItemValue("OPTIONALATTENDEES",m.getCopyTo());
doc1.computeWithForm(true, false);
doc1.save(true, false, false);
doc1.send(m.getSendTo());
}
catch (Exception e) {
e.printStackTrace();
}
}
}

谁能给些建议?

最佳答案

一种可能是发送.ics 文件:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR

http://en.wikipedia.org/wiki/ICalendar

这是一个相关的问题:

unable to send meeting request from lotus notes to microsoft exchange using icalendar

关于java - 通过 java domino api 从 Lotus 发送日历邀请以进行交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14726336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com