简体   繁体   English

Lotus Notes 8.5:使用Java创建会议

[英]Lotus Notes 8.5 : Create a meeting with java

I started to work with Lotus Notes 8.5, and i have to create meetings in Lotus by using Java, lotus.domino and Notes.jar. 我开始使用Lotus Notes 8.5,并且必须使用Java,lotus.domino和Notes.jar在Lotus中创建会议。

So, to do this, i create a new Document and fill it with all the needed fields (i think). 因此,为此,我创建了一个新文档,并用所有需要的字段填充(我认为)。 This is how i create my meeting : 这是我创建会议的方式:

Document newDocument = db.createDocument();

    newDocument.appendItemValue("Body", "Create meeting from java.");
    newDocument.appendItemValue("Notes", "Test Notes");
    newDocument.appendItemValue("Chair", "Me");
    newDocument.appendItemValue("Principal", "Me");
    newDocument.appendItemValue("$altPrincipal", "Me");
    newDocument.appendItemValue("ExcludeFromView", "D,S");
    newDocument.appendItemValue("UpdateSeq", 1);
    newDocument.appendItemValue("$CSVersion", "2");
    newDocument.appendItemValue("$SMTPKeepNotesItems", "1");
    newDocument.appendItemValue("$CSWISL", "$S:1,$L:1,$B:1,$R:1,$E:1,$W:1,$O:1,$M:1,RequiredAttendees:1,INetRequiredNames:1,AltRequiredNames:1,StorageRequiredNames:1,OptionalAttendees:1,INetOptionalNames:1,AltOptionalNames:1,StorageOptionalNames:1,ApptUNIDURL:1,STUnyteConferenceURL:1,STUnyteConferenceID:1,SametimeType:1,WhiteBoardContent:1,STRoomName:1");
    newDocument.appendItemValue("WebDateTimeInit", "1");
    newDocument.appendItemValue("OrgTable", "C0");
    newDocument.appendItemValue("$AlarmDisabled", "1");
    newDocument.appendItemValue("$HFFlags", "1");                     
    newDocument.appendItemValue("Form", "Appointment");
    newDocument.appendItemValue("$FromPreferredLanguage", "fr");
    newDocument.appendItemValue("ApptUNID", "267DEFCD6ADE4EF8C1257DF600464A1B642");
    newDocument.appendItemValue("$LangChair", "");
    newDocument.appendItemValue("AppointmentType", "3");
    newDocument.appendItemValue("$TableSwitcher", "Description");
    newDocument.appendItemValue("OnlineMeeting", "");
    newDocument.appendItemValue("From", "Me");
    newDocument.appendItemValue("AltChair", "Me");
    newDocument.appendItemValue("OnlinePlace", "");
    newDocument.appendItemValue("IsBroadcast", "");
    newDocument.appendItemValue("$ExpandGroups", 3);
    newDocument.appendItemValue("IsTeamCalendar", "");
    newDocument.appendItemValue("Importance", "");
    newDocument.appendItemValue("OrgConfidential", "");
    newDocument.appendItemValue("Subject", "Meeting test from Java");
    newDocument.appendItemValue("PreventCounter", "");
    newDocument.appendItemValue("Location", "R1");
    newDocument.appendItemValue("RoomToReserve", "");
    newDocument.appendItemValue("Resources", "");
    newDocument.appendItemValue("$PaperColor", 1);
    newDocument.appendItemValue("STRecordMeeting", "");
    newDocument.appendItemValue("WhiteBoardContent", "");
    newDocument.appendItemValue("Categories", "");
    newDocument.appendItemValue("$BorderColor", "7F96A3");
    newDocument.appendItemValue("$WatchedItems", "$S,$L,$B,$R,$E,$W,$O,$M,RequiredAttendees,INetRequiredNames,AltRequiredNames,StorageRequiredNames,OptionalAttendees,INetOptionalNames,AltOptionalNames,StorageOptionalNames,ApptUNIDURL,STUnyteConferenceURL,STUnyteConferenceID,SametimeType,WhiteBoardContent,STRoomName");
    newDocument.appendItemValue("CalForwardChairNotificationTo", "");
    newDocument.appendItemValue("ReturnReceipt", "");
    newDocument.appendItemValue("PreventDelegate", "");
    newDocument.appendItemValue("EnterSendTo", "");
    newDocument.appendItemValue("EnterCopyTo", "");
    newDocument.appendItemValue("EnterBlindCopyTo", "");
    newDocument.appendItemValue("ConferenceCallInfo", "");
    newDocument.appendItemValue("SchedulerSwitcher", "1");
    newDocument.appendItemValue("$Abstract", "");
    newDocument.appendItemValue("StartTimeZone", "Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe");
    newDocument.appendItemValue("EndTimeZone", "Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe");
    newDocument.appendItemValue("NewStartTimeZone", "");
    newDocument.appendItemValue("NewEndTimeZone", "");
    newDocument.appendItemValue("Encrypt", "Représentation invalide. (undefined)");
    newDocument.appendItemValue("Sign", "");
    newDocument.appendItemValue("MeetingType", "");
    newDocument.appendItemValue("$PublicAccess", "1");
    newDocument.appendItemValue("StartDate", "27/02/2015");
    newDocument.appendItemValue("StartTime", "11:00:00");
    newDocument.appendItemValue("STARTDATETIME", s.createDateTime(new GregorianCalendar(2015, 02, 27, 11, 0, 0)));
    newDocument.appendItemValue("EndDate", "27/02/2015");
    newDocument.appendItemValue("EndTime", "13:00:00");
    newDocument.appendItemValue("EndDateTime", s.createDateTime(new GregorianCalendar(2015, 02, 27, 13, 0, 0)));
    newDocument.appendItemValue("CalendarDateTime", s.createDateTime(new GregorianCalendar(2015, 02, 27, 11, 0, 0)));
    newDocument.appendItemValue("_ViewIcon", 158);
    newDocument.appendItemValue("$ShowComments", "Normal");
    newDocument.appendItemValue("$ShowDescription", "Show");
    newDocument.appendItemValue("$BusyName", "Me");
    newDocument.appendItemValue("$BusyPriority", "1");
    newDocument.appendItemValue("SequenceNum", 2);
    newDocument.appendItemValue("$CSTrack", "Imported from my contacts at 02/24/2015 14:00:17");
    newDocument.appendItemValue("$NoPurge", s.createDateTime(new GregorianCalendar(2015, 02, 27, 13, 0, 0)));
    newDocument.appendItemValue("$UpdatedBy", "Me");
    newDocument.appendItemValue("$Revisions", s.createDateTime(new GregorianCalendar(2015, 02, 24, 13, 48, 31)));
    newDocument.appendItemValue("tmpUseLongDate", s.createDateTime(new GregorianCalendar(2015, 02, 27, 11, 0, 0)));         
    newDocument.appendItemValue("tmpEventLabel", "Meeting from Java (tmpEventLabel)");  
    newDocument.appendItemValue("dispRepeatText", "Meeting from Java (dispRepeatText)");
    newDocument.appendItemValue("tmpHideTimeZone", "");
    newDocument.appendItemValue("tmpStartDate1", "27/02/2015");

    newDocument.save();

When i came back to Lotus, the meeting is created and shown in the calendar. 当我回到Lotus时,会议即被创建并显示在日历中。 The problem is, whatever field i add or remove, when i click on this meeting, Lotus throw me an error, saying (approximate translation from french): 问题是,无论我添加或删除任何字段,当我单击此会议时,Lotus都会向我抛出一个错误,说(法语近似翻译):

Field : 'tmpStartDate1' : Temporary data required for operator or @ function 字段:“ tmpStartDate1”:运算符或@函数所需的临时数据

So i add this new field in java, launch the program, create a meeting, and... 所以我在Java中添加了这个新字段,启动了程序,创建了会议,然后...

Field : 'tmpHideTimeZone' : Temporary data required for operator or @ function 字段:“ tmpHideTimeZone”:运算符或@函数所需的临时数据

For now, it is the 5th field Lotus asked me with this message.... 现在,这是Lotus向我询问此消息的第五个字段。

All 'tmp******' fields are missing, but i don't know them. 所有“ tmp ******”字段都不存在,但我不知道。 I thought those fields could be generated by Lotus, because of the 'tmp', but how ? 由于“ tmp”,我认为这些字段可以由Lotus生成,但是如何?

I compare with other meetings created with Lotus Notes, and there are no such 'tmp' fields. 我将其与使用Lotus Notes创建的其他会议进行比较,并且没有这样的“ tmp”字段。

Any ideas ? 有任何想法吗 ?

EDIT : 编辑:

I tried this : 我尝试了这个:

newDocument.computeWithForm(true, true);

It throws a NotesException if your document isn't in a good format. 如果您的文档格式不正确,则会引发NotesException。 When i execute my code (approximate translation again...) : 当我执行我的代码(再次近似翻译...)时:

NotesException: Incorrect data type in the field. NotesException:字段中的数据类型不正确。

I tried computeWithForm in another program where I create and add a contact to Lotus, and i didn't get any errors. 我在另一个创建和向Lotus添加联系人的程序中尝试了computeWithForm ,但没有收到任何错误。

So indeed, there is a problem with meeting's fields... 所以的确,会议领域存在问题...

EDIT : 编辑:

Any new ideas ? 有什么新想法吗? I am a bit confused about how to develop on this software.... 我对如何在此软件上进行开发感到困惑。

Items have types too ! 项目也有类型! Also a date is not a string, a date is a complicated animal, looks innocuous at first sight, but can bite very hard. 日期也不是字符串,日期是复杂的动物,乍一看看上去无害,但会咬得很硬。

The Document.appendItemValue method coerces the item to be of Text type. Document.appendItemValue方法将项目强制为Text类型。 For date/time (not temporary ;-) items you should use Document.ReplaceItemValueCustomData and pass it an argument of class DateTime . 对于日期/时间(不是临时的;-)项目,应使用Document.ReplaceItemValueCustomData并将其传递给DateTime类的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM