NMC DSP Getting Started on Windows
Software Packages
In order to get started with the NMC Data Support Platform (NMC DSP) you need to obtain the following software packages:
downloading
- Download and install the latest Java packages from: http://java.sun.com/javase/downloads/index.jsp
- Download and intall the Eclipse IDE for Java EE developers from: http://www.eclipse.org/downloads/
- Apache Tomcat Core (5.5 or 6.0) from: http://tomcat.apache.org/download-60.cgi
- The latest Molgenis release from: http://molgenis.sourceforge.net/
installing Apache Tomcat
Installing Apache Tomcat on Windows is pretty straightforward. Download the binaries from http://tomcat.apache.org/download-55.cgi and find setup instructions at http://tomcat.apache.org/tomcat-5.5-doc/setup.html
installing PostgreSQL
To install the PostgreSQL database, download the installer at http://www.postgresql.org/download/windows
Setting up your workspace
Where you would like your workspaces stored is of course a personal preference. Just create a directory somewhere in your homedirectory or desktop.
You can now start Eclipse EE and select / change to your Molgenis workspace (File --> Switch Workspace --> Other --> <yourhomedirworkspace>).
Adjusting Build path and Java Runtime
By default Eclipse EE might use versions 1.5 of the JDK and JRE, however Molgenis requires 1.6. In order to get things working you need to change the project settings to use 1.6 instead of 1.5 by changing the Java Build Path and Java Compiler in the properties of the molgenis project (file --> properties).
Setting up Apache Tomcat for your project
Select the properties for Eclipse and configure a Tomcat server with JRE 1.6:
Generating
Now that you have everything set up correctly, and you have switched your Eclipse EE workspace to your Molgenis workspace, you can generate the Molgenis code by running MolgenisGenerate.java :
Now that you have generated the Molgenis code, you can run it on your -previously defined- Tomcat server:
Running
The first time you would like to Run the Molgenis project you need to define how and where to Run your code:
- select molgenis3_2_distro
- right click --> Run As --> Run On Server
- create a new Tomcat server based on the server definitions created above
When you have configured this server once, it will appear in the servers tab where you can easily start / stop the project on your Tomcat server:
Code Sharing / Versioning
Now that you have got the default Molgenis installation up and running, we can have a look at how to start using the Subversion repository. As decided by convention all developers will develop in branches. Stable code will regularly be merged to the main line (trunk) and stable releases will be tagged at certain intervals.
deleting default and unwanted files
Now that you are all set up and ready to go, you can start deleting again ;) First of all remove the XML (configuration) files and the default plugin folder. Unfortunately you cannot rename them as Molgenis does tend to read these files and directories which will result in errors. Hence do the following:
you@computer ~/Workspace/nmcdsp $ cd ~/Workspace/nmcdsp/molgenis_x_y_distro/; rm -rf *.xml; rm -rf ./handwritten/plugin*
installing the subclipse plugin
Make sure you have the subclipse plugin (a subversion implementation) installed in eclipse, a detailed guide can be found link here.
fetching the latest code
Initially it is easiest to perform a manual checkout of the latest code (trunk) or one of the development branches which you would like to use as base code. Fire up your terminal and head over to your molgenis_x_y_distro folder and perform an initial checkout:
cd ~/Workspace/nmcdsp/molgenis_x_y_distro/ svn checkout --username you https://gforge.nbic.nl/svn/nmcdsp/molgenis/trunk
or, if you would like to use one of the development branches instead:
cd ~/Workspace/nmcdsp/molgenis_x_y_distro/ svn checkout --username you https://gforge.nbic.nl/svn/nmcdsp/molgenis/branches/duh
setting up your own development branch
In Eclipse, first refresh (F5 or file --> refresh) your view and right click on molgenis_x_y_distro and select Team --> Share Project
Select SVN
Select 'Create a new repository location' and click next
Enter https://gforge.nbic.nl/svn/nmcdsp/molgenis/branches as repository location and click next
Select 'use specified folder name' and enter your (nick)name:
Finish the wizard
Ignoring molgenis specific files
As we are not interested in code belonging to Molgenis en we only want to store our own code in subversion, we need to subclipse / subversion to know what to submit and what to ignore. In order to easily do that is by adding an ignore property to the svn propety list:
For property name enter: svn:ignore and for Property Content enter the following:
build generated handwritten WebContent *.properties *.txt .classpath .project .settings
And press OK
Add Plugins to version control
The last thing that needs to be done is to manually add the plugins directory to version control. You need to do this because you added it's parent folder (handwritten) to the ignore property list. As plugins is the code we would like to share, you need to add it manually to the versioning list:
Commit your changes
Now that everything is set-up correctly you're finally ready to commit your changes and to make your first contribution!