Mercurial > dive4elements > river
changeset 4032:a5e1ca620f15
Add description and set correct name for GaugeDischargeCurveFacet
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 04 Oct 2012 14:48:49 +0200 |
parents | e4e345d81a65 |
children | 936abc73463a |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java |
diffstat | 3 files changed, 26 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Oct 04 14:54:44 2012 +0200 +++ b/flys-artifacts/ChangeLog Thu Oct 04 14:48:49 2012 +0200 @@ -1,3 +1,10 @@ +2012-10-04 Björn Ricks <bjoern.ricks@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java, + src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java: + Add description from message template for facet and set correct facet + name. + 2012-10-04 Felix Wolfsteller <felix.wolfsteller@intevation.de> Fix issue889/2 .
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java Thu Oct 04 14:54:44 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java Thu Oct 04 14:48:49 2012 +0200 @@ -16,8 +16,12 @@ import de.intevation.artifacts.common.ArtifactNamespaceContext; import de.intevation.artifacts.common.utils.XMLUtils; +import de.intevation.flys.artifacts.model.GaugeDischargeCurveFacet; +import de.intevation.flys.artifacts.resources.Resources; import de.intevation.flys.artifacts.states.StaticState; -import de.intevation.flys.artifacts.model.GaugeDischargeCurveFacet; + +import de.intevation.flys.model.Gauge; +import de.intevation.flys.utils.FLYSUtils; /** @@ -62,7 +66,15 @@ addStringData("river", rivername); addStringData("reference_gauge", gaugeref); - Facet gfacet = new GaugeDischargeCurveFacet(); + Gauge gauge = FLYSUtils.getReferenceGauge(this); + + String description = Resources.format(callmeta, + "facet.gauge_discharge_curve.description", + "Discharge curve on gauge", + rivername, + gauge.getName()); + + Facet gfacet = new GaugeDischargeCurveFacet(description); List<Facet> fs = new ArrayList<Facet>(1); fs.add(gfacet);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java Thu Oct 04 14:54:44 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java Thu Oct 04 14:48:49 2012 +0200 @@ -24,12 +24,13 @@ */ public class GaugeDischargeCurveFacet extends DefaultFacet +implements FacetTypes { private static final Logger log = Logger.getLogger(GaugeDischargeCurveFacet.class); - public GaugeDischargeCurveFacet() { - super(0, "facet.gauge.discharge_curve", "facet.gauge.discharge_curve"); + public GaugeDischargeCurveFacet(String description) { + super(0, GAUGE_DISCHARGE_CURVE, description); } @Override @@ -68,7 +69,8 @@ @Override public Facet deepCopy() { - GaugeDischargeCurveFacet copy = new GaugeDischargeCurveFacet(); + GaugeDischargeCurveFacet copy = new GaugeDischargeCurveFacet( + this.description); copy.set(this); return copy; }