Search in sources :

Example 91 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method modifyDomainSMIMEConfig.

@Override
public void modifyDomainSMIMEConfig(Domain domain, String configName, Map<String, Object> attrs) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.MODIFY_SMIME_CONFIG_REQUEST);
    Element eDomain = req.addElement(AdminConstants.E_DOMAIN);
    eDomain.addAttribute(AdminConstants.A_BY, AdminConstants.BY_ID).setText(domain.getId());
    Element eConfig = req.addElement(AdminConstants.E_CONFIG);
    eConfig.addAttribute(AdminConstants.A_NAME, configName);
    eConfig.addAttribute(AdminConstants.A_OP, AdminConstants.OP_MODIFY);
    addAttrElements(eConfig, attrs);
    invoke(req);
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 92 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method grantRight.

@Override
public void grantRight(String targetType, TargetBy targetBy, String target, String granteeType, GranteeBy granteeBy, String grantee, String secret, String right, RightModifier rightModifier) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.GRANT_RIGHT_REQUEST);
    toXML(req, targetType, targetBy, target);
    toXML(req, granteeType, granteeBy, grantee, secret);
    toXML(req, right, rightModifier);
    invoke(req);
}
Also used : XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 93 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method deleteSignature.

@Override
public void deleteSignature(Account account, String signatureId) throws ServiceException {
    XMLElement req = new XMLElement(AccountConstants.DELETE_SIGNATURE_REQUEST);
    Element signature = req.addElement(AccountConstants.E_SIGNATURE);
    signature.addAttribute(AccountConstants.A_ID, signatureId);
    invokeOnTargetAccount(req, account.getId());
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 94 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapDistributionList method reload.

public void reload(SoapProvisioning prov) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.GET_DISTRIBUTION_LIST_REQUEST);
    Element a = req.addElement(AdminConstants.E_DL);
    a.setText(getId());
    a.addAttribute(AdminConstants.A_BY, Key.DistributionListBy.id.name());
    Element dl = prov.invoke(req).getElement(AdminConstants.E_DL);
    Map<String, Object> attrs = SoapProvisioning.getAttrs(dl);
    addDlm(dl, attrs);
    setAttrs(attrs);
}
Also used : XMLElement(com.zimbra.common.soap.Element.XMLElement) Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 95 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapDistributionList method modifyAttrs.

public void modifyAttrs(SoapProvisioning prov, Map<String, ? extends Object> attrs, boolean checkImmutable) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.MODIFY_DISTRIBUTION_LIST_REQUEST);
    req.addElement(AdminConstants.E_ID).setText(getId());
    SoapProvisioning.addAttrElements(req, attrs);
    Element dl = prov.invoke(req).getElement(AdminConstants.E_DL);
    Map<String, Object> newAttrs = SoapProvisioning.getAttrs(dl);
    addDlm(dl, newAttrs);
    setAttrs(newAttrs);
}
Also used : XMLElement(com.zimbra.common.soap.Element.XMLElement) Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Aggregations

XMLElement (com.zimbra.common.soap.Element.XMLElement)140 Element (com.zimbra.common.soap.Element)111 Test (org.junit.Test)30 JSONElement (com.zimbra.common.soap.Element.JSONElement)29 XmlAnyElement (javax.xml.bind.annotation.XmlAnyElement)25 XmlElement (javax.xml.bind.annotation.XmlElement)25 FilterTest (com.zimbra.soap.mail.type.FilterTest)24 SoapHttpTransport (com.zimbra.common.soap.SoapHttpTransport)9 HashMap (java.util.HashMap)8 Account (com.zimbra.cs.account.Account)6 ArrayList (java.util.ArrayList)6 ZAuthToken (com.zimbra.common.auth.ZAuthToken)5 KeyValuePair (com.zimbra.soap.type.KeyValuePair)5 ByteBuilder (com.zimbra.common.mime.HeaderUtils.ByteBuilder)4 ServiceException (com.zimbra.common.service.ServiceException)4 DataSource (com.zimbra.cs.account.DataSource)4 Auth (com.zimbra.cs.service.account.Auth)4 URL (java.net.URL)4 Cookie (javax.servlet.http.Cookie)4 Signature (com.zimbra.cs.account.Signature)3