comparison artifacts/src/main/java/org/dive4elements/river/collections/D4EArtifactCollection.java @ 8392:994995baa32b

Only the master-artifact should decide about injected CURRENT_KM et al. (and removed dependend obsolete class).
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 08 Oct 2014 11:49:07 +0200
parents f98598cf798c
children 5e38e2924c07
comparison
equal deleted inserted replaced
8391:6b12045ac372 8392:994995baa32b
327 327
328 // XXX NOTE: the outGen is not able to process its generate() operation, 328 // XXX NOTE: the outGen is not able to process its generate() operation,
329 // because it has no OutputStream set! 329 // because it has no OutputStream set!
330 Document dummy = XMLUtils.newDocument(); 330 Document dummy = XMLUtils.newDocument();
331 outGen.init(out, dummy, null, getContext()); 331 outGen.init(out, dummy, null, getContext());
332 prepareMasterArtifact(outGen); 332 D4EArtifact master = getMasterArtifact();
333 prepareMasterArtifact(master, outGen);
333 334
334 try { 335 try {
335 Document outAttr = getAttribute(attr, out); 336 Document outAttr = getAttribute(attr, out);
336 OutputHelper helper = new OutputHelper(identifier()); 337 OutputHelper helper = new OutputHelper(identifier(), master);
337 helper.doOut(outGen, out, out, outAttr, getContext(), dummy); 338 helper.doOut(outGen, out, out, outAttr, getContext(), dummy);
338 } 339 }
339 catch (ArtifactDatabaseException adbe) { 340 catch (ArtifactDatabaseException adbe) {
340 log.error(adbe, adbe); 341 log.error(adbe, adbe);
341 } 342 }
411 } 412 }
412 413
413 generator.init(key, format, out, context); 414 generator.init(key, format, out, context);
414 generator.setSettings(settings); 415 generator.setSettings(settings);
415 generator.setCollection(this); 416 generator.setCollection(this);
416 prepareMasterArtifact(generator); 417
418 D4EArtifact master = getMasterArtifact();
419 prepareMasterArtifact(master, generator);
417 420
418 try { 421 try {
419 Document attr = getAttribute(cAttr, name); 422 Document attr = getAttribute(cAttr, name);
420 OutputHelper helper = new OutputHelper(identifier()); 423 OutputHelper helper = new OutputHelper(identifier(), master);
421 helper.doOut(generator, name, subtype, attr, context, format); 424 helper.doOut(generator, name, subtype, attr, context, format);
422 generator.generate(); 425 generator.generate();
423 } 426 }
424 catch (ArtifactDatabaseException adbe) { 427 catch (ArtifactDatabaseException adbe) {
425 log.error(adbe, adbe); 428 log.error(adbe, adbe);
435 /** 438 /**
436 * Sets the master Artifact at the given <i>generator</i>. 439 * Sets the master Artifact at the given <i>generator</i>.
437 * 440 *
438 * @param generator The generator that gets a master Artifact. 441 * @param generator The generator that gets a master Artifact.
439 */ 442 */
440 protected void prepareMasterArtifact(OutGenerator generator 443 protected void prepareMasterArtifact(D4EArtifact master, OutGenerator generator) {
441 ) {
442 // Get master artifact. 444 // Get master artifact.
443 D4EArtifact master = getMasterArtifact();
444 if (master != null) { 445 if (master != null) {
445 log.debug("Set master Artifact to uuid: " + master.identifier()); 446 log.debug("Set master Artifact to uuid: " + master.identifier());
446 generator.setMasterArtifact(master); 447 generator.setMasterArtifact(master);
447 } 448 }
448 else { 449 else {

http://dive4elements.wald.intevation.org