Installation

This section describes how to install the Data Search software contained in the data-search package. The following topics can be found in this section:

System Requirements

The Data Search software was developed using Ajax Solr and jQuery. The application must reside within a PDS web site deployment because it depends on the CSS configuration and server side includes provided by the site. The software also requires a local MySQL database server to be installed. If installing a new instance of MySQL, consult the local system administrator for installation of this software. For the do-it-yourself crowd, the MySQL software can be downloaded from the MySQL Community Server Download page. Choose the appropriate package (version 5.5.X) for the target environment.

Deploying the Database

The scripts for creating, loading, dropping and cleaning the database can be found in the source code repository. In order to make a local copy of these scripts, perform the following command:

% svn export https://starcell.jpl.nasa.gov/repo/2010/trunk/portal/data-search/src/main/resources/schema/
      

If this is a new installation of the database, perform the following commands (password will be different in operations) in order to create and load the database schema:

% cd schema
% mysqladmin -u root -p create search
% mysql -u root -p -e "GRANT ALL ON search.* TO registry@localhost IDENTIFIED BY 'p@ssw0rd'"
% mysql -u registry -p -D search < create-schema.sql
% mysql -u registry -p -D search < load-schema.sql
      

If the database already exists but the database schema has been modified, perform the following commands in order to drop, create and load the database schema:

% mysql -u registry -p -D search < drop-schema.sql
% mysql -u registry -p -D search < create-schema.sql
% mysql -u registry -p -D search < load-schema.sql
      

If the database content just needs to be updated, perform the following commands in order to clean and load the database schema:

% mysql -u registry -p -D search < clean-schema.sql
% mysql -u registry -p -D search < load-schema.sql
      

See the Populating the Database section below for details on populating the content.

Deploying the Application

The software is not compiled but can instead be deployed with a Subversion "external" directory configuration within the PDS Home site directory structure. The desired end point is datasearch/data-search within the site. From within the top directory of the PDS site deployment (e.g., /data/www/pds/htdocs), change directories to the datasearch directory and perform the following commands to configure and retrieve the "external" directory:

% svn propset svn:externals \
'data-search https://starcell.jpl.nasa.gov/repo/2010/trunk/portal/data-search/src/main/webapp' .
% svn update
      

Configuring the Application

The application defaults to accessing the search database in the local MySQL database. If this needs to be modified for a given deployment, edit the following files in the root directory of the application:

  • getInvestigation.php
  • getInvestigations.php
  • getTarget.php
  • getTargets.php

Modify the following block accordingly:

$servername = "localhost";
$dbname = "search";
$username = "registry";
$password = "p@ssw0rd";
      

Populating the Database

This section details how to populate and update the content of the database for the Data Search application. The content is defined in SQL and contained in the load-schema.sql script.

Populate Content for Investigations

The search tools and resources categorized by investigation, are captured in the investigation_tools table of the search database. The following is an example SQL statement for an entry:

insert into investigation_tools (investigation, title, description, url, rank) values 
('Apollo', 'Apollo Analyst''s Notebook at the Geosciences Node', 
 'Provides access to data from the Apollo program''s six manned missions to the lunar surface.', 
 'http://an.rsl.wustl.edu/apollo/', 1);
        

The title, description and url fields are specific to the search tool or resource being described. The investigation field must be identical to the other search tools and/or resources for the specific investigation. This allows the software to populate the pull-down menu properly and to sort the entries for a specific investigation. The rank field specifies the sort order. Search tools are ranked from 1 to 100 and the resources are ranked from 101 and greater.

Populate Content for Targets

The search tools and resources categorized by target, are captured in the target_tools table of the search database. The following is an example SQL statement for an entry:

insert into target_tools (target, title, description, url, rank) values 
('Comets/Asteroids', 'Small Bodies Image Browser at the Small Bodies Node', 
 'Supports Dawn, NEAR Shoemaker product browse and download for Ceres, Vesta and Eros data.', 
 'https://sbib.psi.edu/', 1);
        

The title, description and url fields are specific to the search tool or resource being described. The target field must be identical to the other search tools and/or resources for the specific target. This allows the software to populate the pull-down menu properly and to sort the entries for a specific target. The rank field specifies the sort order. Search tools are ranked from 1 to 100 and the resources are ranked from 101 and greater.