Installing tDAR

Set up the environment

  1. Download and install Maven 2 from http://maven.apache.org
    (if behind a proxy don't forget to configure your Maven settings file appropriately)
  2. check out the codebase from our bitbucket repository: https://bitbucket.org/tdar/tdar.src
  3. install the prerequisites:
    1. PostgresSQL - 9.1 (Harris+)
    2. Postgis
    3. Tomcat (production only)
    4. Atlassian Crowd or an LDAP server
  4. set up the database:
    1. Setup "tdar" user:

      psql console
      create user tdar with CREATEDB;
      GRANT USAGE ON LANGUAGE plpgsql TO tdar;
    1. setup the databases and load the sample data

      run script
      src/main/db/load_tdarmetadata_database.sh
    2. To setup the tdardata database and tdargis database, locate the zip files in the https://bitbucket.org/tdar/tdar.support repository
    3. setup the tdargis database as a postgis database
    4. load the sql for each zip file into the corresponding database

  1. set up the instance by performing the following:
    1. make sure you have a tdar user with CREATEDB permissions on postgres
    2. run the maven setup task:

      mvn -Psetup-new-instance compile
  2. setup auth environment
    1. in src/main/resources/ find the requisite config file (crowd.properties, ldap.properties)
    2. configure as needed
    3. Make sure that the auth system has the following groups:
      1. tdar-admins

      2. tdar-editors

      3. tdar-users

setup the dev environment

  1. use mvn eclipse:eclipse to generate Eclipse's .project & .classpath files, then add M2_REPO to the variables via Build Path -> Add Variable and set it to your local Maven 2 repository. On Unix-ish machines, this should be ~/.m2/repository. If you're using the m2eclipse plugin , this step usually isn't necessary.
  2. (on GRID and before) to make google maps work on your development box, copy src/main/webapp/includes/googlemaps-api-key.js.template to src/main/webapp/includes/googlemaps-api-key.js and then customize it by changing the gmapsKey variable to the google maps api key for your host. You can get a google maps api key at http://code.google.com/apis/maps/signup.html
    #Important maven targets include:
    1. mvn compile
    2. mvn test
    3. mvn jetty:run to deploy the webapp on the port specified in pom.xml
    4. mvn verify to run the unit and integration tests

Maven dependencies

To add new library dependencies, you can look them up via a repository search engine like http://mvnrepository.com or http://search.maven.org (see http://maven.apache.org/general.html#How_to_find_dependencies for more repository search engines). If so, add the pom snippet to the pom.xml, otherwise you may need to install it manually in our local maven staging repository. You can also add maven repositories to Archiva as a proxy connector, which will keep our pom.xml simpler.

Code Formatting:

  1. Go into eclipse preferences
  2. Navigate to Java > Code Style > Formatter
  3. Click import and import the eclipse format file