}
}
}
private void saveFormFilesForImport(String definition, String defVerId) throws Exception {
Source source = new Source(new String(definition));
source.setLogWriter(new OutputStreamWriter(System.err));
FormFields formFields = source.findFormFields();
StringBuffer sb = new StringBuffer();
for (Iterator i = formFields.iterator(); i.hasNext();) {
FormField formField = (FormField) i.next();
formFields.addValue(formField.getName(), sb.toString());
sb.setLength(0);
}
OutputDocument outputDocument = new OutputDocument(source);
outputDocument.replace(formFields);
String DEFINITION_ROOT = GlobalContext.getPropertyString("server.definition.path", "./uengine/definition/");
String HTML_PATH = DEFINITION_ROOT + defVerId + ".html";
OutputStreamWriter bw = null;
try {
bw = new OutputStreamWriter(new FileOutputStream(HTML_PATH), "UTF-8");
bw.write(outputDocument.toString());
bw.close();
} catch (Exception e) {
//throw e;
// outputDocument = new OutputDocument(source);
bw.write(source.toString());
bw.close();
} finally {
if (bw != null)
try {
bw.close();