changeset 2614:036e234c2385

Added service to generate a chart of fixings for given river and km applied some filters. Stub by now. flys-artifacts/trunk@4198 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 04 Apr 2012 14:41:27 +0000
parents 2e129754d450
children b0597a63fe70
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/conf.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java
diffstat 3 files changed, 103 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Apr 04 14:17:36 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Apr 04 14:41:27 2012 +0000
@@ -1,3 +1,23 @@
+2012-04-04	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java:
+	  New. Service to generate a chart of fixings for given river and km applied
+	  some filters.
+
+	  Usage:
+	     $ curl http://localhost:8181/service/fixings-km-chart \
+	       -d @fix-overview.xml > chart.png
+
+	  The input XML is nearly the same as for the overview service.
+	  Besides the river, filters and range it accepts elements
+	  <km value="..."/>                  for passing the river km, 
+	  <extent width="..." height="..."/> for the extent of the output chart,
+	  <mime type="..."/>                 for type of result. Currently ignored.
+
+	  ATM only a static fixed sized PNG image is delivered.
+
+	* doc/conf/conf.xml: Added service to list of services.
+
 2012-04-04	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java:
--- a/flys-artifacts/doc/conf/conf.xml	Wed Apr 04 14:17:36 2012 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Wed Apr 04 14:41:27 2012 +0000
@@ -128,6 +128,10 @@
                 service="de.intevation.flys.artifacts.services.FixingsOverviewService"
                 description="Returns an overview of the fixings of a given river.">de.intevation.artifactdatabase.DefaultServiceFactory</service-factory>
             <service-factory
+                name="fixings-km-chart"
+                service="de.intevation.flys.artifacts.services.FixingsKMChartService"
+                description="Returns a chart of fixings of given river and km.">de.intevation.artifactdatabase.DefaultServiceFactory</service-factory>
+            <service-factory
                 name="gaugeinfo"
                 service="de.intevation.flys.artifacts.services.GaugeInfoService"
                 description="Returns an overview of the fixings of a given river.">de.intevation.artifactdatabase.DefaultServiceFactory</service-factory>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java	Wed Apr 04 14:41:27 2012 +0000
@@ -0,0 +1,79 @@
+package de.intevation.flys.artifacts.services;
+
+import de.intevation.artifactdatabase.DefaultService;
+
+import de.intevation.artifacts.CallMeta;
+import de.intevation.artifacts.GlobalContext;
+import de.intevation.artifacts.Service;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Document;
+
+public class FixingsKMChartService
+extends      DefaultService
+{
+    private static final Logger log =
+        Logger.getLogger(FixingsKMChartService.class);
+
+    public static final byte [] DATA0 = {
+        (byte)0x89, (byte)0x50, (byte)0x4e, (byte)0x47, 
+        (byte)0x0d, (byte)0x0a, (byte)0x1a, (byte)0x0a, 
+        (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0d, 
+        (byte)0x49, (byte)0x48, (byte)0x44, (byte)0x52, 
+        (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x1d, 
+        (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x1d, 
+        (byte)0x04, (byte)0x03, (byte)0x00, (byte)0x00, 
+        (byte)0x00, (byte)0xa4, (byte)0xbd, (byte)0x7a, 
+        (byte)0x3c, (byte)0x00, (byte)0x00, (byte)0x00, 
+        (byte)0x01, (byte)0x73, (byte)0x52, (byte)0x47, 
+        (byte)0x42, (byte)0x00, (byte)0xae, (byte)0xce, 
+        (byte)0x1c, (byte)0xe9, (byte)0x00, (byte)0x00, 
+        (byte)0x00, (byte)0x18, (byte)0x50, (byte)0x4c, 
+        (byte)0x54, (byte)0x45, (byte)0xff, (byte)0xff, 
+        (byte)0xff, (byte)0x08, (byte)0x08, (byte)0x08, 
+        (byte)0x29, (byte)0x29, (byte)0x29, (byte)0x52, 
+        (byte)0x52, (byte)0x52, (byte)0x8c, (byte)0x8c, 
+        (byte)0x8c, (byte)0xbd, (byte)0xbd, (byte)0xbd, 
+        (byte)0xe7, (byte)0xe7, (byte)0xe7, (byte)0x00, 
+        (byte)0x00, (byte)0x00, (byte)0xcf, (byte)0x3a, 
+        (byte)0xd7, (byte)0x12, (byte)0x00, (byte)0x00, 
+        (byte)0x00, (byte)0x09, (byte)0x70, (byte)0x48, 
+        (byte)0x59, (byte)0x73, (byte)0x00, (byte)0x00, 
+        (byte)0x0b, (byte)0x13, (byte)0x00, (byte)0x00, 
+        (byte)0x0b, (byte)0x13, (byte)0x01, (byte)0x00, 
+        (byte)0x9a, (byte)0x9c, (byte)0x18, (byte)0x00, 
+        (byte)0x00, (byte)0x00, (byte)0x07, (byte)0x74, 
+        (byte)0x49, (byte)0x4d, (byte)0x45, (byte)0x07, 
+        (byte)0xdc, (byte)0x04, (byte)0x04, (byte)0x0a, 
+        (byte)0x32, (byte)0x0f, (byte)0xa3, (byte)0x92, 
+        (byte)0x8b, (byte)0x55, (byte)0x00, (byte)0x00, 
+        (byte)0x00, (byte)0x2b, (byte)0x49, (byte)0x44, 
+        (byte)0x41, (byte)0x54, (byte)0x18, (byte)0xd3, 
+        (byte)0x63, (byte)0x60, (byte)0x18, (byte)0x1a, 
+        (byte)0x20, (byte)0x0c, (byte)0x95, (byte)0x9b, 
+        (byte)0x5c, (byte)0x6e, (byte)0x80, (byte)0xc2, 
+        (byte)0x37, (byte)0x2f, (byte)0x2f, (byte)0x41, 
+        (byte)0xe1, (byte)0x8b, (byte)0x97, (byte)0x17, 
+        (byte)0xa3, (byte)0xf0, (byte)0xd5, (byte)0xd1, 
+        (byte)0xf8, (byte)0x81, (byte)0xe5, (byte)0x6a, 
+        (byte)0x28, (byte)0x7c, (byte)0x36, (byte)0x97, 
+        (byte)0x04, (byte)0x86, (byte)0x61, (byte)0x01, 
+        (byte)0x00, (byte)0xf0, (byte)0xaa, (byte)0x06, 
+        (byte)0x2d, (byte)0x16, (byte)0xcb, (byte)0xb9, 
+        (byte)0x3c, (byte)0x00, (byte)0x00, (byte)0x00, 
+        (byte)0x00, (byte)0x49, (byte)0x45, (byte)0x4e, 
+        (byte)0x44, (byte)0xae, (byte)0x42, (byte)0x60, 
+        (byte)0x82};
+
+    @Override
+    public Service.Output process(
+        Document      data,
+        GlobalContext globalContext,
+        CallMeta      callMeta
+    ) {
+        log.debug("FixingsKMChartService.process");
+        return new Output(DATA0, "image/png");
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org