Search in sources :

Example 11 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_50258 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config, "global config");
}
Also used : Config(com.zimbra.cs.account.Config)

Example 12 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_31694 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config, "global config");
}
Also used : Config(com.zimbra.cs.account.Config)

Example 13 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_42828 method upgrade_zimbraGalLdapAttrMap.

void upgrade_zimbraGalLdapAttrMap() throws ServiceException {
    String attrName = Provisioning.A_zimbraGalLdapAttrMap;
    Config config = prov.getConfig();
    printer.println();
    printer.println("Checking " + config.getLabel() + " for " + attrName);
    String oldCalResType = "zimbraCalResType=zimbraCalResType";
    String newCalResType = "zimbraCalResType,msExchResourceSearchProperties=zimbraCalResType";
    String oldCalResLocationDisplayName = "zimbraCalResLocationDisplayName=zimbraCalResLocationDisplayName";
    String newCalResLocationDisplayName = "zimbraCalResLocationDisplayName,displayName=zimbraCalResLocationDisplayName";
    String oldMailForwardingAddress = "zimbraMailForwardingAddress=zimbraMailForwardingAddress";
    String newMailForwardingAddress = "zimbraMailForwardingAddress=member";
    String zimbraCalResBuilding = "zimbraCalResBuilding=zimbraCalResBuilding";
    String zimbraCalResCapacity = "zimbraCalResCapacity,msExchResourceCapacity=zimbraCalResCapacity";
    String zimbraCalResFloor = "zimbraCalResFloor=zimbraCalResFloor";
    String zimbraCalResSite = "zimbraCalResSite=zimbraCalResSite";
    String zimbraCalResContactEmail = "zimbraCalResContactEmail=zimbraCalResContactEmail";
    String zimbraAccountCalendarUserType = "msExchResourceSearchProperties=zimbraAccountCalendarUserType";
    String[] curValues = config.getMultiAttr(attrName);
    Map<String, Object> attrs = new HashMap<String, Object>();
    for (String curValue : curValues) {
        replaceIfNeeded(attrs, attrName, curValue, oldCalResType, newCalResType);
        replaceIfNeeded(attrs, attrName, curValue, oldCalResLocationDisplayName, newCalResLocationDisplayName);
        replaceIfNeeded(attrs, attrName, curValue, oldMailForwardingAddress, newMailForwardingAddress);
    }
    addValue(attrs, attrName, zimbraCalResBuilding);
    addValue(attrs, attrName, zimbraCalResCapacity);
    addValue(attrs, attrName, zimbraCalResFloor);
    addValue(attrs, attrName, zimbraCalResSite);
    addValue(attrs, attrName, zimbraCalResContactEmail);
    addValue(attrs, attrName, zimbraAccountCalendarUserType);
    if (attrs.size() > 0) {
        printer.println("Modifying " + attrName + " on " + config.getLabel());
        prov.modifyAttrs(config, attrs);
    }
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Example 14 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_42828 method upgrade_zimbraContactHiddenAttributes.

private void upgrade_zimbraContactHiddenAttributes() throws ServiceException {
    Config config = prov.getConfig();
    upgrade_zimbraContactHiddenAttributes(config, config.getLabel());
    List<Server> servers = prov.getAllServers();
    for (Server server : servers) {
        upgrade_zimbraContactHiddenAttributes(server, "server " + server.getLabel());
    }
}
Also used : Server(com.zimbra.cs.account.Server) Config(com.zimbra.cs.account.Config)

Example 15 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_57039 method upgradeZimbraGalLdapAttrMap.

void upgradeZimbraGalLdapAttrMap() throws ServiceException {
    Config config = prov.getConfig();
    String attrName = Provisioning.A_zimbraGalLdapAttrMap;
    String oldValue = "zimbraCalResLocationDisplayName,displayName=zimbraCalResLocationDisplayName";
    String newValue = "zimbraCalResLocationDisplayName=zimbraCalResLocationDisplayName";
    String[] curValues = config.getMultiAttr(attrName);
    for (String value : curValues) {
        if (value.equalsIgnoreCase(oldValue)) {
            Map<String, Object> attrs = new HashMap<String, Object>();
            StringUtil.addToMultiMap(attrs, "-" + attrName, oldValue);
            StringUtil.addToMultiMap(attrs, "+" + attrName, newValue);
            modifyAttrs(config, attrs);
        }
    }
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Aggregations

Config (com.zimbra.cs.account.Config)73 HashMap (java.util.HashMap)24 Provisioning (com.zimbra.cs.account.Provisioning)10 Test (org.junit.Test)8 ServiceException (com.zimbra.common.service.ServiceException)7 Account (com.zimbra.cs.account.Account)7 RetentionPolicy (com.zimbra.soap.mail.type.RetentionPolicy)7 Element (com.zimbra.common.soap.Element)6 Policy (com.zimbra.soap.mail.type.Policy)6 Cos (com.zimbra.cs.account.Cos)5 Server (com.zimbra.cs.account.Server)5 Domain (com.zimbra.cs.account.Domain)4 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)4 Pair (com.zimbra.common.util.Pair)3 HashSet (java.util.HashSet)3 SMTPMessage (com.sun.mail.smtp.SMTPMessage)2 ZFilterAction (com.zimbra.client.ZFilterAction)2 ZFileIntoAction (com.zimbra.client.ZFilterAction.ZFileIntoAction)2 ZFilterCondition (com.zimbra.client.ZFilterCondition)2 ZHeaderCondition (com.zimbra.client.ZFilterCondition.ZHeaderCondition)2