Reference Implementations
Web Coverage Service
WFSRI Template

The Web Feature Service Reference Implementation (WFSRI) is a complex and extensive collection of code and resources, access to which is essential for Producers and those who intend to run Web Feature Servers. On the other hand, end-users of the WFSRI need only interact with a small subset of the WFSRI's bulk.

To help such end-users identify the basic components of the WFSRI and ease them into interacting with it, the NNEW team has developed the WFSRI Template. The example code within the Template demonstrates how the Reference Implementation may be used from start to finish: setting up a database sandbox, inserting and retrieving data, and tearing the sandbox back down.

It is recommended that you download the template and test its embedded examples before customizing it for your own purposes.

Table of Contents

Configuration and Installation


Unlike the other releases available on the NNEW Wiki, the WFSRI Template must be downloaded from the wxForge SVN and built in Apache Maven. Thus, you must have development access to the wxForge repository and have rights to the wfsri-template project. For full details on how to get access to wxForge, see the Accessing wxForge article.

Once you have access to the wfsri-template project on wxForge, follow the instructions below to install and configure the WFSRI Template:

  1. Using Subversion, download the wfsri-template project from wxForge by entering the following command in your Linux terminal. Note that the environment variable $WFSRI_TEMPLATE should be set on your system to point to whichever directory you would like to install the Template to.
     

    $  svn checkout --username <your-username> http://svn.wx.ll.mit.edu/svn/wfsri-template/tags/wfsri-template-2.1.1/ $WFSRI_TEMPLATE

     
  2. With the directory downloaded, you will need to configure the four .properties files in the $WFSRI_TEMPLATE/src/main/resources directory. Modify these files as follows:
     
    1. jdbc.properties: Contains the parameters used when erecting a database sandbox. Follow the instructions within the file to modify each parameter as appropriate. This will allow you to properly connect to and interact with your database.
       
    2. jtf.properties: Contains the parameters used when setting up the subscription feature's JMS transport factory. If you have not customized your setup of Fuse ESB, you may leave these parameters alone.
       
    3. setup.properties: Contains the parameters used when erecting and tearing down the WFSRI. setup.installPath and setup.srcPath are relative paths that allow the template to locate critical SQL scripts; unless you have changed the location of their respective directories (sql/install and sql/main), they may be left at their default values. The setup.sqlPath property, however, must be set to your sqlplus executable.
       
    4. wfsri.properties: Contains the parameters used when setting up a WFSRI tablespace in your sandbox. Set the wfs.tablespace and wfs.tempTablespace properties to whatever you would like – this simply gives them unique names to identify them amongst other tablespaces.
       
  3. Once each properties file has been properly configured, use Apache Maven to compile the code:
     

    $  mvn compile

     
    The WFSRI Template will be ready to run.

Running the WFSRI Template


The WFSRI Template contains two ready-made example integration tests:

  1. Lightning Integration Test: An end-to-end test of the WFSRI capabilities using the Lightning Feature Type and sample data. To run this test, execute the following code from the Linux terminal:
     

    $  mvn test -Dtest=edu.mit.ll.wfsri.integration.LightningIntegrationTest

     
  2. Lightning Subscription Integration Test: Identical to the above test, with the exception that it makes use of the previously specified JMS transport factory for subscription. To run this test, execute the following code from the Linux terminal:
     

    $  mvn test -Dtest=edu.mit.ll.wfsri.integration.LightningSubscriptionIntegrationTest

If both tests succeed, your copy of the WFSRI Template is properly configured, and you can move on to customization. If either test fails, review the WFSRI 2.0 Troubleshooting documentation.

Customizing the WFSRI Template


The two integration tests in the Template are intended as a jumping-off point for WFSRI users, and may be modified to suit the users' needs. Make a copy of the appropriate integration test (with or without subscription as befits your needs), then copy the $WFSRI_TEMPLATE/src/test/resources/xml/integration/lightning.properties file, replacing the parameter values with your own data as follows:

  • producerName: A name for your Producer user account. You may set this to any value you would like.
  • producerPass: A password for your Producer user account. This too may be set to any value you would like.
  • mapFile: The location of your chosen Feature Type's Feature Table Definition XML file.
  • featureTypeDetails: The location of your chosen Feature Type's Registration Properties file.
  • insertionXML: The location of your chosen Feature Type's Transaction-Insert XML file.
  • retrievalXML: The location of your chosen Feature Type's GetFeature XML file.
  • subscriptionXML: The location of your chosen Feature Type's Subscribe XML file.

For more information and examples of how to create the various files for your Feature Type, refer to the WFSRI 2.0 User Guide.

Once you have updated your version of the lightning.properties file, change the value of the PROPERTIES_FILE variable in your copy of the integration test to point to it. You may then run the new test in the same manner as was done for the included examples.

While the Template's code merely builds a sandbox and tests insertion and retrieval before tearing it back down, it is likely you will want to modify the code to suit your own purposes. The various files in the edu.mit.ll.wfsri.mock package should provide you with whatever functionality you require.

  • No labels