Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Typo.

...

This tutorial demonstrates how to create a very simple connection between the OODT File Manager and SIS. The connection is made by outputting an RSS feed of data from the File Manager via the REST API and configuring SIS to read in this RSS data.

Warning

This module has been removed from Apache SIS. This wiki page is kept as a source of material that we may use when web application development will restart.

Please note, this demonstration is very much a work-in-progress! It represents the first steps in making a connection between OODT and SIS. Work is ongoing and captured by issue OODT-402. As work continues it is hoped that a more formal, elegant and robust connection between OODT and SIS will be defined. This page will be updated accordingly to reflect the latest developments.

...

Firstly, edit the ‘elements.xml’ file to add the following element definitions between the <cas:elements> … </cas:elements> tags:

Code Block

<element id="urn:oodt:Latitude" name="Latitude">
  <description>Geographical latitude location.</description>
  <dcElement />
</element>

<element id="urn:oodt:Longitude" name="Longitude">
  <description>Geographical longitude location.</description>
  <dcElement />
</element>

Next, edit the ‘product-type-element-map.xml’ file and map the elements to the GenericFile product type by adding the following tags between the <type> … </type> tags:

Code Block

<element id="urn:oodt:Latitude"/>
<element id="urn:oodt:Longitude"/>

After updating and saving the files, restart File Manager, for example by entering the following command from the File Manager bin directory:

Code Block

./filemgr restart

Ingesting Sample Files

...

For example, in the /tmp directory create a ‘geodata.txt’ file containing a few arbitrary words of your own choice. Then create a ‘geodata.txt.met’ metadata file containing the following text:

Code Block

<cas:metadata xmlns:cas="http://oodt.apache.org/ns/cas">

  <keyval>
    <key>Latitude</key>
    <val>10</val>
  </keyval>

  <keyval>
    <key>Longitude</key>
    <val>30</val>
  </keyval>

</cas:metadata>

Ingest the files into your File Manager repository. Below is an example command for ingesting files using the ‘filemgr-client’ tool from the File Manager bin directory for a File Manager instance running on port 9000.

Code Block

./filemgr-client --url http://localhost:9000 --operation --ingestProduct \
--productName geodata.txt --productStructure Flat \
--productTypeName GenericFile \
--metadataFile file:///tmp/geodata.txt.met \
--refs file:///tmp/geodata.txt

...

Add the following tag definitions to the ‘rssconf.xml’ configuration file for the File Manager REST API webapp. By default, ‘rssconf.xml’ is located in the WEB-INF/classes directory of the webapp. The new tag definitions should be inserted between the <cas:rssconf> … </cas:rssconf> tags.

Code Block

<tag name="geo:lat" source="[Latitude]">
  <attribute name="xmlns:geo" value="http://www.w3.org/2003/01/geo/wgs84_pos#" />
</tag>

<tag name="geo:long" source="[Longitude]">
  <attribute name="xmlns:geo" value="http://www.w3.org/2003/01/geo/wgs84_pos#" />
</tag>

...

1) Restart Tomcat, for example by entering the following commands from the Tomcat bin directory:

Code Block

./shutdown.sh
./startup.sh

...

After navigating to the above location, you should see an RSS output. Depending on your browser, you may have to ‘view source’ to see the XML. You should be able to see your new tags in the output, for example:

Code Block

<rss xmlns:cas="http://oodt.apache.org/ns/cas" version="2.0">
  <channel>
    <title>ALL</title>
    <link>
      http://localhost:8080/fmprod/rdf/dataset?type=ALL&typeID=null
    </link>
    <description>ALL</description>
    <language>en-us</language>
    <copyright>Copyright 2010: Apache Software Foundation</copyright>
    <pubDate>Mon, 02 Apr 2012 23:24:07 BST</pubDate>
    <category>ALL</category>
    <generator>CAS File Manager</generator>
    <lastBuildDate>Mon, 02 Apr 2012 23:24:07 BST</lastBuildDate>
    <item>
      <title>geodata.txt</title>
      <description>GenericFile</description>
      <link>
        http://localhost:8080/fmprod/data?productID=532f56ef-7d12-11e1-90fa-8523ce23740f
      </link>
      <pubDate>Tue, 03 Apr 2012 00:22:25 BST</pubDate>
      <geo:lat xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">10</geo:lat>
      <geo:long xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">30</geo:long>
      <cas:source>GenericFile</cas:source>
      <source>GenericFile</source>
    </item>
  </channel>
</rss>

...

Add the URL used in the File Manager REST API to the ‘sis_location_config.xml’ file for the SIS webapp. By default, this is located in the WEB-INF/classes directory of the SIS webapp. Remove all of the other RSS URLs from the file. After editing the file, it should look similar to the following:

Code Block

<sis:locationConfig xmlns:sis="http://sis.apache.org/ns/sis">
  <capacity>4</capacity>
  <depth>10</depth>
  <url>http://localhost:8080/fmprod/viewRecent?channel=ALL</url>
</sis:locationConfig>

Wiki MarkupRestart Tomcat to ensure that the changes to the configuration file are detected. \ [Note: If you have previously run the ‘demo.jsp’ SIS webapp demonstration page, it may be necessary to clear out the stored data from the webapp. This can be done by deleting the folders ‘geodata’ and ‘qtree’ from the main SIS webapp directory inbetween stopping and starting Tomcat. The folders will be recreated by the webapp when the next query is run.\]

Running The Demo

To demonstrate the connection we'll use the 'demo.jsp' demo from the SIS web application. Open a web browser and navigate to http://<host>/<webapp>/demo.jsp, where <host> is the Tomcat location and <webapp> is the SIS webapp folder, for example: ‘http://localhost:8080/sis/demo.jsp’.

Enter data in the query form to return an area that should encompass the points defined in your metadata files. For example, the following bounding box query should return an area large enough to include the point defined in the ‘geodata.txt.met’ file:

No Format

...

Lower Left: Latitude: 0, Longitude: 0
Upper Right: Latitude: 50, Longitude: 50

Press the ‘Query’ button and view the map onscreen. All being well, your File Manager files should be visible on the map, as in the following screenshot. Click on the markers on the map to display information about them and confirm that it is indeed your files that are being displayed:

Image Modified