From b0172a377a989471129fbf79a8d3d1b0d5817f9d Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Wed, 04 Apr 2018 19:29:37 +0200
Subject: [PATCH] ugly fix for domainoptions-update by hsscript

---
 hsarback/src/de/hsadmin/remote/DomainRemote.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/hsarback/src/de/hsadmin/remote/DomainRemote.java b/hsarback/src/de/hsadmin/remote/DomainRemote.java
index 5aa3a8f..134787b 100644
--- a/hsarback/src/de/hsadmin/remote/DomainRemote.java
+++ b/hsarback/src/de/hsadmin/remote/DomainRemote.java
@@ -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 @@
 			}
 			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);

--
Gitblit v1.9.0-SNAPSHOT