Setup Notes
Describes how to adapt the script to serve your own local data
Introduction
This package is not so much a Cookbook as an example offered up on how GoMOOS implemented an SOS based on it's backend database (Postgres).
The oostethys_sos.cgi.zip file contains four files:
- sosGetCapablilties.xml
- sosDescribeSystem.xml
- sosGetObservation.xml
- oostethys_sos.cgi
The oostethys_sos.cgi is a Perl script which very closely mirrors the Perl ASCII Cookbook version 0.3.
Required Perl Modules
XML::LibXMLCGI
File::Basename
DateTime::Format::IS8601
Installation
The oostethys_sos.cgi must go in your web server's CGI directory, typically document_root/cgi-bin/ At GoMOOS it is installed in /cgi-bin/sos/ The three template files should reside in the same directory. Unlike the ASCII Cookbook there is no sos_config.xml to edit since the information about the sensors is retrieved from the database.The oostethys_sos.cgi must be edited. The sections of the script with GoMOOS only related code is clearly marked with comments. Those sections must be updated with values and routines specific to your organization and database.
Near the top there are globals, utilized by all the service requests which must be edited.
our $org = 'Gulf of Maine Ocean Observing System';In addtion there are two sub routines set_configDB() and getDataDB() which must be updated to retrieve metadata and observation data from your local database. Comments before these routines explain the data structures which they must set or return.
our $short_org = 'GoMOOS';
our $org_acronym = 'GoMOOS';
our $org_url = 'http://www.gomoos.org/';
our $title = "$org SOS";
our $ra_name = 'NERACOOS';
our $contact = 'Eric Bridger';
our $email = 'eric@gomoos.org';
our $sos_url = 'http://www.gomoos.org/cgi-bin/sos/oostethys_sos.cgi
Notes
GoMOOS utilizes custom Perl modules in order to encapsulate database access GoMOOS::WWW::DB. It has methods which return metadata about buoy platforms, datatypes and actual observation data, both the latest and archived observations.The CGI script is run as mod_perl under Apache which allows caching of various data stores to improve performance.