use of com.zimbra.soap.mail.type.DtTimeInfo in project zm-mailbox by Zimbra.
the class TestExpandGroupInfo method createAppt.
private String createAppt(Account authAcct, String toAddress, String subject, String content) throws Exception {
SoapTransport transport = authUser(authAcct.getName());
Msg msg = new Msg();
EmailAddrInfo toAddr = new EmailAddrInfo(toAddress);
toAddr.setAddressType(EmailType.TO.toString());
msg.addEmailAddress(toAddr);
msg.setSubject(subject);
MimePartInfo mp = new MimePartInfo();
mp.setContentType("multipart/alternative");
MimePartInfo mpSub = new MimePartInfo();
mpSub.setContent(content);
mp.addMimePart(mpSub);
msg.setMimePart(mp);
InvitationInfo invite = new InvitationInfo();
InviteComponent invComp = new InviteComponent(ZCalendar.ICalTok.REQUEST.name(), 0, false);
CalOrganizer organizer = new CalOrganizer();
organizer.setAddress(authAcct.getName());
CalendarAttendee attendee = new CalendarAttendee();
attendee.setAddress(toAddress);
invComp.setOrganizer(organizer);
invComp.addAttendee(attendee);
invComp.setDtStart(new DtTimeInfo("20120101"));
invComp.setDtEnd(new DtTimeInfo("20120102"));
invite.setInviteComponent(invComp);
msg.setInvite(invite);
CreateAppointmentRequest req = new CreateAppointmentRequest();
req.setMsg(msg);
CreateAppointmentResponse resp = invokeJaxb(transport, req);
/*
String calItemId = resp.getCalItemId();
return calItemId;
*/
String invId = resp.getCalInvId();
return invId;
/*
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<userAgent xmlns="" name="ZimbraWebClient - FF10 (Mac)" version="0.0"/>
<session xmlns="" id="14"/>
<account xmlns="" by="name">user1@phoebe.mbp</account>
<format xmlns="" type="js"/>
</context>
</soap:Header>
<soap:Body>
<CreateAppointmentRequest xmlns="urn:zimbraMail">
<m xmlns="" l="10">
<inv>
<comp status="CONF" fb="B" class="PUB" transp="O" draft="0" allDay="0" name="test" loc="">
<at role="REQ" ptst="NE" rsvp="1" a="user2@phoebe.mbp"/>
<at role="REQ" ptst="NE" rsvp="1" a="user3@phoebe.mbp"/>
<s tz="America/Los_Angeles" d="20120227T080000"/>
<e tz="America/Los_Angeles" d="20120227T083000"/>
<or a="user1@phoebe.mbp" d="Demo User One"/>
<alarm action="DISPLAY">
<trigger>
<rel m="5" related="START" neg="1"/>
</trigger>
</alarm>
</comp>
</inv>
<e a="user2@phoebe.mbp" t="t"/>
<e a="user3@phoebe.mbp" t="t"/>
<su>test</su>
<mp ct="multipart/alternative">
<mp ct="text/plain">
<content>The following is a new meeting request: Subject: test Organizer: "Demo User One" <user1@phoebe.mbp> Time: Monday, February 27, 2012, 8:00:00 AM - 8:30:00 AM GMT -08:00 US/Canada Pacific Invitees: user2@phoebe.mbp; user3@phoebe.mbp *~*~*~*~*~*~*~*~*~* </content></mp><mp ct="text/html"><content><html><body><h3>The following is a new meeting request:</h3> <p> <table border='0'> <tr><th align=left>Subject:</th><td>test </td></tr> <tr><th align=left>Organizer:</th><td>"Demo User One" &lt;user1@phoebe.mbp&gt; </td></tr> </table> <p> <table border='0'> <tr><th align=left>Time:</th><td>Monday, February 27, 2012, 8:00:00 AM - 8:30:00 AM GMT -08:00 US/Canada Pacific </td></tr></table> <p> <table border='0'> <tr><th align=left>Invitees:</th><td>user2@phoebe.mbp; user3@phoebe.mbp </td></tr> </table> <div>*~*~*~*~*~*~*~*~*~*</div><br></body></html></content>
</mp>
</mp>
</m>
</CreateAppointmentRequest>
</soap:Body></soap:Envelope>
*/
}
Aggregations