changeset 371:dfbb3d50b0bd

Added meta service stub. TODO: Add meta data builder. flys-artifacts/trunk@1780 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 29 Apr 2011 14:39:42 +0000
parents 4a8d934e745f
children fc3cf0ef777e
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/conf.xml flys-artifacts/src/main/resources/metadata/template.xml
diffstat 3 files changed, 60 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Apr 29 13:06:49 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Apr 29 14:39:42 2011 +0000
@@ -1,3 +1,13 @@
+2011-04-29	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/conf/conf.xml: Added meta data service.
+
+	* src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java:
+	  Stub for the meta data service.
+
+	* src/main/resources/metadata/template.xml: Initial template for
+	  the meta data service.
+
 2011-04-29  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
--- a/flys-artifacts/doc/conf/conf.xml	Fri Apr 29 13:06:49 2011 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Fri Apr 29 14:39:42 2011 +0000
@@ -32,6 +32,10 @@
                 name="mainvalues"
                 service="de.intevation.flys.artifacts.services.MainValuesService"
                 description="Returns the main values of a river's gauge based on a start and end point of the river.">de.intevation.artifactdatabase.DefaultServiceFactory</service-factory>
+            <service-factory
+                name="metadata"
+                service="de.intevation.flys.artifacts.services.MetaDataService"
+                description="The service provides some introspection into the database content.">de.intevation.artifactdatabase.DefaultServiceFactory</service-factory>
         </service-factories>
 
     </factories>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/resources/metadata/template.xml	Fri Apr 29 14:39:42 2011 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
+<DATENKORB>
+  <GEWAESSER>
+    <dc:context>
+      <dc:statement>
+        SELECT id AS river_id, name as river_name FROM rivers
+      </dc:statement>
+      <dc:elements>
+        <dc:element name="${river_name}">
+          <WSTS>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS wst_id, 
+                       kind        AS wst_kind,
+                       description AS wst_description
+                FROM wsts
+                WHERE river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <WST>
+                  <dc:attribute name="TYP" value="${wst_kind}"/>
+                  <dc:attribute name="ID"  value="${wst_id}"/>
+                  <BESCHREIBUNG><dc:text>Erzeugt aus der Datei: ${wst_description}</dc:text></BESCHREIBUNG>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT id   AS column_id,
+                             name AS column_name
+                      FROM wst_columns
+                      WHERE wst_id = ${wst_id}
+                      ORDER BY position
+                    </dc:statement>
+                    <dc:elements><SPALTE><dc:attribute name="ID"   value="${column_id}"/><dc:attribute name="NAME" value="${column_name}"/></SPALTE>
+                    </dc:elements>
+                  </dc:context>
+                </WST>
+              </dc:elements>
+            </dc:context>
+          </WSTS>
+        </dc:element>
+      </dc:elements>
+    </dc:context>
+  </GEWAESSER>
+</DATENKORB>
+</dc:template>
+

http://dive4elements.wald.intevation.org