use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method enableSharedReminder.
/**
* enable/disable displaying reminder for shared appointments/tasks
* @param mountpointId
* @param reminderEnabled
* @throws ServiceException
*/
public void enableSharedReminder(String mountpointId, boolean reminderEnabled) throws ServiceException {
Element req = newRequestElement(MailConstants.ENABLE_SHARED_REMINDER_REQUEST);
Element linkEl = req.addUniqueElement(MailConstants.E_MOUNT);
linkEl.addAttribute(MailConstants.A_ID, mountpointId);
linkEl.addAttribute(MailConstants.A_REMINDER, reminderEnabled);
invoke(req);
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method convAction.
private Element convAction(String op, String id, String constraints) {
Element req = newRequestElement(MailConstants.CONV_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 internalSearch.
// ------------------------
private synchronized ZSearchResult internalSearch(String convId, ZSearchParams params, boolean nest) throws ServiceException {
QName name;
if (convId != null) {
name = MailConstants.SEARCH_CONV_REQUEST;
} else if (params.getTypes().equals(ZSearchParams.TYPE_VOICE_MAIL) || params.getTypes().equals(ZSearchParams.TYPE_CALL)) {
name = VoiceConstants.SEARCH_VOICE_REQUEST;
} else if (params.getTypes().equals(ZSearchParams.TYPE_GAL)) {
name = AccountConstants.SEARCH_GAL_REQUEST;
} else {
name = MailConstants.SEARCH_REQUEST;
}
Element req = newRequestElement(name);
if (params.getTypes().equals(ZSearchParams.TYPE_GAL)) {
req.addAttribute(AccountConstants.A_TYPE, GalEntryType.account.name());
req.addElement(AccountConstants.E_NAME).setText(params.getQuery());
//req.addAttribute(MailConstants.A_SORTBY, SearchSortBy.nameAsc.name());
}
req.addAttribute(MailConstants.A_CONV_ID, convId);
if (nest) {
req.addAttribute(MailConstants.A_NEST_MESSAGES, true);
}
if (params.getLimit() != 0) {
req.addAttribute(MailConstants.A_QUERY_LIMIT, params.getLimit());
}
if (params.getOffset() != 0) {
req.addAttribute(MailConstants.A_QUERY_OFFSET, params.getOffset());
}
if (params.getSortBy() != null) {
req.addAttribute(MailConstants.A_SORTBY, params.getSortBy().name());
}
if (params.getTypes() != null) {
req.addAttribute(MailConstants.A_SEARCH_TYPES, params.getTypes());
}
if (params.getFetch() != null && params.getFetch() != Fetch.none) {
// use "1" for "first" for backward compat until DF is updated
req.addAttribute(MailConstants.A_FETCH, params.getFetch() == Fetch.first ? "1" : params.getFetch().name());
}
if (params.getCalExpandInstStart() != 0) {
req.addAttribute(MailConstants.A_CAL_EXPAND_INST_START, params.getCalExpandInstStart());
}
if (params.getCalExpandInstEnd() != 0) {
req.addAttribute(MailConstants.A_CAL_EXPAND_INST_END, params.getCalExpandInstEnd());
}
if (params.isPreferHtml()) {
req.addAttribute(MailConstants.A_WANT_HTML, params.isPreferHtml());
}
if (params.isMarkAsRead()) {
req.addAttribute(MailConstants.A_MARK_READ, params.isMarkAsRead());
}
if (params.isRecipientMode()) {
req.addAttribute(MailConstants.A_RECIPIENTS, params.isRecipientMode());
}
if (params.getField() != null) {
req.addAttribute(MailConstants.A_FIELD, params.getField());
}
if (params.getInDumpster()) {
req.addAttribute(MailConstants.A_IN_DUMPSTER, true);
}
req.addAttribute(MailConstants.E_QUERY, params.getQuery(), Element.Disposition.CONTENT);
if (params.getCursor() != null) {
Cursor cursor = params.getCursor();
Element cursorEl = req.addElement(MailConstants.E_CURSOR);
if (cursor.getPreviousId() != null) {
cursorEl.addAttribute(MailConstants.A_ID, cursor.getPreviousId());
}
if (cursor.getPreviousSortValue() != null) {
cursorEl.addAttribute(MailConstants.A_SORTVAL, cursor.getPreviousSortValue());
}
}
if (params.getTypes().equals(ZSearchParams.TYPE_VOICE_MAIL) || params.getTypes().equals(ZSearchParams.TYPE_CALL)) {
getAllPhoneAccounts();
setVoiceStorePrincipal(req);
}
Element resp = invoke(req);
if (params.getTypes().equals(ZSearchParams.TYPE_GAL)) {
try {
resp.getAttribute(MailConstants.A_SORTBY);
} catch (Exception e) {
resp.addAttribute(MailConstants.A_SORTBY, params.getSortBy().name());
}
try {
resp.getAttribute(MailConstants.A_QUERY_OFFSET);
} catch (Exception e) {
resp.addAttribute(MailConstants.A_QUERY_OFFSET, params.getOffset());
}
}
return new ZSearchResult(resp, nest, params.getTimeZone() != null ? params.getTimeZone() : getPrefs().getTimeZone());
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method sendInviteReply.
public ZSendInviteReplyResult sendInviteReply(String id, String component, ReplyVerb verb, boolean updateOrganizer, ZTimeZone tz, ZDateTime instance, ZOutgoingMessage message) throws ServiceException {
Element req = newRequestElement(MailConstants.SEND_INVITE_REPLY_REQUEST);
req.addAttribute(MailConstants.A_ID, id);
req.addAttribute(MailConstants.A_CAL_COMPONENT_NUM, component);
req.addAttribute(MailConstants.A_VERB, verb.name());
req.addAttribute(MailConstants.A_CAL_UPDATE_ORGANIZER, updateOrganizer);
if (tz != null) {
tz.toElement(req);
}
if (instance != null) {
instance.toElement(MailConstants.E_CAL_EXCEPTION_ID, req);
}
if (message != null) {
getMessageElement(req, message, null);
}
mMessageCache.remove(id);
return new ZSendInviteReplyResult(invoke(req));
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method iCalReply.
/**
* Sends an iCalendar REPLY object
* @param ical iCalendar data
* @throws ServiceException on error
*/
public void iCalReply(String ical, String sender) throws ServiceException {
Element req = newRequestElement(MailConstants.ICAL_REPLY_REQUEST);
Element icalElem = req.addUniqueElement(MailConstants.E_CAL_ICAL);
icalElem.setText(ical);
if (sender != null) {
icalElem.addAttribute(MailConstants.E_CAL_ATTENDEE, sender);
}
invoke(req);
}
Aggregations