Sunday, December 30, 2007

Create a new portlet in tDar

In order to add one new portlet in the tDar portal. Some basic procedures are required to follow:
  1. Create a class which inherits from "org.gridlab.gridsphere.provider.event.jsr.ActionFormEvent";
    1. It's better to create a separated project for the new porlet; in the project, we have
      1. a directory 'src'
      2. a directory 'webapp', under which some important configuration files are, like portlet.xml, layout.xml.
      3. build.properties
      4. build.xml: configurations about the compiling, deployment etc. (probably manual changes are required)
  2. Make relative configurations
    1. webapp/WEB-INF/portlet.xml:
      1. description information about the portlet class
    2. conf/gridsphere/layout.xml
      1. description information about the portlet class
    3. build.xml:
      1. add the build information about the new portlet
  3. Run 'ant deploy', and restart tomcat.

A good idea might be to create a code template for a new porlet.

tDar Setup Guide

To set up the tDar environment, there are some basic procedures to follows. At this time, we use the package provided by Allen, and it makes the work much easier.
  1. All files including scripts, classes, jsp, libs etc, are all put in the directory "geon-tomcat"; first download this directory and put it in the local machine (say, C:/).
  2. We also need download another package "work", where all source codes and necessary third-party libraries are for the purpose of development.
  3. Preparation of Database
    1. Install PostgreSQL 8.x, and start the db service; (probably some configurations should be done)
    2. Create a user "geonportaluser", it should be easy if pgAdmin.exe is used.
    3. Create databases, "geonportaldb", "geoncat" and "tdar". (owner is "geonportaluser").
    4. Import the data from dump files "geoncat.dump" and "geonportaldb.dump", by the following command:
      1. psql -U geonportaluser $db < $db.dump;
    5. "cd work", and run the command, "ant init-db" to create tables in the database "tdar".
  4. Create environment variables:
    1. $JAVA_HOME : where Java directory is;
    2. $PATH : where Java bin directory is.
    3. Example:
      1. export JAVA_HOME=/usr/lib/jvm/java-6-sun
      2. export PATH=$PATH:$JAVA_HOME/bin
  5. Start of Tomcat: go to the directory "geon-tomcat/bin", and run the command:
    1. Linux:  "sudo ./startup.sh";
    2. Window: "startup.exe" (the link: http://testdrive.mapinfo.com/techsupp/miprod.nsf/kbase_by_product/87B9844AF29A886D852570530054F28B could help!)