Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/context/RiverContextFactory.java @ 8272:c57b0400ac98
Adopt configuation of artifacts into new xml documents to make them configurable inline.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 15 Sep 2014 15:38:16 +0200 |
parents | c87c87544cc6 |
children | 54e515504a3f |
comparison
equal
deleted
inserted
replaced
8271:f98598cf798c | 8272:c57b0400ac98 |
---|---|
262 Element tmp = (Element) artifacts.item(i); | 262 Element tmp = (Element) artifacts.item(i); |
263 | 263 |
264 String xlink = tmp.getAttribute(XPATH_XLINK); | 264 String xlink = tmp.getAttribute(XPATH_XLINK); |
265 xlink = Config.replaceConfigDir(xlink); | 265 xlink = Config.replaceConfigDir(xlink); |
266 | 266 |
267 File file = new File(xlink); | 267 if (!xlink.isEmpty()) { |
268 if (!file.isFile() || !file.canRead()) { | 268 File file = new File(xlink); |
269 log.warn("Artifact configuration '" + file + "' not found."); | 269 if (!file.isFile() || !file.canRead()) { |
270 log.warn("Artifact configuration '" + file + "' not found."); | |
271 } else { | |
272 Document doc = XMLUtils.parseDocument(file); | |
273 if (doc != null) { | |
274 docs.add(doc); | |
275 } | |
276 } | |
270 continue; | 277 continue; |
271 } | 278 } |
272 | 279 Document doc = XMLUtils.newDocument(); |
273 Document doc = XMLUtils.parseDocument(file); | 280 Node copy = doc.adoptNode(tmp.cloneNode(true)); |
274 if (doc != null) { | 281 doc.appendChild(copy); |
275 docs.add(doc); | 282 docs.add(doc); |
276 } | |
277 } | 283 } |
278 return docs; | 284 return docs; |
279 } | 285 } |
280 | 286 |
281 | 287 |