# HG changeset patch # User Björn Ricks # Date 1349354929 -7200 # Node ID a5e1ca620f1515c5a6eead8a5073947574d4f14d # Parent e4e345d81a650905525f118cd6af32e86da9ffeb Add description and set correct name for GaugeDischargeCurveFacet diff -r e4e345d81a65 -r a5e1ca620f15 flys-artifacts/ChangeLog --- 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 + + * 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 Fix issue889/2 . diff -r e4e345d81a65 -r a5e1ca620f15 flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java --- 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 fs = new ArrayList(1); fs.add(gfacet); diff -r e4e345d81a65 -r a5e1ca620f15 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java --- 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; }