ugly fix for domainoptions-update by hsscript

This commit is contained in:
Peter Hormanns 2018-04-04 19:29:37 +02:00
parent b28d34f01b
commit b0172a377a

View File

@ -1,8 +1,10 @@
package de.hsadmin.remote;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -75,6 +77,17 @@ public class DomainRemote extends AbstractRemote {
}
dom.setDomainoptions(domainOptionsSet);
}
if (domOptsObj != null && domOptsObj instanceof Map<?, ?>) {
final Set<DomainOption> domainOptionsSet = new HashSet<DomainOption>();
final Collection<?> domOptions = ((Map<?, ?>) domOptsObj).values();
final Iterator<?> iterator = domOptions.iterator();
while (iterator.hasNext()) {
final DomainOption domainOption = new DomainOption();
domainOption.setName((String)iterator.next());
domainOptionsSet.add(domainOption);
}
dom.setDomainoptions(domainOptionsSet);
}
final Object validsubdomains = setParams.get("validsubdomainnames");
if (validsubdomains != null && validsubdomains instanceof String) {
dom.setValidsubdomainnames((String) validsubdomains);