public class SendMailTest
{
public boolean send(String uniqueId, Date reviewDateStartTime,
String reviewLocation, int reviewDurationMnts, String from,
String to, String title, String reviewSubject,
String reviewDescription, String summary) throws Exception {
public String getReviewTime(Date reviewDateTime, int rDuration, boolean flag) {
Calendar c = Calendar.getInstance();
SimpleDateFormat s = new SimpleDateFormat("yyyyMMdd");
c.setTime(reviewDateTime);
if (flag == true) {
c.add(Calendar.MINUTE, rDuration);
}
String hour = c.get(Calendar.HOUR_OF_DAY) < 10 ? "0"
+ c.get(Calendar.HOUR_OF_DAY) : ""
+ c.get(Calendar.HOUR_OF_DAY);
String min = c.get(Calendar.MINUTE) < 10 ? "0" + c.get(Calendar.MINUTE)
: "" + c.get(Calendar.MINUTE);
String sec = c.get(Calendar.SECOND) < 10 ? "0" + c.get(Calendar.SECOND)
: "" + c.get(Calendar.SECOND);
String date = s.format(new Date(c.getTimeInMillis()));
String dateTime = date + "T" + hour + min + sec;
return dateTime;
}
private class ByteArrayDataSource implements DataSource {
private byte[] data; // data for mail message
private String type; // content type/mime type
ByteArrayDataSource(String data, String type) {
try {
// Assumption that the string contains only ascii
// characters ! Else just pass in a charset into this
// constructor and use it in getBytes()
this.data = data.getBytes("iso-8859-1");
} catch (Exception e) {
e.printStackTrace();
}
this.type = type;
}
// DataSource interface methods
public InputStream getInputStream() throws IOException {
if (data == null)
throw new IOException(
"no data exception in ByteArrayDataSource");
return new ByteArrayInputStream(data);
}
public OutputStream getOutputStream() throws IOException {
throw new IOException("illegal operation in ByteArrayDataSource");
}
the above code is used to send a meeting request to MS outlook with the specified date and time and the recipient can accept or reject the request . when the recipient accepts the request the task appears on their calender but when the request is rejected theres no response to the java application.
My requirement is blocking the calender of MS outlook with a task that originates from my application.
and i seen a couple of connectors and api s like jintegra and moyosoft but they are not free.
Do you mean you don't want the recipient to have the option to accept or reject the meeting request, you just want to forcibly book time in their calendar?
can someone tell me how can i update a task .... only using java code ...
Drook,
Were you able to find a solution to this problem ? - I have exactly the same requirements you had i.e recipients book timeslot through Java application and It need to appear in Outlook Calendar (without them taking action to Accept the Meeting as it is they who put the invite) - Please let me know - This would save a big effort for me!!!
Bookmarks