Installation

This document describes how to install the Searrch User Interface software contained in the search-ui package. The following topics can be found in this document:

System Requirements

This section details the system requirements for installing and operating the Search User Interface.

Java Runtime Environment

The Search User Interface was developed using Java and will run on any platform with a supported Java Runtime Environment (JRE). The software was specifically compiled for and tested in Java version 1.8. The following commands test the local Java installation in a UNIX-based environment:

% which java
/usr/bin/java

% java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
        

The first command above checks whether the java executable is in the environment's path and the second command reports the version. If Java is not installed or the version is not at least 1.8, Java will need to be downloaded and installed in the current environment. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, the Java software can be downloaded from the Oracle Java Download page. The suggested software package is the Java Standard Edition (SE) 8, either the JDK or the JRE package. The JDK package is not necessary to run the software but could be useful if development and compilation of Java software will also occur in the current environment.

Java Application Server

The Search User Interface requires a Java application server for hosting the web application. The suggested application server for this release is Apache Tomcat with a minimal version of 7.0.X. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, see the Tomcat Deployment document for installation and configuration details. If viewing this document from the search-ui package, view the Tomcat Deployment document from the Engineering Node site.

The top-level directory where Apache Tomcat is installed (i.e. the directory containing the webapps and conf sub-directories) will be referenced in these instructions as $TOMCAT_HOME.

Unpacking the Package

Download the search-ui package from the PDS FTP site. The binary distribution is available in identical zip or tar/gzip packages. The installation directory may vary from environment to environment but in UNIX-based environments it is typical to install software packages in the /usr/local directory and in Windows-based environments it is typical to install software packages in the C:\Program Files directory. Unpack the selected binary distribution file with one of the following commands:

% unzip search-ui-2.1.0-bin.zip
or
% tar -xzvf search-ui-2.1.0-bin.tar.gz
      

Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment.

The commands above result in the creation of the search-ui-2.1.0 directory with the following directory structure:

  • README.txt

    A README file directing the user to the available documentation for the project.

  • LICENSE.txt

    The copyright notice from the California Institute of Technology detailing the restrictions regarding the use and distribution of this software. Although the license is strictly worded, the software has been classified as Technology and Software Publicly Available (TSPA) and is available for anyone to download and use.

  • search-ui.war

    This is the Web ARchive (WAR) file containing the Search User Interface software including all dependent JAR files.

  • doc/

    This directory contains a local web site with the Search User Interface documentation, javadoc, unit test results and other configuration management related information. Just point the desired web browser to the index.html file in this directory.

  • extras/

    This directory contains the css, images, javascript, and server-side include files used to build the user interface to match that provided on the PDS Engineering website.

Deploying the Application

The Search User Interface web application is packaged as a WAR file and is intended for installation under a standard Java Application Server. There are two options for deploying the WAR file:

Copy WAR To webapps directory

  1. Locate the WAR file (search-ui.war) in the Search UI package.
  2. Copy this file to the $TOMCAT_HOME/webapps directory.
  3. Create an XML context file, $TOMCAT_HOME/conf/Catalina/localhost/search-ui.xml containing the following:
    <?xml version="1.0" encoding="utf-8" ?>
    <Context crossContext="true">
    </Context>
                
  4. Restart Tomcat.

Create Context File To Point To WAR

Assuming Search UI WAR and accompanying directories are located at /usr/local/search-ui (if not, substitute the directory location as needed), we need to set the application to allow for cross-context so it can use the various server-side includes. We can do this by creating $TOMCAT_HOME/conf/Catalina/localhost/search-ui.xml containing the following text:

<?xml version="1.0" encoding="utf-8" ?>
<Context docBase="/usr/local/search-ui/search-ui.war" crossContext="true">
</Context>
        

Deploying the Extras

The Search User Interface also depends on several other directories from the PDS Website that include images, Javascript, CSS, and server-side include files that are in the extras directory in Search UI package (i.e. /usr/local/search-ui/extras). This contains the following directories:

  • css
  • images
  • include
  • js
  • scripts

The above files provide the look-and-feel for the application so that it integrates nicely with the PDS Website, where it is intended to be deployed. Because of this, if the application is not deployed with the PDS Website, several of the links in the menu bar will not function properly. The application portion will still function normally.

PDS Engineering Deployment

The current Search UI is intended for deployment on both the PDS Engineering website, as well as external users. The remaining installation procedures can be ignored for PDS EN deployment because these directories are already included in the PDS EN website.

All Other Deployments

If the directories above are not in the $TOMCAT_HOME/webapps directory already, create the following Tomcat context files in $TOMCAT_HOME/conf/Catalina/localhost to include these directories:

  • css.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Context docBase="/usr/local/search-ui/extras/css" ></Context>
                
  • images.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Context docBase="/usr/local/search-ui/extras/images" ></Context>
                
  • include.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Context docBase="/usr/local/search-ui/extras/include" ></Context>
                
  • js.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Context docBase="/usr/local/search-ui/extras/js" ></Context>
                
  • scripts.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Context docBase="/usr/local/search-ui/extras/scripts" ></Context>
                

An alternative solution is to move all of the directories into the $TOMCAT_HOME/webapps directory: (assumes Search UI software and directories are at /usr/local/search-ui)

Unix Environment

% mv extras/* $TOMCAT_HOME/webapps
        

Restart Tomcat to ensure the changes take effect.

Configuring the Application

The Search User Interface is configured to access the Search Service at the /services/search end point on the local HTTP Server assuming both applications are being accessed via reverse proxies from the Tomcat Server. If that is not the case, then the end point will need to be modified. This can be accomplished by editing the search.jsp file located in the $TOMCAT_HOME/webapps/search-ui directory. In the case where both applications are installed on a local Tomcat Server, the above file can be modified as follows:

    $.get('/services/search/pds/archive-filter?' + query, function(data) {
      $('.output').html(data);
    });
with:
    $.get('/search-service/pds/archive-filter?' + query, function(data) {
      $('.output').html(data);
    });
      

The above modification will take effect immediately and does not require a Tomcat Server restart.