use of com.zimbra.client.ZInvite.ZOrganizer in project zm-mailbox by Zimbra.
the class TestUtil method createAppointment.
public static ZAppointmentResult createAppointment(ZMailbox mailbox, String subject, String attendee, Date startDate, Date endDate) throws ServiceException {
ZInvite invite = new ZInvite();
ZInvite.ZComponent comp = new ZComponent();
comp.setStatus(ZStatus.CONF);
comp.setClassProp(ZClass.PUB);
comp.setTransparency(ZTransparency.O);
comp.setStart(new ZDateTime(startDate.getTime(), false, mailbox.getPrefs().getTimeZone()));
comp.setEnd(new ZDateTime(endDate.getTime(), false, mailbox.getPrefs().getTimeZone()));
comp.setName(subject);
comp.setOrganizer(new ZOrganizer(mailbox.getName()));
if (attendee != null) {
attendee = addDomainIfNecessary(attendee);
ZAttendee zattendee = new ZAttendee();
zattendee.setAddress(attendee);
zattendee.setRole(ZRole.REQ);
zattendee.setParticipantStatus(ZParticipantStatus.NE);
zattendee.setRSVP(true);
comp.getAttendees().add(zattendee);
}
invite.getComponents().add(comp);
ZOutgoingMessage m = null;
if (attendee != null) {
m = getOutgoingMessage(attendee, subject, "Test appointment", null);
}
return mailbox.createAppointment(ZFolder.ID_CALENDAR, null, m, invite, null);
}
use of com.zimbra.client.ZInvite.ZOrganizer in project zm-mailbox by Zimbra.
the class TestSearchTask method init.
@BeforeClass
public static void init() throws ServiceException {
TestUtil.deleteAccountIfExists(USER_NAME);
TestUtil.createAccount(USER_NAME);
mbox = TestUtil.getZMailbox(USER_NAME);
for (int i = 0; i < numTasks; i++) {
ZOutgoingMessage msg = TestUtil.getOutgoingMessage(USER_NAME, null, String.format("task body %d", i), null);
ZInvite inv = new ZInvite();
ZInvite.ZComponent comp = new ZComponent();
comp.setIsAllDay(true);
comp.setStatus(ZStatus.NEED);
comp.setLocation("mount erebor");
comp.setPercentCompleted("0");
comp.setPriority("0");
comp.setName(String.format("destroy the one ring %d", i));
comp.setOrganizer(new ZOrganizer(mbox.getName()));
inv.getComponents().add(comp);
ZAppointmentResult resp = mbox.createTask("15", null, msg, inv, null);
ids.add(resp.getInviteId());
}
}
Aggregations