comparison artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromLocationInjector.java @ 8367:16dc2da05aef

Overwriting the current km in context gives unexpected results if artifacts from different km have been loaded.
author Tom Gottfried <tom@intevation.de>
date Thu, 02 Oct 2014 11:46:44 +0200
parents 7341bebc79d0
children a805211690f7
comparison
equal deleted inserted replaced
8366:061e85212d25 8367:16dc2da05aef
25 public void injectContext( 25 public void injectContext(
26 CallContext ctx, 26 CallContext ctx,
27 Artifact artifact, 27 Artifact artifact,
28 Document doc 28 Document doc
29 ) { 29 ) {
30 if (ctx.getContextValue(CURRENT_KM) instanceof Number) {
31 return;
32 }
33
30 RangeAccess access = new RangeAccess((D4EArtifact)artifact); 34 RangeAccess access = new RangeAccess((D4EArtifact)artifact);
31 if (access.getLocations() != null && 35 if (access.getLocations() != null &&
32 access.getLocations().length > 0) { 36 access.getLocations().length > 0) {
33 ctx.putContextValue(CURRENT_KM, access.getLocations()[0]); 37 ctx.putContextValue(CURRENT_KM, access.getLocations()[0]);
34 return; 38 return;

http://dive4elements.wald.intevation.org