Ask the Expert

Recurring meeting in Domino using Java API

I have to create a recurring meeting in Domino using Java API. The following is the code snippet I used. Is it required to give all of the instance dates to "CalendarDateTime" and "RepeatInstanceDates?" I am supplied with RRULE (vCalendar spec), so should I find out all of the instance dates by parsing this RRULE?
DbDirectory DbDir = 
m_Session.getDbDirectory(null); 
Database db = 
DbDir.openDatabase(m_strMailFileURL);
View appView = 
db.getView("Meetings");  
ViewEntryCollection entryColl =
 appView.getAllEntries();
// Create New document
Document newDoc = 
db.createDocument();
DocumentCollection dcl  = 
db.getAllDocuments();
   
   
newDoc.appendItemValue
("Form","Appointment");
   
   
newDoc.appendItemValue
("Chair",m_Session.getUserName()); 
//Mandatory Field
newDoc.appendItemValue
("AltChair",m_Session.getUserName());
newDoc.appendItemValue
("$PublicAccess","1");
newDoc.appendItemValue
("STARTDATETIME",getDateValueVector
("11/22/2004 09:00:00 
AM"));
newDoc.appendItemValue
("EndDateTime",getDateValueVector
("11/22/2004 10:00:00 
AM"));
newDoc.appendItemValue
("CalendarDateTime",
getDateValueVector("11/22/2004 
09:00:00 AM;11/23/2004 09:00:00 AM"));
newDoc.appendItemValue("RepeatDates",
getDateValueVector("11/22/2004 09:00:00 
AM;11/23/2004 09:00:00 AM"));
newDoc.appendItemValue
("RepeatInstanceDates",
getDateValueVector("11/22/2004 
09:00:00 AM;11/23/2004 09:00:00 AM"));
newDoc.appendItemValue
("RepeatEndDates",getDateValueVector
("11/22/2004 
10:00:00 AM;11/23/2004 10:00:00 AM"));
newDoc.appendItemValue("Subject",
"NewApp");
newDoc.appendItemValue
("StartTimeZone",new String
("Z=-3005$DO=0$ZX=35
$ZN=India"));
newDoc.appendItemValue
("EndTimeZone" ,new String
("Z=-3005$DO=0$ZX=35
$ZN=India"));
newDoc.appendItemValue
("AppointmentType","0");
newDoc.appendItemValue
("MeetingType", "1");
newDoc.appendItemValue
("RepeatUnit","D");
newDoc.appendItemValue
("RepeatHow","U");
newDoc.appendItemValue
("RepeatUntil",getDateValueVector("11/23/2004"));
newDoc.appendItemValue
("RepeatForUnit","D");
newDoc.appendItemValue
("RepeatWeekends","D");
newDoc.appendItemValue
("Repeats","1");

newDoc.appendItemValue
("RepeatStartDate",
getDateValueVector("11/22/2004 
09:00:00 AM"));
newDoc.appendItemValue
("RepeatEndDate",
getDateValueVector
("11/23/2004 10:00:00 
AM"));
newDoc.appendItemValue
("lastDate",getDateValueVector
("11/23/2004 10:00:00 
AM"));
newDoc.appendItemValue
("RepeatInterval","1");
newDoc.appendItemValue
("$NoPurge",getDateValueVector
("11/23/2004 10:00:00 
AM"));
newDoc.appendItemValue
("RepeatAdjust","");
newDoc.appendItemValue
("RepeatFromEnd","");
newDoc.appendItemValue
("RepeatFor","2");
newDoc.appendItemValue
("_ViewIcon",160);
newDoc.appendItemValue
("OrgTable","CO");
newDoc.appendItemValue
("$HFFlags","1");
newDoc.appendItemValue
("SchedulerSwitcher","1");
newDoc.appendItemValue
("SequenceNum",1);
newDoc.appendItemValue
("UpdateSeq",1);
.
.
.
getDateValueVector() will 
return a vector of DateTime objects..
Since you are using a document rather than the UI document, you will have to populate the field with every instance. It looks like you have a handle on the format of the RRULE, if not, information can be found at http://www.shuchow.com/vCalAddendum.html.

A better way to approach this is to compose an "Appointment" document from the workspace object. This opens a UI version of the document. Then you only need to populate the repeat start and end fields and the repeat format values and save the document –- the built in calendar code will create the correct response documents. To save and send invites without a prompt, set tmpAction equal to "6".

Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in November 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: