use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method itemAction.
// ------------------------
private Element itemAction(String op, String id, String constraints) {
Element req = newRequestElement(MailConstants.ITEM_ACTION_REQUEST);
Element actionEl = req.addUniqueElement(MailConstants.E_ACTION);
actionEl.addAttribute(MailConstants.A_ID, id);
actionEl.addAttribute(MailConstants.A_OPERATION, op);
if (constraints != null) {
actionEl.addAttribute(MailConstants.A_TARGET_CONSTRAINT, constraints);
}
return actionEl;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method createTaskException.
public ZAppointmentResult createTaskException(String id, String component, ZDateTime exceptionId, ZOutgoingMessage message, ZInvite invite, String optionalUid) throws ServiceException {
Element req = newRequestElement(MailConstants.CREATE_TASK_EXCEPTION_REQUEST);
req.addAttribute(MailConstants.A_ID, id);
req.addAttribute(MailConstants.E_INVITE_COMPONENT, component);
Element mEl = getMessageElement(req, message, null);
Element invEl = invite.toElement(mEl);
Element compEl = invEl.getElement(MailConstants.E_INVITE_COMPONENT);
exceptionId.toElement(MailConstants.E_CAL_EXCEPTION_ID, compEl);
if (optionalUid != null) {
invEl.addAttribute(MailConstants.A_UID, optionalUid);
}
return new ZAppointmentResult(invoke(req));
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method refreshVoiceMailInbox.
/** Makes a server call to get updated message/unheard counts for the folders */
private void refreshVoiceMailInbox(String phone) throws ServiceException {
ZPhoneAccount account = getPhoneAccount(phone);
if (account == null) {
return;
}
Element req = newRequestElement(VoiceConstants.GET_VOICE_FOLDER_REQUEST);
setVoiceStorePrincipal(req);
Element phoneEl = req.addElement(VoiceConstants.E_PHONE);
phoneEl.addAttribute(MailConstants.A_NAME, phone);
Element response = invoke(req);
Element phoneResponse = response.getElement(VoiceConstants.E_PHONE);
if (phoneResponse != null) {
ZFolder rootFolder = account.getRootFolder();
Element rootEl = phoneResponse.getElement(MailConstants.E_FOLDER);
for (Element childEl : rootEl.listElements(MailConstants.E_FOLDER)) {
String name = childEl.getAttribute(MailConstants.A_NAME);
ZFolder childFolder = rootFolder.getSubFolderByPath(name);
if (childFolder != null) {
childFolder.setUnreadCount((int) childEl.getAttributeLong(MailConstants.A_UNREAD, 0));
childFolder.setMessageCount((int) childEl.getAttributeLong(MailConstants.A_NUM, 0));
}
}
}
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method folderAction.
private Element folderAction(String op, String ids) {
Element req = newRequestElement(MailConstants.FOLDER_ACTION_REQUEST);
Element actionEl = req.addUniqueElement(MailConstants.E_ACTION);
actionEl.addAttribute(MailConstants.A_ID, ids);
actionEl.addAttribute(MailConstants.A_OPERATION, op);
return actionEl;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method createAppointment.
public ZAppointmentResult createAppointment(String folderId, String flags, ZOutgoingMessage message, ZInvite invite, String optionalUid) throws ServiceException {
Element req = newRequestElement(MailConstants.CREATE_APPOINTMENT_REQUEST);
//noinspection UnusedDeclaration
Element mEl = getMessageElement(req, message, null);
if (flags != null) {
mEl.addAttribute(MailConstants.A_FLAGS, flags);
}
if (folderId != null) {
mEl.addAttribute(MailConstants.A_FOLDER, folderId);
}
Element invEl = invite.toElement(mEl);
if (optionalUid != null) {
invEl.addAttribute(MailConstants.A_UID, optionalUid);
}
return new ZAppointmentResult(invoke(req));
}
Aggregations