/** * Update all of the configuration string parameters. * * @param document uploaded configuration document */ protected void updateStringParameters(Document document) { Element documentRoot = document.getDocumentElement(); NodeList parameters = documentRoot.getElementsByTagName("stringParameter"); logger.debug("Number of string parameters = " + parameters.getLength()); for(int i=0; i<parameters.getLength(); i++) { String paramName = ((Element)parameters.item(i)).getElementsByTagName(NAME).item(0).getTextContent(); String paramValue = ((Element)parameters.item(i)).getElementsByTagName(VALUE).item(0).getTextContent(); String paramDescription = ((Element)parameters.item(i)).getElementsByTagName(DESCRIPTION).item(0).getTextContent(); ConfigurationParameterStringImpl param = (ConfigurationParameterStringImpl)this.configurationParameters.get(paramName); if(param == null) { errorMessage.append("Could not find underlying string configuration parameter for [") .append(paramName) .append("]. This is a valid configuration parameter name.\r\n"); } else { param.setValue(paramValue); param.setDescription(paramDescription); } } }
protected void setNotificationFormValues() { Configuration configuration = NotificationWindow.this.configurationManagement .getConfiguration(new CategorisedErrorNotificationContentProducer(this.notification)); if(configuration != null) { final List<ConfigurationParameter> parameters = (List<ConfigurationParameter>)configuration.getParameters(); for(ConfigurationParameter parameter: parameters) { if(parameter.getName().equals("subject")) { this.subject.setValue(((ConfigurationParameterStringImpl)parameter).getValue()); } else if(parameter.getName().equals("body")) { this.body.setValue(((ConfigurationParameterStringImpl)parameter).getValue()); } if(parameter.getName().equals("recipients")) { this.recipients.setValue(((ConfigurationParameterStringImpl)parameter).getValue()); } } } }
((ConfigurationParameterStringImpl)parameter).setValue(NotificationWindow.this.subject.getValue()); ((ConfigurationParameterStringImpl)parameter).setValue(NotificationWindow.this.body.getValue()); ((ConfigurationParameterStringImpl)parameter).setValue(NotificationWindow.this.recipients.getValue()); ((ConfigurationParameterStringImpl)parameter).setValue(NotificationWindow.this.name.getValue());
configuration.getParameters().add(new ConfigurationParameterMaskedStringImpl(name, null)); } else { configuration.getParameters().add(new ConfigurationParameterStringImpl(name, null)); configuration.getParameters().add(new ConfigurationParameterMaskedStringImpl(name, (String) value)); } else { configuration.getParameters().add(new ConfigurationParameterStringImpl(name, (String) value));