From cb56ed963a635ff718e1024492b6f3875150297d Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 17 Jul 2015 11:15:50 +0200 Subject: fix problem with delete list elements in GUI --- .../id/config/webgui/MOAIDConfigurationModul.java | 37 ++++++++++++++-------- .../task/impl/ServicesProtocolPVP2XTask.java | 4 +-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/MOAIDConfigurationModul.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/MOAIDConfigurationModul.java index 0ec230324..80ee9d8c1 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/MOAIDConfigurationModul.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/MOAIDConfigurationModul.java @@ -219,19 +219,7 @@ public class MOAIDConfigurationModul implements ConfigurationModul{ } //delete all unused keys - logger.debug("Delete {} keys pairs from configuration", deleted.size()); - Iterator deleteInterator = deleted.iterator(); - while (deleteInterator.hasNext()) { - String el = deleteInterator.next(); - try { - config.deleteIds(el); - logger.trace("Delete key {}", el); - - } catch (ConfigurationException e) { - logger.error("Delete key: " + el + " FAILED.", e); - - } - } + deleteEntries(deleted); } catch (Exception e) { logger.warn("Configuration post-processing FAILED.", e); @@ -239,13 +227,34 @@ public class MOAIDConfigurationModul implements ConfigurationModul{ } + + } else if (deleted != null && deleted.size() > 0) { + deleteEntries(deleted); + } else { - logger.info("Configuration saving process finished: No key/value pairs found."); + logger.info("Configuration saving process finished without operations: No key/value pairs found."); } } + private void deleteEntries(List deleted) { + logger.debug("Delete {} keys pairs from configuration", deleted.size()); + Iterator deleteInterator = deleted.iterator(); + while (deleteInterator.hasNext()) { + String el = deleteInterator.next(); + try { + config.deleteIds(el); + logger.trace("Delete key {}", el); + + } catch (ConfigurationException e) { + logger.error("Delete key: " + el + " FAILED.", e); + + } + } + + } + private void loadType(String name, String resource) { InputStream is = null; try { diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java index 6da1bc389..787cd136d 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java @@ -112,8 +112,8 @@ public class ServicesProtocolPVP2XTask extends AbstractTaskValidator implements try { byte[] certSerialized = null; - if (MiscUtil.isNotEmpty(certBase64)) { - certSerialized = Base64Utils.decode(certBase64, true); + if (MiscUtil.isNotEmpty(splittet[1])) { + certSerialized = Base64Utils.decode(splittet[1], true); X509Certificate cert = new X509Certificate(certSerialized); newConfigValues.put( MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT, -- cgit v1.2.3