uPortal by JA-SIG
.

JA-SIG Home

About uPortal

Documentation

Getting Started

Developers

Implementors

Users

Background

Release

Meeting Minutes

.

Setting up A PostgreSQL Database

Overview
PostgreSQL is a sophisticated Object-Relational DBMS, supporting almost all SQL constructs, including subselects, transactions, and user-defined types and functions. It is freely available from http://www.postgresql.org and commercial support is available.
Obtaining the Driver

A PostgreSQL JDBC driver is availble from: http://jdbc.postgresql.org/

Once the driver has been downloaded, the postgreSQL jar file needs to be copied ot a location accessible from uPortal (for example, /usr/local/java/postgresql/lib/

Properties Configuration

The uPortal build.properties may need to be modifed. Find the property called jdbcDriver and change it to point to the PostgreSQL jar file, for example:

jdbcDriver.jar=./lib/postgresql.jar

The uPortal rdbm.properties file (in the properties directory) may need to modified to specify the driver properties. The rdbm.properties file contains several sample entries. Uncomment (or add) the lines for the HypersonicSQL database and make whatever changes necessary to match your local database installation, For example:

#### PostgreSQL
jdbcDriver=org.postgresql.Driver
jdbcUrl=jdbc:postgresql://localhost/uportal
jdbcPassword=sa
jdbcPassword=

The dbloader.xml properties file (also in the properties directory) may also need to be modified. This file is used by the DbLoader tool to create the uPortal database tables and populate the database. It contains several sample entries which create db-type-mappings for different databases. Find the tags for a PostgreSQL database and modify the db-version, driver-name, and driver-version as necessary. For example:

<db-type-mapping>
  <db-name>PostgreSQL</db-name>
  <db-version>7.1.3</db-version>
  <driver-name>PostgreSQL Native Driver</driver-name>
  <driver-version>7.1.3</driver-version>
  <type><generic>LONGVARCHAR</generic><local>TEXT</local></type>
  <type><generic>VARCHAR</generic><local>VARCHAR</local></type>
  <!-- map more types here -->
</db-type-mapping>

The PersonDirs.xml file (also in the properties directory) may need to be modified; This file is used if the database is to be used to provide user directory information

<!-- JDBC Properties -->
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost/uportal</url>
<logonid>sa</logonid>
<logonpassword></logonpassword>,
<uidquery>SELECT FIRST_NAME||' '||LAST_NAME AS FIRST_LAST,
FIRST_NAME, LAST_NAME, EMAIL FROM UP_PERSON_DIR WHERE USER_NAME=?></uidquery>
Loading the Database

Loading the database requires a couple of steps

  • Create the database: Refer to the PostgreSQL database documentation for instructions regarding how to create an PostgreSQL database instances. The database name, port number, and driver information must reflect what was defined in the rdbm.properties file.
  • Create the tables and populate the database: From the uPortal build directory, run "ant db" to execute the ant target which loads the database. The ant target uses the Dbloader tool.
Issues and Known Bugs
.
 
.
JA-SIG Home * About uPortal * FAQ * Download * Documentation * Getting Involved *
Code Repository * Reporting Bugs * License *