Requirements

The CAS Product Server web application should work on most platforms including Mac OSX, Linux (e.g. Ubuntu) and Windows. Maven is required to build the web application and a web server such as Tomcat is required to deploy and run the application. A running OODT file manager is required for the web application to work.

Building

Assuming that you have already checked out a copy of the OODT trunk, navigate to the webapp/fmprod subdirectory and run the following Maven command to build the web application:

mvn clean install

If all goes well with the build, you should see Maven's BUILD SUCCESS message in the terminal window.

If you encounter any issues with the build and do not see the success message, please contact either the user or developer OODT mailing lists and members of the community should be able to assist you.

Deployment

There are several ways to deploy the web application to the web server. Below is one example for Tomcat. With this method you can rebuild and redeploy the web application without overwriting your configuration setup.

  • After building the web application, locate the example context.xml file, which should be in the webapp/fmprod/src/main/webapp/META-INF directory. Copy this file to a directory of your choice and edit the copy as described in the Context Setup section below.
  • Then, do either of the following steps:
    • Rename your copy of context.xml to fmprod.xml (or another name of your choice) and move the file to Tomcat's $TOMCAT_HOME/conf/Catalina/localhost directory.
      mv /usr/local/oodt/webapp/fmprod/context.xml $TOMCAT_HOME/conf/Catalina/localhost/fmprod.xml
      
    • In UNIX-like environments, create a symbolic link named fmprod.xml (or another name of your choice) to your context file from Tomcat's $TOMCAT_HOME/conf/Catalina/localhost directory.
      cp webapp/fmprod/src/main/webapp/META-INF/context.xml /usr/local/oodt/webapp/fmprod/context.xml
      ln -s /usr/local/oodt/webapp/fmprod/context.xml $TOMCAT_HOME/conf/Catalina/localhost/fmprod.xml 
      
  • Tomcat will use the name of your context file (or link) as the path name of the web application in the URL (e.g. http://localhost:8080/fmprod).
  • To run the web application, perform the following steps:
    1. Start file manager.
    2. (Re)start Tomcat.

Context Setup

The context file lets Tomcat know where to find the web application and sets parameters for the web application. These parameters include the URL for the the file manager, a temporary working directory and configuration files for outputs. Absolute paths can be used for all of these items. Environment variables enclosed in square brackets, e.g. [FILEMGR_HOME] or [FMPROD_HOME], can also be included in the paths for all parameters (but not for the web application's location).

Web Application Location

Alter the value of the Context element's docBase attribute to point to the location of your built web application, i.e. the WAR (.war) file. (You could copy the WAR to a new location or leave it in its original location - but remember that if you leave it in the original location and then run mvn clean it will no longer exist in that location!). For example:

<Context docBase="/usr/local/src/oodt/webapps/fmprod/target/cas-product.war" ... />

File Manager URL

Edit the parameter named filemgr.url and change its value to the URL of your file manager. By default, the web application will look for a file manager instance running at http://localhost:9000 but you can change the URL to a different one if you need to.

<Parameter name="filemgr.url" value="http://localhost:1234" ... />

Working Directory

Edit the parameter named filemgr.working.dir and change its value to a directory of your choice. This working directory is used as a temporary storage location for files as the web application processes requests - for example when creating zip archives of several files.

<Parameter name="filemgr.working.dir" value="/tmp" ... />

Format Configurations

Certain outputs from the web application can be customized using configuration files. Please see the CAS Product Server Web Application - User Guide for more details on how to write these configuration files. The sections below explain how to refer to these configuration files from the context file.

OODT versions from 0.7 onwards

OODT 0.7 and above can support multiple configurations for each format. Currently, RDF and RSS formats are configurable. Create a new parameter for each configuration file. Parameter names should conform to the format configuration.<format>.<name>, where <format> is the recognized file extension of the target format (e.g. rss, rdf) and <name> is a unique name of your choice for the configuration (e.g. example or georss). Example parameters are shown below:

<Parameter name="configuration.rdf.example" value="[FMPROD_HOME]/rdfconf.xml" ... />
<Parameter name="configuration.rss.example" value="/tmp/rssconf.xml" ... />
<Parameter name="configuration.rss.georss"  value="/usr/local/oodt/webapp/fmprod/georss-config.xml" ... />
OODT versions up to and including 0.6

OODT versions up to and including 0.6 support single configuration files for RDF and RSS. Parameters for RDF (named filemgr.rdfconf.file), RSS (named filemgr.rssconf.file) and RSS file transfers (named filemgr.rss-transfer-conf.file) are required - set the values as appropriate to point to your configuration files. Examples are shown below:

<Parameter name="filemgr.rdfconf.file" value="[FMPROD_HOME]/rdfconf.xml" ... />
<Parameter name="filemgr.rssconf.file" value="/usr/local/oodt/webapp/fmprod/rssconf.xml" ... />
<Parameter name="filemgr.rss-transfer-conf.file" value="/usr/local/oodt/webapp/fmprod/rss-transfer-conf.xml" ... />
  • No labels