|
CSNS - Computer Science Network Services | |
| Department of Computer Science, California StateUniversity, Los Angeles |
Download and install the latest JDK. Define an environment variable JAVA_HOME to be the directory where JDK is installed.
Download and install the latest Ant. Define an environment variable ANT_HOME to be the directory where Ant is installed, and add %ANT_HOME%\bin (or $ANT_HOME/bin on Linux) to the PATH environment variable.
Download and install the latest PostgreSQL. Create a database for CSNS.
Download and install the latest Tomcat. You'll also need to download the PostgreSQL JDBC driver and put it under the /lib folder of the Tomcat directory. Modify /conf/tomcat-users.xml and add a manager user, e.g. <user name="cysun" password="abcd" roles="manager" />.
Check out the source code from the Subversion repository.
Copy build.properties.sample to build.properties, and modify build.properties according to your setup.
Run the SQL script /db/csns-create.sql on the CSNS database to create the database schema. For a production setup, modify /db/csns-insert.sql to create the users and courses. For a test or development setup, run the script /db/csns-test-insert.sql, which will populate the database with some test data, including a number of student and instructor accounts. The username of each account starts with either "i" (for instructors) or "s" (for students), then followed by four digits, e.g. i0001 or s0002. The account i0000 also has administrator privilege.The password of each account is the same as the username.
Start the Tomcat server, then deploy CSNS by entering the following command on the command line under the CSNS folder:
Assume that the Tomcat server runs at port 8080, CSNS can now be accessed at http://localhost:8080/csns.
Eclipse is the preferred IDE for CSNS. The following briefly describes how to setup a CSNS project in Eclipse, but if you have not used Eclipse before, it is highly recommended that you check out the book Eclipse Web Tools Platform: Developing Java Web Applications, which, as the name suggests, provides lots of useful information about using Eclipse to develop Java web applications.
1. Download and install the latest Eclipse with WTP (Web Tools Platform).
You can get an all-in-one package either at http://www.eclipse.org/downloads/ (select "Eclipse IDE for Java EE Developers"), or at http://download.eclipse.org/webtools/downloads/ (select the "Released" build then choose the all-in-one package for your platform). Also install two Eclipse plugins: Subclipse and Logfile Viewer.
2. Check out the CSNS source code from the Subversion repository.
Open SVN Repository Exploring perspective and enter the repository location. Expand the repository location, right click the trunk folder, select Checkout, then Finish.
The New Project Wizard consists of several steps:
3. Copy build.properties.sample to build.properties, and modify build.properties according to your setup. Create a CSNS database and populate it as described in the installation procedure.
4. Add an Ant Builder to the project.
Right click on the project, then select Properties -> Builders -> New -> Ant Builder. In the Builder Properties window,
Click OK again to close the Project Properties window.
5. Right click on the project, then Run As -> Run on Server to run the project.