Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 41567bf1e131 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
29 import org.w3c.dom.Document; | 29 import org.w3c.dom.Document; |
30 | 30 |
31 public class ReportGenerator | 31 public class ReportGenerator |
32 implements OutGenerator | 32 implements OutGenerator |
33 { | 33 { |
34 private static Logger logger = Logger.getLogger(ReportGenerator.class); | 34 private static Logger log = Logger.getLogger(ReportGenerator.class); |
35 | 35 |
36 protected Document result; | 36 protected Document result; |
37 protected OutputStream out; | 37 protected OutputStream out; |
38 protected CallContext context; | 38 protected CallContext context; |
39 protected String outName; | 39 protected String outName; |
41 public ReportGenerator() { | 41 public ReportGenerator() { |
42 } | 42 } |
43 | 43 |
44 @Override | 44 @Override |
45 public void setup(Object config) { | 45 public void setup(Object config) { |
46 logger.debug("ReportGenerator.setup"); | 46 log.debug("ReportGenerator.setup"); |
47 } | 47 } |
48 | 48 |
49 @Override | 49 @Override |
50 public void init(String outName, Document request, OutputStream out, CallContext context) { | 50 public void init(String outName, Document request, OutputStream out, CallContext context) { |
51 logger.debug("init"); | 51 log.debug("init"); |
52 this.outName = outName; | 52 this.outName = outName; |
53 this.out = out; | 53 this.out = out; |
54 this.context = context; | 54 this.context = context; |
55 result = null; | 55 result = null; |
56 } | 56 } |
69 public void doOut( | 69 public void doOut( |
70 ArtifactAndFacet artifactFacet, | 70 ArtifactAndFacet artifactFacet, |
71 ThemeDocument attr, | 71 ThemeDocument attr, |
72 boolean visible | 72 boolean visible |
73 ) { | 73 ) { |
74 logger.debug("doOut"); | 74 log.debug("doOut"); |
75 Facet facet = artifactFacet.getFacet(); | 75 Facet facet = artifactFacet.getFacet(); |
76 if (facet != null) { | 76 if (facet != null) { |
77 Calculation report = (Calculation) artifactFacet.getData(context); | 77 Calculation report = (Calculation) artifactFacet.getData(context); |
78 if (result == null) { | 78 if (result == null) { |
79 result = XMLUtils.newDocument(); | 79 result = XMLUtils.newDocument(); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 @Override | 85 @Override |
86 public void generate() throws IOException { | 86 public void generate() throws IOException { |
87 logger.debug("generate"); | 87 log.debug("generate"); |
88 XMLUtils.toStream(result != null | 88 XMLUtils.toStream(result != null |
89 ? result | 89 ? result |
90 : XMLUtils.newDocument(), out); | 90 : XMLUtils.newDocument(), out); |
91 } | 91 } |
92 | 92 |