Exemplo n.º 1
0
 protected org.dom4j.Document documentRoot() throws Exception {
   CruiseConfig cruiseConfig = goConfigDao.loadForEditing();
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   new MagicalGoConfigXmlWriter(configCache, registry).write(cruiseConfig, out, true);
   org.dom4j.Document document = reader.read(new StringReader(out.toString()));
   Map<String, String> map = new HashMap<>();
   map.put("go", MagicalGoConfigXmlWriter.XML_NS);
   // TODO: verify this doesn't cache the factory
   DocumentFactory factory = DocumentFactory.getInstance();
   factory.setXPathNamespaceURIs(map);
   return document;
 }
Exemplo n.º 2
0
 public void populateAdminModel(Map<String, String> model) {
   model.put("location", fileLocation());
   XmlPartialSaver saver = fileSaver(false);
   model.put("content", saver.asXml());
   model.put("md5", saver.getMd5());
 }