create a database:
Clay is a server-client system which utilizes many resources that may have to be set up for an installation. It is programmed and must be compiled in Java 1.4.0, and requires the jdk for this. This jdk is available from Sun on their website and can be downloaded at http://java.sun.com/j2se/. Rember the directory in which you install the development kit to (example: c:\j2sdk1.4.0\). It will be now referred to in this document as %JAVAHOME.
Clay needs a database to be running to store all work in which the users create. In fact, the schema to build your own database is located on our website, and is also listed below as a convenience. This schema will allow you to make any type of database that you wish, provided you obtain the drivers necessary to run the database on your machine.
| Table
1: ClayUser |
||
|
-
username varchar(30) Primary Key
- firstname varchar(20) - lastname varchar(20) - password varchar(20) - affiliation varchar(100) - isLoggedIn boolean - chatFgColor varchar(7) - chatBgColor varchar(7) |
||
| Table 2: Projects | ||
|
-
name varchar(100)
- id autoincrement integer Primary key - summary varchar(500) - status varchar(20) - startdate varchar(20) - enddate varchar(20) |
||
| Table 3: UserProjects | ||
|
-
username varchar(30) foreign key
- id serial integer foreign key - isAdmin boolean |
||
The schema above holds the types relevant to a PostgreSQL database, however they can be easily modified (and understood) to fit the types held within other relational databases.
As many people installing this software will have limited resources, we will take you step by step through two seperate installations of the clay software. The first will deal with creating and installing an MS Access database backend, on a windows-based system. The second will take you through the steps needed to install a postgres database system for the backend.
1. MS ACCESS, PC PLATFORM:
MS ACCESS is a simple-to-use, easy-to-setup database system designed by microsoft. In this case, it is less than secure, but good enough to set up in order to run clay for our testing.
Open Access from the windows start menu, and create a new file. We'll name it "testclay". Either scroll up this page, or surf to http://www.tcnj.edu/~assistf/clay/projectdocs/claydb.html to obtina the schema to input into the database. There are three tables in total. To translate from the PostgreSQL datatypes is simple. Varchars turn into Strings, booleans turn into "Yes/No"s and integers are "Numbers".
We have also provided simple SQL scripts to insert initial test data into the tables. Open up http://www.tcnj.edu/~assistf/clay/projectdocs/claydb.html if you have not already, and scroll down to the Insert Data section. Paste these scripts into Access's SQL window, and you have the data good to go.
Close Access, thus saving your database. You must now set it up as a system DSN:
If you have windows 95/98:
If you have windows 2000:
Open up the Data Sources program. This can be found by navigating:
Start / Settings / Control Panel / Administrative Tools / Data Sources
Once open, click the "System DSN" tab. A list of current drivers on your machine are listed there. Select "Microsoft Access Driver (*.mdb)" and click add.
Fill in the data source name, which is what you'll refer to the database as (example: testclay). Also it is optional to put a description in. Then, select the file of the database we just made. Click OK, and exit out of the Data Sources setup.
You have now made your system recognize the database which will be used for Clay.
Now that your database is all setup, you must obtain Clay from our website, if you have not already done so. The latest release can be found linked off of http://www.tcnj.edu/~assistf/clay/. The directory in which you install it (example: "C:\clay") will now be referred to as %CLAYHOME in the remainer of this document.
You must configure your version of clay to run on your computer. The good part is, there is no modification of Java code for this. All changes to configure it will be in an XML configuration file. Open this file: %CLAYHOME/conf/clayserver.xml.
You will be changing 4 tags within this XML. Do not worry, this is not hard to understand.
You must tell your computer where the server will be. We will assume that it will be on your computer. Find out your IP address, and type it in for the serverInetAddress.
<mainServer rmiservername="ClayServer"
port="1099"
serverInetAddress="192.168.1.100"
pidFile="claypid.shutdown"
shutDownPort="4033"
debug="5"
/>
You must also locate the class server for clay, which will be at %CLAYHOME/www
<classServer name="ClayClassServer"
port="3780"
classpath="file:/c:/devel/Clay/www/"
debug="3"
/>
Also, you need a connection to the database driver that you just set up. This can be done by adding the following to the appropriate section:
<userProjectDatabase driverName = "sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbc:odbc:testclay"
username=""
password=""
minConnections="3"
maxConnections="10"/>
Also, set up the cstore root, which should be changed to %CLAYHOME/cstorehome.
<cstore rootdir="c:\\devel\\Clay\\cstorehome\\"
debug="3"
/>
Save your configuration file.
There is one other issue with running clay. You must edit the .bat files in the &CLAYHOME/bin directory. This is because the bat files need to know where %JAVAHOME and %CLAYHOME are located. This is easy. In each .bat file in this directory, change two lines to match your computer:
set CLAY_HOME=c:\devel\clay
set JAVA_HOME=c:\j2sdk1.4.0
You are now ready to run your version of the Clay software.
Win2000:
open new command window, run rmiregistry
open new command window, run clayrmic
run clay start
open new command window, run clay coopcoder
Win 98:
You must make one more additional change to the clay.bat file. As MSDOS does not correctly support the "start" command, you must remove this from the calls to run each of the clients:
:startCoopcoder
echo Starting clay client in new window...
echo Using classpath: %CLASSPATH%
start %JAVA_HOME%\bin\java %CLAY_OPTS% -cp %CLASSPATH% -Dclay.home="%CLAY_HOME%" edu.tcnj.cs.clay.client.coopcoder.ClayClient %3 %4 %5 %6 %7 %8 %9
goto cleanup:startHopewell
echo Starting clay client in new window...
echo Using classpath: %CLASSPATH%
start %JAVA_HOME%\bin\java %CLAY_OPTS% -cp %CLASSPATH% -Dclay.home="%CLAY_HOME%" edu.tcnj.cs.clay.client.hopewell.ClayClient %3 %4 %5 %6 %7 %8 %9
goto cleanup:startWhiteboard
echo Starting clay client in new window...
echo Using classpath: %CLASSPATH%
start %JAVA_HOME%\bin\java %CLAY_OPTS% -cp %CLASSPATH% -Dclay.home="%CLAY_HOME%" edu.tcnj.cs.clay.client.whiteboard.ClayClient %3 %4 %5 %6 %7 %8 %9
goto cleanup
Remove the "start" from each, so that the lines begin with %JAVA_HOME.....etc....
open new command
window, run rmiregistry
open new command window, run clayrmic
run clay start
open new command window, run clay coopcoder
ENJOY.
Postgresql (see postgres install instructions)
PoSTGRES:
----------------------