Using Java to access the "Calendar" folder through IMAP

sigurdur.sveinsson at teamware.com sigurdur.sveinsson at teamware.com
Mon Mar 22 05:54:54 MST 2004


Hi

I'm using Java (javax.mail.*) to interact with the "Calendar" folder in 
GroupWise, read, write and delete calendar entries.

There is one bug I'm hitting when creating calendar entries. The calendar 
entries I create through Java are all marked as "Appointment From 
<Teamware - Novell Groupwise IMAP connector>" and 
the "From", "When", "Where" and "Subject" fields are not editable in the 
GW Client.

I thought this was because I set the "From" field to a different text 
than appears when creating the calendar entries in the GW Client. I found 
out that the "From" field in those entries have the string "Sveinsson 
<Siggi.ArraPostOffice.ArraDomain>" which is the user who owns the 
Calendar folder, but the same happens when I put this string 
("Sveinss...") in the "From" when creating them in Java.

The way I´m creating the calendar entry is like this:

------------
...
MimeMessage msg = new MimeMessage(NewEntryRequest.this.getSession());
// setting the message's headers:
msg.setHeader("Mime-Version","1.0");
msg.setHeader("X-Mailer","Teamware Oy//Novell Groupwise IMAP connector");
msg.setHeader("Subject", "Some subject");
msg.setHeader("Date","Tue, 13 Mar 2004 17:11:22 +0000");
msg.setHeader("From","Sveinsson <Siggi.ArraPostOffice.ArraDomain>");

MimeBodyPart firstMimeBodyPart = getFirstBodyPart();
MimeBodyPart secondMimeBodyPart = getSecondBodyPart();

// add the body parts to the multi part
MimeMultipart mimeMultiPart = new MimeMultipart("alternative");
mimeMultiPart.addBodyPart(firstMimeBodyPart);
mimeMultiPart.addBodyPart(secondMimeBodyPart);

// add the multi part to the message
msg.setContent(mimeMultiPart);

Message[] messages = new Message[1];
messages[0] = msg;

folder.appendMessages(messages);
...
------------

The calendar entries created like this and through the GW Client are 
identical when I view the "Message Source" in Microsoft Outlook (Open the 
calendar entry -> Alt+Enter -> Details -> Message Source ). There the 
VCalendar and the headers all look the same.

My question is then: How to create Calendar entry with Java through IMAP 
which will be editable in the GroupWise Client?

Kind regards,
Siggi




More information about the Gwimap-dev mailing list