comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReportFacet.java @ 929:960dc6328e70

Facets created by the WaterlevelState store information about state's id and artifact's hash value now. flys-artifacts/trunk@2286 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 06 Jul 2011 09:18:31 +0000
parents 69c8541edcc7
children b1b0a0b61845
comparison
equal deleted inserted replaced
928:e7664917dbdf 929:960dc6328e70
17 implements FacetTypes 17 implements FacetTypes
18 { 18 {
19 private static Logger logger = Logger.getLogger(ReportFacet.class); 19 private static Logger logger = Logger.getLogger(ReportFacet.class);
20 20
21 protected ComputeType type; 21 protected ComputeType type;
22 protected String hash;
23 protected String stateId;
22 24
23 public ReportFacet() { 25 public ReportFacet() {
24 this(ComputeType.ADVANCE); 26 this(ComputeType.ADVANCE);
25 } 27 }
26 28
27 public ReportFacet(ComputeType type) { 29 public ReportFacet(ComputeType type) {
28 super(0, REPORT, "report"); 30 super(0, REPORT, "report");
29 this.type = type; 31 this.type = type;
30 } 32 }
31 33
34
35 public ReportFacet(ComputeType type, String hash, String stateId) {
36 super(0, REPORT, "report");
37 this.type = type;
38 this.hash = hash;
39 this.stateId = stateId;
40 }
41
32 public Object getData(Artifact artifact, CallContext context) { 42 public Object getData(Artifact artifact, CallContext context) {
33 logger.debug("get report data"); 43 logger.debug("get report data");
34 44
35 WINFOArtifact winfo = (WINFOArtifact)artifact; 45 WINFOArtifact winfo = (WINFOArtifact)artifact;
36 46
37 CalculationResult cr = (CalculationResult)winfo.compute( 47 CalculationResult cr = (CalculationResult)winfo.compute(
38 context, type, false); 48 context, stateId, hash, type, false);
39 49
40 return cr.getReport(); 50 return cr.getReport();
41 } 51 }
42 } 52 }
43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org