Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/ShapeFacet.java @ 5912:81bdb5c4414d
New exporter and facet for wsplgen calculation result.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 07 May 2013 12:45:57 +0200 |
parents | |
children | c35323148b98 |
comparison
equal
deleted
inserted
replaced
5911:b96a293d30f3 | 5912:81bdb5c4414d |
---|---|
1 package org.dive4elements.river.artifacts.model.map; | |
2 | |
3 import java.io.File; | |
4 | |
5 import org.apache.log4j.Logger; | |
6 import org.dive4elements.artifactdatabase.state.DefaultFacet; | |
7 import org.dive4elements.artifacts.Artifact; | |
8 import org.dive4elements.artifacts.CallContext; | |
9 import org.dive4elements.artifacts.common.utils.Config; | |
10 import org.dive4elements.river.artifacts.D4EArtifact; | |
11 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | |
12 | |
13 | |
14 public class ShapeFacet | |
15 extends DefaultFacet | |
16 { | |
17 | |
18 private static Logger logger = Logger.getLogger(ShapeFacet.class); | |
19 private static final String BASE_DIR = | |
20 "/artifact-database/floodmap/shapefile-path/@value"; | |
21 | |
22 /** | |
23 * Defaults to ADVANCE Compute type. | |
24 * @param name Name of the facet. | |
25 * @param description maybe localized description of the facet. | |
26 */ | |
27 public ShapeFacet(String name, String description) { | |
28 super(name, description); | |
29 } | |
30 | |
31 /** | |
32 * Return computation result. | |
33 */ | |
34 @Override | |
35 public Object getData(Artifact artifact, CallContext context) { | |
36 D4EArtifact flys = (D4EArtifact)artifact; | |
37 String tmp = Config.getStringXPath(BASE_DIR); | |
38 String baseDir = Config.replaceConfigDir(tmp); | |
39 baseDir += "/" + flys.identifier(); | |
40 File shapeDir = new File(baseDir); | |
41 if (shapeDir.exists()) { | |
42 return shapeDir; | |
43 } | |
44 return null; | |
45 } | |
46 | |
47 } |