Developer project setup

These instructions should apply to linux, mac os x and windows (modulo some "right-click"s)

Set up tools

  1. Install Git http://git-scm.com/
  2. Install Eclipse indigo (3.7) for java developers http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1
  3. Install PostgreSQL 9.0.x http://www.postgresql.org/
    1. Install PostGIS extension http://postgis.refractions.net
    2. Setup pgpass file for your postgresql root user. Location will vary by OS. See http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html
  4. Install curl http://curl.haxx.se/download.html

Set up project

  1. clone git repository: git clone git://github.com/kurie/phyloviewer.git
  2. Import project into Eclipse
    1. File > Import
    2. Maven > Existing Maven Projects
    3. Next button
    4. Browse button
    5. Select root of cloned git repository
      • should find 4 pom.xml: /, libraries/phyloviewer-common, libraries/phyloviewer-gwt-client, apps/viewer
    6. Finish button
      • (might need to install some more eclipse plugins here: wtp, mavenarchiver)
    • Should now have 4 eclipse projects added to workspace: phyloviewer, phyloviewer-all, phyloviewer-common, phyloviewer-gwt-client
  3. Initialize database
    1. follow instructions in phyloviewer\apps\viewer\src\main\sql\readme.txt (where phyloviewer is the root of your git repo)
      • Windows users should have had sh installed along with Git. I don't think anything else is required for this step, but I'm not positive about that.

Run the app (debug mode)

  1. Run the app in debug mode in eclipse
    1. Right-click phyloviewer in the package explorer and choose Debug As > Web Application
    2. Double-click the URL to open the app in your default browser.
      • Eclipse will compile the project for your browser now, so it might take a while to open
      • The console view in eclipse will show server log messages
    • The database is currently empty, so you won't see any trees in the "Select a tree to load" dialog box. Don't stop the server, we'll import a tree next.
  2. Import a tree
    1. Find (or create) a file containing a tree in either newick or nexml format.
      • The following text, for example, is the newick representation of a very small tree with 3 named leaf nodes and two unnamed internal nodes: (foo,(bar,baz));
    2. Import the tree using curl
      1. For a file named foo.nwk in the current directory, you would use the following command line:
      2. You should see a response similar to the following:

        HTTP/1.1 100 Continue

        HTTP/1.1 202 Accepted
        Location: http://localhost:8888/view/tree/f2faea8a5b27f8693bd80b6dc5052271
        Transfer-Encoding: chunked
        Server: Jetty(6.1.x)

        http://localhost:8888/view/tree/f2faea8a5b27f8693bd80b6dc5052271

        • Note that, in debug mode, this URL cannot be used to view the tree
    3. View the imported tree
      1. Make the tree public
        1. TODO (I usually just use pgadmin to do update tree set public=TRUE;, but I should put a more portable command line here to do that.)
      2. In the browser, click File > Open and there should be a tree named "foo" in the dropdown list.

Run the app (production mode)

  1. Stop the server if it's already running
    1. Open the development mode view in eclipse and click the red square on the right. (A gray square indicates that the server is not running)
  2. Compile the app
    1. In eclipse project explorer, right-click the phyloviewer project
    2. in the pop-up menu, click Google > GWT Compile
    3. in the resulting dialog, click the Compile button
    • After compiling, you should see something in the eclipse console like Compilation succeeded – 79.609s
  3. Run the app
    1. Right-click phyloviewer in the package explorer and choose Run As > Web Application
    2. Right-click the url and choose Copy.
    3. Paste the url into your browser address bar without the ?gwt.codesvr=127.0.0.1:9997 parameter
    • The app should start up much more quickly than in debug mode and should be much more responsive