Development on TMAJ
Before You Start
Before you can do any development on TMAJ, you need to perform all the
steps in Server Setup. This page
picks up where the Server Setup page left off.
IDE Setup (Optional)
You should setup an IDE. While this step is optional (you could
use notepad if you really wanted.), we recommend setting up a good
IDE. We use Eclipse as an
- Download Eclipse. You
may download the classic version or the "Eclipse IDE for Java
- Unzip Eclipse into any directory. For example, unzip it
into: C:\Program Files\Eclipse
- Create a shortcut to the eclipse.exe file and put it on your
- Double click the eclipse.exe file to start Eclipse
- Choose New -> Project, Then choose Java Project
- Enter a project name (such as tmaj).
This can be any name you like.
- Choose "Create project from existing source". For the
directory choose the root source tmaj directory (the directory
with the .project file in it. The .project file is an eclipse file.)
- Click the Finish Button
- (Optional) If you get warnings or errors in Eclipse that you
would like to filter out (so you don't see them in the errors/warnings
list) , you can go to the menu under Windows and then go to Java ->
Compiler -> Errors/ Warnings to turn them off.
Making and Testing Changes
The Client and the Server
There are 2 parts to TMAJ: The client and the server. The server
runs on the machine that runs Apache Tomcat. The server will make
a direct connection to the database. The client only connects to
Apache Webserver (the server); the client never directly connects to
the database. (TMAJ would have very low security if clients could
connect to the database directly.) All GUI components are part of
the client. All SQL components are part of the server.
Making a Change to the Client Code
Any GUI components are part of the client. Let us try a simple
example. Try making a change to the login dialog. For
example, change the JLabel to say "username555" instead of just
To see your changes applied, run this command to start the TMAJ
ant gui [shows the the gui client for tmaj]
Making a Change to the Server Code
The server code is executed by Tomcat. Let us try a simple
example. In our sample change, we will make it so
that TMAJ does not check the password that a user enters. It will
allow users to simply enter their username, and any password entered
will be accepted.
As mentioned before, all SQL executions are part of the server.
Locate the SQL statement that checks a user's username and
Change the WHERE clause the SQL will look something like this: (Comment
out the part in the WHERE clause where the password is checked.)
+ " WHERE Username = "
//+ " AND Password = " //This line is commented out
// + StringQuoter.quote(digestedPassword); //this line is commented out.
Next, go to the console and type in:
ant reload (tells Tomcat
that the code has changed -- this is necessary for Tomcat to "see" your
ant gui (runs the tmaj gui
If you forget the ant reload
step when making a change to the server, Tomcat will not see your
changes. This step is unnecessary if you are changing the
client. If you are unsure whether you changed client or server
code, doing an ant reload will
not hurt anything. The only advantage of skipping it is the saved
Pushing your Changes to Production
To push your changes to production, simply run the command: