|
Cofax Developer Instructions
Last Update: 2004/August/26
Note that these instructions are geared towards a Windows development environment and
using the Eclipse IDE. They can be modified to suit your needs..
Requirements
Install latest version of the Sun SDK
Cofax development requires J2EE 1.4 SDK or the J2SE SDK 1.4.1 and higher.
Add the JAVA_HOME environment variable to equal the directory you installed it into.
Add [JDK Directory]\bin to the PATH environment variable.
Test javac and java from a command prompt.
Install the latest version of Apache Ant
This is the tool we use to compile and build Cofax.
Add the ANT_HOME environment variable to equal to the directory you installed it into.
Test ant from a command prompt.
Install the latest version of Jakarta Tomcat
Cofax has run on all servlet containers it has been tested on. We develop on Tomcat
versions 4.1 and higher.
Confirm you have installed Tomcat correctly by running
[Tomcat Install Directory]\bin\startup.bat.
Open http://localhost:8080/ in a web browser and run its sample applications.
Run [Tomcat Install Directory]\bin\shutdown.bat from a command prompt to shut it down.
Install the latest version of MySQL
Cofax is designed for database independence. It can be ported far easier to new database
platforms in comparison to other CMSes. We use MySQL as our reference implementation.
Run [MySQL INstall Directory]\bin\winmysqladmin.exe
Confirm that you can connect to the database.
Install the latest version of Eclipse
We use Eclipse as our standard IDE.
Download Eclipse from a mirror site.
Extract it into the directory you intend to run it from.
Run and shutdown Eclipse one time so that it can initialize.
Create a root workspace directory where you intend to manage your projects
and checkout files from CVS into.
Change its Windows shortcut to launch Eclipse using this directory by
include a parameter on the end of it's target: -data [CVS work directory].
I.E.: D:\usr\local\eclipse\eclipse.exe -data d:\workspace.
Run Eclipse and change to the Resource Perspective.
Change to the CVS Repository Perspective.
Add a new CVS Repository location: If you are a Cofax team member: Host=cvs.sourceforge.net, Repository Path=/cvsroot/cofax,
User=Your sourceforge user name, Password=Your Sourceforge password, Connection Type=extssh and
leave everything else as is. It will connect on saving. If not right click and choose
Refresh View. If you are not a Cofax team member: Host=cvs.sourceforge.net, Repository Path=/cvsroot/cofax,
User=anonymous, Password=leave blank, Connection Type=pserver and leave everything else as is. It will connect on saving. If not right click and choose
Refresh View.
Open the HEAD node. Choose the Cofax folder. Right click and choose Check Out As...
Choose "Check out as project in the workspace" and take the default name of "cofax". Click the Finish button.
Change to the Java Perspective. You should have the cofax project navigatable
in the Package Explorer and be able to browse the src, apps, and lib trees.
As you edit Java classes under src, Eclipse will recompile your changes instantly
and flag errors for you. It will also notify you of bad Java practices such as
unncessary imports or refering to static members in a non-static fashion.
Edit Development Environment Variables
Edit se.bat and set TOMCAT_HOME to the directory you installed Tomcat into, set MYSQL_HOME to the
directory you installed MySQL into, and ANT_HOME to the directory you
installed Ant into.
Project Directory Overview
You will edit files in these directories and run ant to
deploy, create distributables, and test.
[Eclipse Workspace]\cofax\src - Edit source code here.
[Eclipse Workspace]\cofax\lib - Add standard external libraries. These
will be copied into distributables.
[Eclipse Workspace]\cofax\apps - Application stubs. Webapps, templates,
database schema information, etc.
Developer Tasks
All directories mentioned are relative to [Eclipse Workspace]\cofax.
Update files from CVS (do before ANY development. do repeatedly during development):
use Eclipse, right click the project and choose Team and Update. In the Update dialog
pop up simply click "Finish". Type in password if necessary.
Set up a command prompt for running Ant, Tomcat, or MySQL tools: run
se.bat.
To install/update MySQL database: follow install instructions under
apps\cdw_mysql in install.txt.
To install Cofax into Tomcat, run Ant from the project directory.
To start Cofax, start Tomcat by running startup.bat and navigating
to http://localhost:8080/content/main.htm in a web browser.
To add or edit Java Source: use Eclipse, in its Java Perspective, under src.
To add or edit Content Display System (CDS) templates: use Eclipse, in its Java or Resource Perspectives,
and work under apps\content\templates.
To add or edit Content Management System (CMS) templates: use Eclipse, in its Java or Resource Perspectives,
and work under apps\content\toolstemplates.
To add or edit the CDS/CMS configuration: use Eclipse, in its Java or Resource Perspectives,
and work under apps\content\WEB-INF.
To add or edit static images to the CDS: do so with tool of choice under apps\content\static.
To add or edit documentation: use Eclipse under apps\docs.
To add or edit Content Data Warehouse (CDW) scripts: do so with tool of choice under
apps\cdw_[cdw system].
To add a new JAR or update an existing one: copy jar to lib directory.
Using Eclipse, in Resource or Java Perspectives, refresh the project tree and observe
the JAR listed in the project. Right click the project, choose Properties. Click Java Build Path
to open is properties page. Click "Add Jars..." button. Navigate to under cofax\lib and choose
your new jar and click "OK". Click "OK" on main properties page. You need to add this file
to CVS. See below.
To add a file to CVS: use Eclipse, right click the file and choose Team and Add to Version Control.
To commit file changes in CVS (neccessary after file deletions, additions, and changes):
right click the folder or file in Eclipse, choose Team and Commit... Note that Eclipse
shows you directories and files that do not match what is in CVS with a ">" prefix in front
of their name.
Update startup data to cdw_ms (Cofax Data Warehouse for MS SQL Server)
by exporting tables to d:\home\projects\cofax\apps\cdw_ms\populateGoon.mdb
Update creation scripts for cdw_ms by creating sql scripts of all
objects to d:\home\projects\cofax\apps\cdw_ms\goon.sql.
Joining The Cofax Team
As is open source tradition: We welcome anyone checking out the latest code
from CVS, emailing us patches, posting bugs, and sharing in the forums.
But if you wish to contribute code to CVS, or help us in any other capacity
on a regular basis, please join our team. We want and need your help!
For more information see the Contact Us page.
|