QuakeSim2 Portal Development Notes

From CrisisGridWiki

Contents

Directories

The top level directories are below. These are all in SVN.

Building

Below is a list of the basic bash scripts for installing stuff.

  • Use ./install-it-all.sh to build everything.
  • This is decoupled into several supporting shell scripts, so see install-it-all.sh for the pieces.
  • env.sh sets all necessary environment variables.
  • unpack-tars.sh explodes .tar.gz files in various directories.
  • build-gridsphere.sh runs ant install on gridsphere.
  • customize-portal.sh installs the portal lnf stuff.

Making a New Webapp

I'm going to use JSF and JSR 168 portlets for this project. It is easiest to develop JSF web applications independently and then deploy them into the portal in the last minute. This process is very error prone, so the best way to crystallize the process is to use Maven. Maven archetypes can be used to create the project template correctly and then Maven itself creates a self contained deployment process. I'm basing this on Evan Bollig's excellent notes: http://www.gorerle.com/vlab-wiki/index.php?title=JavaServerFaces-Archetype.

More Notes

  • To checkout the code, use the command
   svn co https://svn.sourceforge.net/svnroot/crisisgrid/QuakeSim2

This will create the directory QuakeSim2.

  • My goal here is to have everything self-contained and transportable between developers. The SVN contains (almost) everything you need to install (tomcat, maven, ant, gridsphere).
  • There are some additional jars here: http://www.servogrid.org/slide/iSERVO/MOSES/maven2jars.zip. Unpack these in your $HOME directory to make the directory $HOME/.m2. This is a local maven repository. Ideally we should have a maven repository set up to download these project specific jars, but I haven't set this up yet.
  • To install everything on Linux, use the command "install-it-all.sh". This may take a few minutes. This shell script actually calls several other shell scripts, which can be called more or less independently. The script env.sh sets global environment variables.
  • Note the SVN includes everything, including tomcat and gridsphere. These are under the directory portal_deploy. To start and stop the Tomcat servers, I have to little scripts, tomcat-startup.sh and tomcat-shutdown.sh, under QuakeSim2. After starting tomcat, point your browser to http://your.server.edu:8080/gridsphere.
  • To clean up the installation and start from scratch, use "clean.sh". This will remove all compiled codes and deletes the tomcat directories. You should run "clean.sh" and rebuild with "install-it-all.sh" regularly (i.e. once per day at least).
  • You should regularly check in changes with SVN. Run "clean.sh" first so that you avoid checking in compiled classes and similar things. The following two commands (run from the QuakeSim2 top directory) use grep -v to avoid these things:
   svn add  `find . -name "*" |grep -v classes|grep -v svn|grep -v portal_deploy | grep -v third_party_tools`  
   svn commit  `find . -name "*" |grep -v classes|grep -v svn|grep -v portal_deploy | grep -v third_party_tools`
  • I have followed the following procedure for web app development. I first develop standalone JSF webapplications (for RDAHMM and STFilter for example). These are under the QuakeSim2/jsf_standalone directory.
  • All webapps are developed as Maven2 projects. One of the consequences of this is that the directory layout is important. You MUST follow this layout. Luckily there is a useful Maven2 JSF project template builder here: http://www.gorerle.com/vlab-wiki/index.php?title=JavaServerFaces-Archetype. This should create the correct directory structure. If in doubt, look at the existing code for examples.
  • After I have completed the standalone webapp, I then convert it into a portlet. The portlets are under the directory QuakeSim2/portlets. The ant build file copybuild.xml is a helper for copying over all of the necessary files from the standalone webapp into the corresponding portlet.
  • The scripts rdahmm-portlet-install.sh and stfilter-portlet-install.sh are used to build the portlets. They take care of a few gridpshere-specific portlet installation details, so use these as a template for making new installers.
  • Portlets are very similar to the original standalone JSF application because we use the JSF portlet bridge. Here are the differences: web.xml needs some minor changes; pom.xml needs to have the JSF portlet bridge jars added; there are some additional, gridsphere specific files (gridsphere-portlet.xml, group.xml, layout.xml). The group.xml and layout.xml files are useful for making your portlets appear in Gridsphere with minimal manual configuration.
  • Note that the RDAHMM and STFilter codes are actually installed and running on Danube. The portlet/webapp codes contact these remote services. I'm in the process of getting this web service code added to the SVN to make it easier to run the service elsewhere.
  • Notes on Google Maps: this portlet does not work with IE but Firefox is OK. Also, as always, the signature on the portlet must be specific to your host name, so you will have to change this.
  • Next steps: the current RDAHMM portlet is implemented as a sequence of JSF/JSP pages, but we should instead put all of these on the same display to make a dashboard. Also the STFilter portlet need some simplification.
Project Contact Information