public Properties getUserInputValues() { Properties prop = new Properties(); for (int i = 0; i < uiList.size(); i++) { UserInput ui = (UserInput) uiList.get(i); XmlUIElement el = (XmlUIElement) uiElementsList.get(i); ui.setValue(el.getValue()); prop.put("$UserInput$" + ui.getID(), el.getValue()); } return prop; }
/** This replaces the user input variables in the XML template * */ public String replaceVariablesInString(String xmlStringArg) { String modXmlString = xmlStringArg; Properties prop = new Properties(); for (int i = 0; i < uiList.size(); i++) { UserInput ui = (UserInput) uiList.get(i); XmlUIElement el = (XmlUIElement) uiElementsList.get(i); ui.setValue(el.getValue()); prop.put("$UserInput$" + ui.getID(), el.getValue()); // modXmlString = StringUtil.replaceStringBySpecifiedString(modXmlString,"$UserInput$" + // ui.getID(),el.getValue()); } Template template = null; try { template = new Template(xmlStringArg); // template = PopulateTemplateParams.substituteParams(template, prop, 3); template = PopulateTemplateParams.substituteParams(template, prop); } catch (Exception exc) { exc.printStackTrace(); } // return modXmlString; return template.toString(); }