use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method CreateSignature.
public void CreateSignature(Role role, Perm perm) throws Exception {
String signatureName = "signature-create-" + random();
XMLElement req = new XMLElement(AccountConstants.CREATE_SIGNATURE_REQUEST);
Element signature = req.addElement(AccountConstants.E_SIGNATURE);
signature.addAttribute(AccountConstants.A_NAME, signatureName);
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method GetAvailableSkins.
public void GetAvailableSkins(Role role, Perm perm) throws Exception {
XMLElement req = new XMLElement(AccountConstants.GET_AVAILABLE_SKINS_REQUEST);
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method ModifyPrefs.
public void ModifyPrefs(Role role, Perm perm) throws Exception {
XMLElement req = new XMLElement(AccountConstants.MODIFY_PREFS_REQUEST);
Element p = req.addElement(AccountConstants.E_PREF);
p.addAttribute(AccountConstants.A_NAME, Provisioning.A_zimbraPrefSkin);
p.setText("beach");
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class GalSyncAccountUtil method syncGalAccount.
private void syncGalAccount() throws ServiceException, IOException {
checkArgs();
mTransport = null;
try {
mTransport = new SoapHttpTransport(mAdminURL);
auth();
mTransport.setAuthToken(mAuth);
XMLElement req = new XMLElement(AdminConstants.SYNC_GAL_ACCOUNT_REQUEST);
Element acct = req.addElement(AdminConstants.E_ACCOUNT);
acct.addAttribute(AdminConstants.A_ID, mAccountId);
Element ds = acct.addElement(AdminConstants.E_DATASOURCE);
if (mDataSourceId != null)
ds.addAttribute(AdminConstants.A_BY, "id").setText(mDataSourceId);
else
ds.addAttribute(AdminConstants.A_BY, "name").setText(mDataSourceName);
if (mFullSync)
ds.addAttribute(AdminConstants.A_FULLSYNC, "TRUE");
if (mForceSync)
ds.addAttribute(AdminConstants.A_RESET, "TRUE");
mTransport.invoke(req);
} finally {
if (mTransport != null)
mTransport.shutdown();
}
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class GalSyncAccountUtil method addGalSyncDataSource.
private Element addGalSyncDataSource(String accountName, String dsName, String domain, String type, String folder, String pollingInterval) throws ServiceException, IOException {
mTransport = null;
try {
mTransport = new SoapHttpTransport(mAdminURL);
auth();
mTransport.setAuthToken(mAuth);
XMLElement req = new XMLElement(AdminConstants.ADD_GAL_SYNC_DATASOURCE_REQUEST);
req.addAttribute(AdminConstants.A_NAME, dsName);
req.addAttribute(AdminConstants.A_DOMAIN, domain);
req.addAttribute(AdminConstants.A_TYPE, type);
if (folder != null)
req.addAttribute(AdminConstants.E_FOLDER, folder);
Element acct = req.addElement(AdminConstants.E_ACCOUNT);
acct.addAttribute(AdminConstants.A_BY, AccountBy.name.name());
acct.setText(accountName);
if (pollingInterval != null)
req.addElement(AdminConstants.E_A).addAttribute(AdminConstants.A_N, Provisioning.A_zimbraDataSourcePollingInterval).setText(pollingInterval);
return mTransport.invokeWithoutSession(req);
} finally {
if (mTransport != null)
mTransport.shutdown();
}
}
Aggregations