public static void encodeServer( Element e, Server s, boolean applyConfig, Set<String> reqAttrs, AttrRightChecker attrRightChecker) throws ServiceException { Element server = e.addElement(AdminConstants.E_SERVER); server.addAttribute(AdminConstants.A_NAME, s.getName()); server.addAttribute(AdminConstants.A_ID, s.getId()); Map<String, Object> attrs = s.getUnicodeAttrs(applyConfig); ToXML.encodeAttrs(server, attrs, reqAttrs, attrRightChecker); }
public Element handle(Element request, Map<String, Object> context) throws ServiceException { ZimbraSoapContext zsc = getZimbraSoapContext(context); Mailbox mbox = getRequestedMailbox(zsc); OperationContext octxt = getOperationContext(zsc, context); ItemIdFormatter ifmt = new ItemIdFormatter(zsc); Element t = request.getElement(MailConstants.E_SEARCH); ItemId iid = new ItemId(t.getAttribute(MailConstants.A_ID), zsc); String query = t.getAttribute(MailConstants.A_QUERY); String types = t.getAttribute(MailConstants.A_SEARCH_TYPES, null); String sort = t.getAttribute(MailConstants.A_SORTBY, null); mbox.modifySearchFolder(octxt, iid.getId(), query, types, sort); SearchFolder search = mbox.getSearchFolderById(octxt, iid.getId()); Element response = zsc.createElement(MailConstants.MODIFY_SEARCH_FOLDER_RESPONSE); ToXML.encodeSearchFolder(response, ifmt, search); return response; }