Mercurial > dive4elements > river
changeset 4126:e0354aed0cd3
Improvements for issue945/6 (separate w and q mainvalues in DC).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Sat, 13 Oct 2012 21:29:45 +0200 |
parents | a74487440693 |
children | 1e9e7b7d9f15 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/meta-data.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java |
diffstat | 3 files changed, 57 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Sat Oct 13 20:08:13 2012 +0200 +++ b/flys-artifacts/ChangeLog Sat Oct 13 21:29:45 2012 +0200 @@ -1,3 +1,13 @@ +2012-10-13 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + Improve on issue945/6 + + * flys-artifacts/doc/conf/meta-data.xml: Add nodes for W/Q-only + mainvalues. + + * flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java: + Create only W/Q values if corresponding data given. + 2012-10-13 Felix Wolfsteller <felix.wolfsteller@intevation.de> Improve on issue945/1
--- a/flys-artifacts/doc/conf/meta-data.xml Sat Oct 13 20:08:13 2012 +0200 +++ b/flys-artifacts/doc/conf/meta-data.xml Sat Oct 13 21:29:45 2012 +0200 @@ -517,6 +517,14 @@ <dc:attribute name="factory" value="mainvalue"/> <dc:attribute name="ids" value="${river_id}"/> </mainvalue> + <wmainvalue> + <dc:attribute name="factory" value="mainvalue"/> + <dc:attribute name="ids" value="${river_id}:w"/> + </wmainvalue> + <qmainvalue> + <dc:attribute name="factory" value="mainvalue"/> + <dc:attribute name="ids" value="${river_id}:q"/> + </qmainvalue> </dc:macro> <dc:macro name="qsectors">
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java Sat Oct 13 20:08:13 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java Sat Oct 13 21:29:45 2012 +0200 @@ -36,7 +36,7 @@ /** - * Artifact to access names of Points Of Interest along a segment of a river. + * Artifact to access main and extreme values of a river. * This artifact neglects (Static)FLYSArtifacts capabilities of interaction * with the StateEngine by overriding the getState*-methods. */ @@ -96,27 +96,41 @@ logger.debug("MainValuesArtifact.setup"); state = new StaticState(STATIC_STATE_NAME); - Facet qfacet0 = new MainValuesQFacet( - DURATION_MAINVALUES_Q, - Resources.getMsg( - callMeta, - "facet.discharge_curves.mainvalues.q", - "facet.discharge_curves.mainvalues.q"), - false); - Facet qfacet1 = new MainValuesQFacet( - COMPUTED_DISCHARGE_MAINVALUES_Q, - Resources.getMsg( - callMeta, - "facet.discharge_curves.mainvalues.q", - "facet.discharge_curves.mainvalues.q"), - false); - Facet qfacet2 = new MainValuesQFacet( - MAINVALUES_Q, - Resources.getMsg( - callMeta, - "facet.discharge_curves.mainvalues.q", - "facet.discharge_curves.mainvalues.q"), - true); + List<Facet> fs = new ArrayList<Facet>(); + facets.put(state.getID(), fs); + spawnState(); + super.setup(identifier, factory, context, callMeta, data); + String restriction = getDatacageIDValue(data); + logger.debug("mainvalue restriction " + restriction); + boolean restricted = restriction.endsWith("q") || restriction.endsWith("w"); + if (!restricted || restriction.endsWith("q")) { + Facet qfacet0 = new MainValuesQFacet( + DURATION_MAINVALUES_Q, + Resources.getMsg( + callMeta, + "facet.discharge_curves.mainvalues.q", + "facet.discharge_curves.mainvalues.q"), + false); + Facet qfacet1 = new MainValuesQFacet( + COMPUTED_DISCHARGE_MAINVALUES_Q, + Resources.getMsg( + callMeta, + "facet.discharge_curves.mainvalues.q", + "facet.discharge_curves.mainvalues.q"), + false); + Facet qfacet2 = new MainValuesQFacet( + MAINVALUES_Q, + Resources.getMsg( + callMeta, + "facet.discharge_curves.mainvalues.q", + "facet.discharge_curves.mainvalues.q"), + true); + + fs.add(qfacet0); + fs.add(qfacet1); + fs.add(qfacet2); + } + if (!restricted || restriction.endsWith("w")) { Facet wfacet1 = new MainValuesWFacet( COMPUTED_DISCHARGE_MAINVALUES_W, Resources.getMsg( @@ -131,17 +145,9 @@ "facet.discharge_curves.mainvalues.w", "facet.discharge_curves.mainvalues.w"), true); - - List<Facet> fs = new ArrayList<Facet>(); - fs.add(qfacet0); - fs.add(qfacet1); - fs.add(qfacet2); - fs.add(wfacet1); - fs.add(wfacet2); - - facets.put(state.getID(), fs); - spawnState(); - super.setup(identifier, factory, context, callMeta, data); + fs.add(wfacet1); + fs.add(wfacet2); + } }