Search in sources :

Example 1 with ModifyAppointmentRequest

use of com.zimbra.soap.mail.message.ModifyAppointmentRequest in project zm-mailbox by Zimbra.

the class TestJaxb method organizerChangeTimeForMeeting.

/**
 * @param hit - From search response - represents the organizer's calendar copy
 * @throws ServiceException
 */
private ZMessage organizerChangeTimeForMeeting(ZMailbox attendeeBox, ZMailbox organizerBox, ZDateTime newStart, ZDateTime newEnd, AppointmentHitInfo hit, String subject) throws Exception {
    InviteComponent inviteComp = createInviteComponentSkeleton(subject, "room 101", organizerBox, attendeeBox);
    inviteComp.setDtStart(DtTimeInfo.createForDatetimeAndZone(newStart.getDateTime(), newStart.getTimeZoneId()));
    inviteComp.setDtEnd(DtTimeInfo.createForDatetimeAndZone(newEnd.getDateTime(), newEnd.getTimeZoneId()));
    InvitationInfo invite = new InvitationInfo();
    invite.setUid(hit.getUid());
    invite.setInviteComponent(inviteComp);
    Msg msg = new Msg();
    msg.setFolderId(hit.getFolderId());
    msg.setInvite(invite);
    EmailAddrInfo attendeeAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(attendeeBox.getName(), getCN(attendeeBox), "t");
    msg.addEmailAddress(attendeeAddr);
    msg.setSubject(subject);
    msg.setMimePart(makeTextAndHtmlAlternatives(String.format("The following meeting has been modified:\n\n%s", subject)));
    ModifyAppointmentRequest maReq = ModifyAppointmentRequest.createForIdModseqRevCompnumMsg(hit.getInvId(), hit.getModifiedSequence(), hit.getRevision(), hit.getComponentNum(), msg);
    ModifyAppointmentResponse maResp = organizerBox.invokeJaxb(maReq);
    Assert.assertNotNull("JAXB ModifyAppointmentResponse", maResp);
    return waitForInvite(attendeeBox, subject);
}
Also used : Msg(com.zimbra.soap.mail.type.Msg) ModifyAppointmentRequest(com.zimbra.soap.mail.message.ModifyAppointmentRequest) InvitationInfo(com.zimbra.soap.mail.type.InvitationInfo) EmailAddrInfo(com.zimbra.soap.mail.type.EmailAddrInfo) ModifyAppointmentResponse(com.zimbra.soap.mail.message.ModifyAppointmentResponse) InviteComponent(com.zimbra.soap.mail.type.InviteComponent)

Aggregations

ModifyAppointmentRequest (com.zimbra.soap.mail.message.ModifyAppointmentRequest)1 ModifyAppointmentResponse (com.zimbra.soap.mail.message.ModifyAppointmentResponse)1 EmailAddrInfo (com.zimbra.soap.mail.type.EmailAddrInfo)1 InvitationInfo (com.zimbra.soap.mail.type.InvitationInfo)1 InviteComponent (com.zimbra.soap.mail.type.InviteComponent)1 Msg (com.zimbra.soap.mail.type.Msg)1