comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DataFacet.java @ 930:3fd891d5228d

The DataFacets are now able to store the ID of the create which created them. flys-artifacts/trunk@2292 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 06 Jul 2011 13:37:52 +0000
parents c09c9e05ecfa
children b1b0a0b61845
comparison
equal deleted inserted replaced
929:960dc6328e70 930:3fd891d5228d
12 public class DataFacet 12 public class DataFacet
13 extends DefaultFacet 13 extends DefaultFacet
14 { 14 {
15 protected ComputeType type; 15 protected ComputeType type;
16 protected String hash; 16 protected String hash;
17 protected String stateId;
17 18
18 public DataFacet(String name, String description) { 19 public DataFacet(String name, String description) {
19 this(name, description, ComputeType.ADVANCE); 20 this(name, description, ComputeType.ADVANCE);
20 } 21 }
21 22
32 super(name, description); 33 super(name, description);
33 this.type = type; 34 this.type = type;
34 this.hash = hash; 35 this.hash = hash;
35 } 36 }
36 37
38
39 public DataFacet(
40 String name,
41 String description,
42 ComputeType type,
43 String hash,
44 String stateId
45 ) {
46 super(name, description);
47 this.type = type;
48 this.hash = hash;
49 this.stateId = stateId;
50 }
51
37 public Object getData(Artifact artifact, CallContext context) { 52 public Object getData(Artifact artifact, CallContext context) {
38 FLYSArtifact flys = (FLYSArtifact)artifact; 53 FLYSArtifact flys = (FLYSArtifact)artifact;
39 return flys.compute( 54 String theHash = hash != null ? hash : flys.hash();
40 context, hash != null ? hash : flys.hash(), type, false); 55
56 return stateId != null && stateId.length() > 0
57 ? flys.compute(context, stateId, theHash, type, false)
58 : flys.compute(context, theHash, type, false);
41 } 59 }
42 } 60 }
43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : 61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org