reset password

Setting Up Development Environment for CS520

This guide is for setting up a development environment for CS520 under Windows XP/Vista/7. All the software are available online for free. You may also get all the software and the screen capture videos from the MSDNAA software computer in the CS department office. The files are in the CS520 Software folder on the Windows Desktop. The total size of the files is about 370MB. You need to bring with you a flash drive or a writable CD.

A screen capture video illustrating this process is available here.

PostgreSQL, Eclipse, and Tomcat

Install PostgreSQL as described in PostgreSQL Database Server Installation.

Install Eclipse and Tomcat as described in Web Development with Eclipse and Tomcat. Note that if you have 64-bit Windows, you should install the 64-bit version of JDK and Eclipse.

Additional Eclipse Plugins

In Eclipse, install the Subclipse plugin as follows:

  • Click Help -> Install New Software....
  • Click the Add... button:
    • Name: Subclipse
    • Location: http://subclipse.tigris.org/update_1.6.x
  • For 32-bit Windows users, simply select the components that are marked as required. For 64-bit Windows users, select the following components instead:
    • Subclipse (Required)
    • Subversion Client Adapter (Required)
    • SVNKit Client Adapter (Not Required)
    • Core SVNKit Library
  • Complete the installation process.

Follow the same procedure to install the Log Viewer plugin:

  • The update site for the plugin:
    • Name: Log Viewer
    • Location: http://svn.codespot.com/a/eclipselabs.org/logviewer/trunk/de.anbos.eclipse.logviewer.update/
  • Select the Log Viewer Feature (i.e. the one with the higher version number) to install.

CSNS

In Eclipse, open SVN Repository Exploring perspective and enter the repository location svn://cs3.calstatela.edu/cs520/<quarter>/<username>, e.g. svn://cs3.calstatela.edu/cs520/f10/cs520stu31. Expand the repository location, right click the trunk folder, select Checkout, then Finish.

The New Project Wizard consists of several steps:

  • In Screen 1 (Select a Wizard), select Dynamic Web Project.
  • In Screen 2 (Dynamic Web Project), enter csns as the name for the project. You may also need to create a new Target Runtime if you don't already have one.
  • In Screen 3 (Web Module), change Content Directory to web, uncheck Generate Deployment Descriptor, then click Finish.

The campus wireless network used to block the port used by Subversion, and if that's still the case, when you try to access the repository on campus from your laptop, you need to connect your laptop to the wired network. Networks outside the campus should work just fine.

After the project is checked out, create a PostgreSQL database for CSNS, then use the following two SQL scripts under the db folder of the project to populate the database:

  • /db/csns-create.sql will create the database tables, indexes, functions, and triggers.
  • /db/csns-test-insert.sql 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.

Copy build.properties.sample to build.properties, and modify build.properties according to your setup.

Create an Ant Builder for the project by right clicking on the project, then select Properties -> Builders -> New -> Ant Builder. In the Builder Properties window,

  • Change the name of the builder from New_Builder to CSNS Ant Builder.
  • In the Main tab, specify the build file (Browse Workspace -> click on the project -> select build.xml).
  • In the Targets tab, click Set Targets for Auto Build, then click OK (the default target in the build file would be selected).
  • Click OK to close the Builder Properties window, then OK again to close the  Project Properties window.

There are two things you need to be careful when creating the Ant builder. First, after setting the target for Auto Build, click the OK button, not the Apply button. Probably due to some bug, clicking the Apply button will undo the target setting instead of applying the setting. Second, after the Ant builder is created, refresh the project by right click on the project then select Refresh. Refreshing the project is important because Ant is an "external tool" to Eclipse, which means that Eclipse is not aware of the changes made by Ant until the project is refreshed.

Finally, right click on the project, then Run As -> Run on Server to run the project. If you can log into CSNS using one of the test accounts, the project is properly set up and you can start working on the code.

This page has been viewed 45097 times.