This page last changed on Oct 20, 2007 by cholmes.

This is out of date, as the work has been fully incorporated on trunk, for version 1.6.x 1.6.0 should have more documentation, until then the most up to date tutorial is at in the FOSS4G workshop

Current svn trunk contains an early and incomplete implementation of WFS versioning.
This document contains a short guide on getting started and testing it.


In order to try out the versioning prototype you need:

  • a Geoserver trunk checkout
  • a recent Postgis release running on a recent Postgres server (>8.0). Whilst nothing relevant has been done that may make it non working on 7.4 versions, testing is been performed on a Postgres 8.1 with Postgis 1.1.x
  • the versioning data configuration, that contains a postgres dump, pre-configured set of feature types, and a set of demo requests

Getting started

First of all, checkout Geoserver trunk. Then, you can use maven the standard ways (install, eclipse, jetty:run) but remember to:

  • activate the wfsv profile, by adding -Pwfsv to your command line
  • if you want to create a WAR or test from command line, make sure the following system variables are set. configDirectory=../../configuration and confiId=versioning.

Then, install the database dump into a fresh database:

  • Go to the versioning configuration directory (geoserverTrunk\configuration\versioning), and uncompress spearfish.sql.gz with your favourite unzip utility. If you have gzip installed this may be:
    gzip -d -f spearfish.sql.gz
  • create a "spearfish" superuser with spearfish password:
    createuser -s -d -P spearfish
  • create a PosgGis enabled speafish database:
    • create a "spearfish" database:
      createdb spearfish -U spearfish
    • Create the "plpgsql" language extension for the spearfish database. (If you get a warning saying it already exists, that is fine).
      createlang -U spearfish plpgsql spearfish
    • Change directory to the share\contrib directory under your postgres installation:
      cd C:\Program Files\PostgreSQL\8.0\share\contrib
    • psql to the spearfish database as the spearfish user:
      psql -U spearfish spearfish
    • Execute the lwpostgis.sql script:
      \i lwpostgis.sql
    • Execute the spatial_ref_sys.sql script:
      \i spatial_ref_sys.sql
    • Exit psql, go back to the versioning configuration directory
  • Restore the sample database:
    psql -U spearfish spearfish < spearfish.sql

The initial database is not version enabled, and can be served directory with a plain Postgis datastore. The versioning configuration is set up so that it'll version enable all the geographic tables in the database on startup. If you're curious, have a look at how tables are set with your preferred SQL client by comparing before starting Geoserver, and how they are transformed after.

To version enable tables, and start experimenting, start Geoserver using the versioning data directory.

  • From the command line. Enter the web module and run:
    mvn clean install -Pwfsv -DconfigId=versioning -DconfigDirectory=../../configuration
    mvn jetty:run -Pwfsv
  • From the Eclipse ide:
    • do a mvn eclipse:eclipse -Pwfsv in the geoserver root
    • import all the projects into Eclipse
    • run the Start class in the web unit tests, specifying the Geoserver data dir among the startup parameters -DGEOSERVER_DATA_DIR=<path to geoserver checkout>/configuration/versioning

The demo requests walkthru

Go to the Geoserver sample requests and run the provided demo requests one by one, in order. Careful, they are designed to be run as the first thing, if you run them after, you'll have to adjust them.
At the moment there are few requests, but we'll improve over time as WFSV protocol details get implemented.

Try out transparent versioning

You don't need a versining aware client to play with versioning: the feature types are exposed thru WFS 1.0 and 1.1 as well, and each transaction will create a new revision.
Try to edit with your preferred client (e.g., uDig, MapBuilder, OpenLayers) and then check the logs, if you can, put a message in the transaction request handle, it'll be used as the commit message.

Report back

Have found bugs? The protocol does not work like you expected it to? Missing functionalities?
Let us know, the developer or users mailing list are waiting for you.

Document generated by Confluence on May 14, 2014 23:00