[Webflysuesk-commits] r47 - in scheduler/branches/openlayers-integration: . contrib doc scheduler scheduler/src/main/java/de/intevation/webflys/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Mar 31 17:37:36 CEST 2009
Author: iweinzierl
Date: 2009-03-31 17:37:36 +0200 (Tue, 31 Mar 2009)
New Revision: 47
Modified:
scheduler/branches/openlayers-integration/ChangeLog.txt
scheduler/branches/openlayers-integration/contrib/run.sh
scheduler/branches/openlayers-integration/doc/scheduler-properties.xhtml
scheduler/branches/openlayers-integration/scheduler/pom.xml
scheduler/branches/openlayers-integration/scheduler/src/main/java/de/intevation/webflys/model/WFST.java
Log:
Changed GeoServer to 1.7.3, Derby database to 10.4.2 and avoided an error in the geoserver.
Modified: scheduler/branches/openlayers-integration/ChangeLog.txt
===================================================================
--- scheduler/branches/openlayers-integration/ChangeLog.txt 2009-03-31 14:27:35 UTC (rev 46)
+++ scheduler/branches/openlayers-integration/ChangeLog.txt 2009-03-31 15:37:36 UTC (rev 47)
@@ -1,3 +1,16 @@
+2009-03-31 Ingo Weinzierl <ingo.weinzierl at intevation.de>
+
+ * scheduler/pom.xml: Changed derby database from version 10.3.2.1 to
+ version 10.4.2.0.
+
+ * contrib/run.sh: Added some important properties for running the
+ application. Later we should use an xml properties file to handle this.
+
+ * scheduler/src/main/java/de/intevation/webflys/model/WFST.java: In the new
+ GeoServer (1.7.3) seems to be a bug. Nillable columns in the postgis
+ database are needed by the geoserver while comitting a WFS transaction.
+ So we set an unused feature attribute 'objekt_nr' to 0 to avoid an error.
+
2008-10-30 stephan.holl at intevation.de
* doc/scheduler-schnittstelle: corrected encoding of the file.
Modified: scheduler/branches/openlayers-integration/contrib/run.sh
===================================================================
--- scheduler/branches/openlayers-integration/contrib/run.sh 2009-03-31 14:27:35 UTC (rev 46)
+++ scheduler/branches/openlayers-integration/contrib/run.sh 2009-03-31 15:37:36 UTC (rev 47)
@@ -2,8 +2,8 @@
DIR=`dirname $0`
DIR=`readlink -f $DIR/../scheduler/target`
-F_DIR=${WEB_FLYS_DIR:-/home/sascha/download/webflys/Web-FLYS/}
-DB_PATH=${DERBY_PATH:-$DIR/../../../jobs}
+F_DIR=${WEB_FLYS_DIR:-/home/iweinzierl/flys-data}
+DB_PATH=${DERBY_PATH:-/opt/gis/databases/jobs}
CP=$DIR/webflys-scheduler.jar
for i in $DIR/libs/*.jar ; do
@@ -12,10 +12,27 @@
CLASSPATH=$CP java -server \
-Dwebflys.root.path=$F_DIR \
- -Dwsplgen.working.directory=/tmp/wsplgen \
+ -Dwebflys.scheduler.allowed=localhost,192.168.11.13,192.168.11.35,192.168.11.254 \
+ -Dwebflys.scheduler.log.level=FINER \
+ -Dwebflys.scheduler.log.dir=$HOME/logs \
-Dwebflys.scheduler.db.url=jdbc:derby:$DB_PATH \
-Dwebflys.scheduler.wfs.server=localhost \
-Dwebflys.scheduler.wfs.port=9090 \
'-Dwebflys.scheduler.wfs.capabilities=geoserver/wfs?request=GetCapabilities' \
+ -Dwsplgen.working.directory=/home/iweinzierl/wsplgen-jobs \
+ -Dwsplgen.delete=false \
+ -Dwsplgen.copy.through=true \
+ -Dwebflys.internal.proxy.port=9999 \
+ -Dwebflys.internal.proxy.out.file=$HOME/logs/wfs-up.log \
+ -Dwebflys.scheduler.wfs.server=localhost \
+ -Dwebflys.scheduler.wfs.port=8080 \
+ -Dwfs.featuretype.rgd=topp:rohre_graben_damm \
+ -Dwfs.featuretype.result=topp:usk_gf_ergebnis \
+ -Dwfs.attribute.starttime=topp:startzeit \
+ -Dwfs.attribute.stoptime=topp:stopzeit \
+ -Dwfs.public.attribute=LEVEL \
+ -Dwfs.type.name=TYP_TEXT \
+ -Dwfs.geometry.name=the_geom \
+ -Dwebflys.detect.invalid.polygons=true \
de.intevation.webflys.scheduler.Main \
"$@"
Modified: scheduler/branches/openlayers-integration/doc/scheduler-properties.xhtml
===================================================================
--- scheduler/branches/openlayers-integration/doc/scheduler-properties.xhtml 2009-03-31 14:27:35 UTC (rev 46)
+++ scheduler/branches/openlayers-integration/doc/scheduler-properties.xhtml 2009-03-31 15:37:36 UTC (rev 47)
@@ -25,7 +25,7 @@
</tr>
<tr>
<td>webflys.scheduler.allowed</td>
- <td>localhost</td>
+ <td>localhost,192.168.11.13,192.168.11.35,192.168.11.245</td>
<td>IPs, die sich mit dem Scheduler verbinden dürfen.</td>
</tr>
<tr>
@@ -35,7 +35,7 @@
</tr>
<tr>
<td>webflys.internal.proxy.port</td>
- <td>-/-</td>
+ <td>9999</td>
<td>Wenn dieser Wert angeben wird, werden WFS-T-Anfragen an den
entsprechenden GeoServer über diesen Port geleitet, um falsch
formatierte Datumsangaben zu korrigieren.
@@ -47,7 +47,7 @@
</tr>
<tr>
<td>webflys.internal.proxy.out.file</td>
- <td>-/-</td>
+ <td>/home/iweinzierl/logs/wfs-up.log</td>
<td>Wenn dieser Wert angeben wird, wird der ausgehende Traffic
zum GeoServer ebenfalls in eine Datei mit dem entsprechenden Namen
geschrieben. Diese Option steht nur zur Verfügung, wenn
@@ -67,13 +67,17 @@
</td>
</tr>
<tr>
+ <td>webflys.root.directory</td>
+ <td>/mnt/flys-data/Web-FLYS</td>
+ </tr>
+ <tr>
<td>webflys.scheduler.db.driver</td>
<td>org.apache.derby.jdbc.EmbeddedDriver</td>
<td>JDBC-Treiber für den Aufbau von Datenbankverbindungen</td>
</tr>
<tr>
<td>webflys.scheduler.db.url</td>
- <td>jdbc:derby:<strong><aktuelles Arbeitsverzeichnis></strong>/jobs</td>
+ <td>jdbc:derby:/opt/gis/databases/jobs</td>
<td>Verbindungs-URL zur Datenbank</td>
</tr>
<tr>
@@ -93,7 +97,7 @@
</tr>
<tr>
<td>webflys.scheduler.wfs.port</td>
- <td>8888</td>
+ <td>8080</td>
<td>Der Port, auf dem der GeoServer erreichbar ist.</td>
</tr>
<tr>
@@ -106,12 +110,12 @@
</tr>
<tr>
<td>wsplgen.wsplgen</td>
- <td>wsplgen</td>
+ <td>/home/iweinzierl/bin/wsplgen</td>
<td>Pfad zum WSPLGEN-Binary inkl. Binary</td>
</tr>
<tr>
<td>wsplgen.working.directory</td>
- <td><strong><Temporär-Verzeichnis des Nutzers></strong></td>
+ <td>/home/iweinzierl/wsplgen-jobs</td>
<td>Verzeichnis, in dem WSPLGEN seine Dateien während
der Berechnungen hinterlegt. In diesem Verzeichnis
wird für jeden Job ein Unterverzeichnis angelegt.
@@ -119,7 +123,7 @@
</tr>
<tr>
<td>wsplgen.delete</td>
- <td>true</td>
+ <td>false</td>
<td>Gibt an, ob die Berechnungsunterverzeichnisse nach
Abschluß der jeweiligen Berechnung wieder gelöscht werden
sollen.
@@ -134,7 +138,7 @@
</tr>
<tr>
<td>wsplgen.copy.through</td>
- <td>false</td>
+ <td>true</td>
<td>Gibt an, ob die Standardausgabe von WSPLGEN auf die
Standardausgabe des Schedulers durchkopiert werden soll.
</td>
@@ -148,7 +152,7 @@
</tr>
<tr>
<td>webflys.scheduler.log.dir</td>
- <td>-/-</td>
+ <td>/home/iweinzierl/logs</td>
<td>Verzeichnis, in das ein rotierendes Log geschrieben wird.
Es werden Log-Dateien nach dem Schema <tt>scheduler-%g.log</tt>
angelegt, mit <tt>%g</tt> aus 0, 1, 2, .... Die Rotation
@@ -176,42 +180,42 @@
</tr>
<tr>
<td>wfs.featuretype.rgd</td>
- <td>bfg:DWHADM.USK_GL_ROHR_GRABEN_DAMM</td>
+ <td>topp:rohre_graben_damm</td>
<td>Names des FeatureTypes in dem die Graeben-Rohre-Daemme liegen.</td>
</tr>
<tr>
<td>wfs.featuretype.result</td>
- <td>bfg:usk_gf_ergebnis</td>
+ <td>topp:usk_gf_ergebnis</td>
<td>Names des FeatureTypes in dem die resultierenden Features geschrieben werden.</td>
</tr>
<tr>
<td>wfs.attribute.starttime</td>
- <td>bfg:startzeit</td>
+ <td>topp:startzeit</td>
<td>Names des Attributes im Ergebnis-Feature, welches die Anfangszeit eines Jobs beinhaltet.</td>
</tr>
<tr>
<td>wfs.attribute.stoptime</td>
- <td>bfg:stopzeit</td>
+ <td>topp:stopzeit</td>
<td>Names des Attributes im Ergebnis-Feature, welches die Zeit eines Jobs beinhaltet, wann dieser beendet wurde.</td>
</tr>
<tr>
<td>wfs.public.attribute</td>
- <td>PROTECTION_LEVEL</td>
+ <td>LEVEL</td>
<td>Names des Attributes, welches die privaten von den globalen Features unterscheidet.</td>
</tr>
<tr>
<td>wfs.type.name</td>
- <td>TYP</td>
+ <td>TYP_TEXT</td>
<td>Names des Attributes, welches den Typ des Rohrs, Grabens, Damms, enthaelt. (als STRING)</td>
</tr>
<tr>
<td>wfs.geometry.name</td>
- <td>GEOM</td>
+ <td>the_geom</td>
<td>Names des Attributes, welches die Geometrien enthaelt.</td>
</tr>
<tr>
<td>webflys.detect.invalid.polygons</td>
- <td>false</td>
+ <td>true</td>
<td>Entscheidet, ob Polygone, die von WSPLGEN erzeugt wurden, auf Validität hin überprüft werden
sollen. Wird dieser Wert auf "true" gesetzt, werden invalide Polygone beim Hochschreiben
der Ergebnisse ignoriert. Mögliche Werte: true, false</td>
Modified: scheduler/branches/openlayers-integration/scheduler/pom.xml
===================================================================
--- scheduler/branches/openlayers-integration/scheduler/pom.xml 2009-03-31 14:27:35 UTC (rev 46)
+++ scheduler/branches/openlayers-integration/scheduler/pom.xml 2009-03-31 15:37:36 UTC (rev 47)
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
- <version>10.3.2.1</version>
+ <version>10.4.2.0</version>
</dependency>
<!--
<dependency>
@@ -59,7 +59,7 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
- <version>10.3.2.1</version>
+ <version>10.4.2.0</version>
</dependency>
<!--
<dependency>
Modified: scheduler/branches/openlayers-integration/scheduler/src/main/java/de/intevation/webflys/model/WFST.java
===================================================================
--- scheduler/branches/openlayers-integration/scheduler/src/main/java/de/intevation/webflys/model/WFST.java 2009-03-31 14:27:35 UTC (rev 46)
+++ scheduler/branches/openlayers-integration/scheduler/src/main/java/de/intevation/webflys/model/WFST.java 2009-03-31 15:37:36 UTC (rev 47)
@@ -97,22 +97,22 @@
public static final String INTERNAL_PROXY_PORT = "webflys.internal.proxy.port";
public static final String WFS_RGD_NAME =
- Config.getProperty("wfs.featuretype.rgd", "bfg:DWHADM.USK_GL_ROHR_GRABEN_DAMM");
+ Config.getProperty("wfs.featuretype.rgd", "topp:rohre_graben_damm");
public static final String WFS_RESULT_NAME =
- Config.getProperty("wfs.featuretype.result", "bfg:DWHADM.USK_GF_ERGEBNIS");
+ Config.getProperty("wfs.featuretype.result", "topp:usk_gf_ergebnis");
public static final String PUBLIC_ATTRIBUTE =
- Config.getProperty("wfs.public.attribute", "PROTECTION_LEVEL");
+ Config.getProperty("wfs.public.attribute", "level");
public static final boolean DETECT_DEFECT_POLYGONS =
Config.getProperty("webflys.detect.invalid.polygons", "false").trim().equalsIgnoreCase("true");
public static final String WFS_TYPE_NAME =
- Config.getProperty("wfs.type.name", "TYP");
+ Config.getProperty("wfs.type.name", "typ");
public static final String WFS_GEOM_NAME =
- Config.getProperty("wfs.geometry.name", "GEOM");
+ Config.getProperty("wfs.geometry.name", "geom");
public interface WFSWriteErrorHandler {
@@ -212,7 +212,7 @@
public static void rohreGraebenDaemmeToShape(File shapeFile, Job job)
throws Exception
{
- logger.info("loading Rohre, Graeben and Daemme from WFS");
+ logger.info("loading Rohre, Graeben and Daemme from " + getWFSCapabilitiesURL());
boolean success = false;
Transaction tx = null;
@@ -256,7 +256,8 @@
// global filter
if(job.getData().getGel() != 1) {
- filter1.addLeftValue(filterFactory.createAttributeExpression(feat,"GEWAESSER"));
+ logger.info("add global rgd.");
+ filter1.addLeftValue(filterFactory.createAttributeExpression(feat,"gewaesser"));
filter1.addRightValue(filterFactory.createLiteralExpression(job.getData().getRiver()));
filter2.addLeftValue(filterFactory.createAttributeExpression(feat,PUBLIC_ATTRIBUTE));
@@ -266,25 +267,32 @@
}
// user specific filter
else {
- filter1.addLeftValue(filterFactory.createAttributeExpression(feat,"GEWAESSER"));
+ logger.info("add global and user specific rgd.");
+ filter1.addLeftValue(filterFactory.createAttributeExpression(feat,"gewaesser"));
filter1.addRightValue(filterFactory.createLiteralExpression(job.getData().getRiver()));
+ System.out.println("Filter 1: " + filter1.toString());
filter2.addLeftValue(filterFactory.createAttributeExpression(feat,PUBLIC_ATTRIBUTE));
filter2.addRightValue(filterFactory.createLiteralExpression("1"));
+ System.out.println("Filter 2: " + filter2.toString());
- filter3.addLeftValue(filterFactory.createAttributeExpression(feat,"USER_ID"));
+ filter3.addLeftValue(filterFactory.createAttributeExpression(feat,"user_id"));
filter3.addRightValue(filterFactory.createLiteralExpression(job.getUserId()));
+ System.out.println("Filter 3: " + filter3.toString());
filter4.addLeftValue(filterFactory.createAttributeExpression(feat,PUBLIC_ATTRIBUTE));
filter4.addRightValue(filterFactory.createLiteralExpression("0"));
+ System.out.println("Filter 4: " + filter4.toString());
lfilter1 = filterFactory.createLogicFilter(filter1, filter2, Filter.LOGIC_AND);
lfilter2 = filterFactory.createLogicFilter(filter1, filter3, Filter.LOGIC_AND);
lfilter3 = filterFactory.createLogicFilter(lfilter2, filter4, Filter.LOGIC_AND);
lfilter_final = filterFactory.createLogicFilter(lfilter1, lfilter3, Filter.LOGIC_OR);
+ System.out.println("Filter final: " + lfilter_final.toString());
}
Query query = new DefaultQuery(WFS_RGD_NAME, lfilter_final);
+ logger.info("Fetch features from " + query.getTypeName() + " FeatureType");
FeatureReader featureReader =
wfsDS.getFeatureReader(query, Transaction.AUTO_COMMIT);
@@ -299,7 +307,7 @@
FeatureType featureType = DataUtilities.createType(
"rohre-und-sperren",
- "geom:MultiLineString,TYP:String,LAGE:Double");
+ "GEOM:MultiLineString,TYP:String,LAGE:Double");
sfds.createSchema(featureType);
tx = new DefaultTransaction();
@@ -315,15 +323,17 @@
Feature shapeFeature = featureWriter.next();
Object geom = wfsFeature.getAttribute(WFS_GEOM_NAME);
- shapeFeature.setAttribute("geom", geom);
+ shapeFeature.setAttribute("GEOM", geom);
Object type = wfsFeature.getAttribute(WFS_TYPE_NAME);
shapeFeature.setAttribute("TYP", type);
- Object lage = wfsFeature.getAttribute("LAGE");
+ Object lage = wfsFeature.getAttribute("lage");
shapeFeature.setAttribute("LAGE", lage);
featureWriter.write();
}
tx.commit();
success = true;
+
+ logger.info("Finished writing rohre-und-sperren shapefile (" + count + " features).");
}
finally {
if (!success && tx != null) {
@@ -348,6 +358,7 @@
{
logger.info("-- shapeToWFS --");
URL urlWFS = new URL(getWFSProxyCapabilitiesURL());
+ logger.info("WFSProxyCapabilitiesURL: " + urlWFS.toString());
// creating wfsDataStore and needed things
Map params = new HashMap();
@@ -435,14 +446,15 @@
ObjectArrayMap oam = new ObjectArrayMap(nameToIndex);
- oam.set("DESCRIPTION", job.getUsrMessage());
- oam.set("USER_ID", job.getUserId());
- oam.set("JOB_ID", String.valueOf(job.getId()));
- oam.set("DIFF", feature.getAttribute(1));
- oam.set("STATUS", job.getStatus());
- oam.set("STARTZEIT", job.getEnqueueTime());
- oam.set("STOPZEIT", stopTime);
- oam.set("GEWAESSER", data.getRiver());
+ oam.set("description", job.getUsrMessage());
+ oam.set("user_id", job.getUserId());
+ oam.set("job_id", String.valueOf(job.getId()));
+ oam.set("diff", feature.getAttribute(1));
+ oam.set("status", job.getStatus());
+ oam.set("startzeit", job.getEnqueueTime());
+ oam.set("stopzeit", stopTime);
+ oam.set("gewaesser", data.getRiver());
+ oam.set("objekt_nr", Integer.valueOf(0));
/* gt 2.4 needed to be patched for that special EPSG code in following class:
* geotools/modules/library/xml/src/main/java/org/geotools/xml/gml/GMLComplexTypes.java
@@ -451,7 +463,7 @@
if (geom != null) {
geom.setUserData("EPSG:31466");
}
- oam.set("GEOM", geom);
+ oam.set("geom", geom);
Feature f = ft.create(oam.getData());
More information about the Webflysuesk-commits
mailing list