NMC DSP Getting Started on a Mac

From BioAssist
Jump to: navigation, search

NMC DSP - Mainpage


Software Packages

In order to get started with the NMC Data Support Platform (NMC DSP) you need to obtain the following software packages:

downloading

installing Apache Tomcat

Installing Apache Tomcat on OS X is pretty straightforward as you really do not need to install anything. Create the path /Library/Tomcat, extract the downloaded archive in that path and create a symbolic link to it. In your terminal that would be something like:

sudo mkdir -p /Library/Tomcat/
sudo tar -C /Library/Tomcat -xzvf ~/Downloads/apache-tomcat-6.0.18.tar.gz 
sudo ln -s /Library/Tomcat/apache-tomcat-6.0.18 /Library/Tomcat/Home

installing Fink

Fink is the open source package management for Mac OS X based on Debian's aptitude and can be used to install commonly used open source packages like the PostgreSQL database server. After installing fink you can perform a selfupdate and -just like any Debian flavoured OS- update aptitude:

sudo fink selfupdate
sudo apt-get update

installing PostgreSQL

If the Fink package manager is installed and updated you can use it to install the PostgreSQL database. Search for the PostgreSQL packages to install, and install the latest:

bash-3.2# sudo apt-cache search postgresql
bash-3.2# sudo apt-get install postgresql82

Setting up your workspace

Where you would like your workspaces stored is of course a personal preference. As I do a lot of PHP projects as well I have seperated PHP and Java/NMCDSP workspaces in respectively ~/Workspace/php and ~/Workspace/nmcdsp. In this example I will assume you use ~/Workspace/nmcdsp as well, but of course you are free to use whatever you like.

mkdir -p ~/Workspace/nmcdsp
unzip ~/JavaWorkspace/molgenis_workspace-x.y-testing.zip -d ~/Workspace/nmcdsp

You can now start Eclipse and select / change to your Molgenis workspace (File --> Switch Workspace --> Other --> ~/Workspace/nmcdsp).

Adjusting Build path and Java Runtime

By default Apple / Eclipse uses versions 1.5 of the JDK and JRE, however Molgenis requires 1.6 which was installed by the latest Apple Java packages you downloaded earlier. 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).

NMC DSP Leopard Eclipse JavaBuildPath.png

NMC DSP Leopard Eclipse JavaCompiler.png

Setting up Apache Tomcat for your project

Select the properties for Eclipse and configure a Tomcat server with JRE 1.6:

NMC DSP Leopard Eclipse Server RuntimeEnvironment 1.png

NMC DSP Leopard Eclipse Server RuntimeEnvironment 2.png

NMC DSP Leopard Eclipse Server RuntimeEnvironment 3.png

Generating

Now that you have everything set up correctly, and you have switched your Eclipse workspace to your Molgenis workspace, you can generate the Molgenis code by running MolgenisGenerate.java :

NMC DSP Leopard Eclipse MolgenisGenerate.png

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:

  1. select molgenis3_2_distro
  2. right click --> Run As --> Run On Server
  3. create a new Tomcat server based on the server definitions created above

NMC DSP Leopard Eclipse Server RunOnServer-1.png

NMC DSP Leopard Eclipse Server RunOnServer-2.png

NMC DSP Leopard Eclipse Server RunOnServer-3.png

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:

NMC DSP Leopard Eclipse Server RunOnServer-4.png

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

Subclipse Share-Project.png

Select SVN

Subclipse Share-Project SVN.png

Select 'Create a new repository location' and click next

Subclipse Share-Project Repository-Location.png

Enter https://gforge.nbic.nl/svn/nmcdsp/molgenis/branches as repository location and click next

Subclipse Share-Project Enter-Location.png

Select 'use specified folder name' and enter your (nick)name:

Subclipse Share-Project Repository-Folder-Name.png

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:

Subclipse Share-Project Add-Property.png

For property name enter: svn:ignore and for Property Content enter the following:

build
generated
handwritten
WebContent
*.properties
*.txt
.classpath
.project
.settings

Subclipse Share-Project Add-Property2.png

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:

Subclipse Add-Plugins-To-Version-Control.png

Commit your changes

Now that everything is set-up correctly you're finally ready to commit your changes and to make your first contribution!

Subclipse Share-Project Commit.png

Subclipse Share-Project Commit2.png