IGetDBWiki/GettingStarted: Difference between revisions

From BRF-Software
Jump to navigation Jump to search
imported>KaiRunte
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 4: Line 4:
This HowTo explains briefly how to get started with developing code for IGetDB project.
This HowTo explains briefly how to get started with developing code for IGetDB project.


== DB Access ==
== Code Example ==


All IGetDB projects are backed by the projectmanagement system [[GPMSWiki| GPMS]].
You can download some example source-code showing how to access an IGetDB mart and convert the results into a nice pie-chart: [[Media:IGetDBWiki$$GettingStarted$igetdb_1_0-tutorial.zip]]
To be able to work with IGetDB you need an account.


If you are a developer
== Setup of the IGetDB project class in GPMS 2 ==
send an email to:  [[MailTo(krunte AT cebitec DOT uni DASH bielefeld DOT de)]] to get a
developer account.
== Version Control ==
IGetDB has dependencies on several CVS-controlled projects (IGetDB itself is in a Subversion repository, see below).


=== CVS ===
[http://www.cebitec.uni-bielefeld.de/groups/brf/internal/AdministrationOverview/SetupNewIGetDBProjectClass Setup of the IGetDB project class in GPMS 2 (internal wiki)]


* create a working direktory for CVS in your home named 'CVS'
== DB Access ==
* cd to that directory and get the projects needed to run emma:


<pre><nowiki>
All IGetDB projects are backed by the projectmanagement system [[GPMSWiki| GPMS]].
cvs checkout bioinfo/<name of project>
To be able to work with IGetDB you need an account.
</nowiki></pre>
 
You need to checkout the following projects:
* projectmanagement
* O2DBI
 
=== Subversion ===
* change into the directory <code><nowiki>CVS/bioinfo</nowiki></code> and execute
 
<pre><nowiki>
svn co https://svn.cebitec.uni-bielefeld.de/svn/igetdb/trunk igetdb
</nowiki></pre>


== Version Control ==
[[IGetDBWiki/GettingStarted/VersionControl| Version Control]]


== API Documentation ==
== API Documentation ==
Line 41: Line 25:
trouble then it's worth. To generate your own copy of the API
trouble then it's worth. To generate your own copy of the API
documentation, simply run <code><nowiki>ant doc</nowiki></code> in <code><nowiki>igetdb</nowiki></code> directory.
documentation, simply run <code><nowiki>ant doc</nowiki></code> in <code><nowiki>igetdb</nowiki></code> directory.
== Setting up the IGetDB-exporter for EMMA ==
[[IGetDBWiki/GettingStarted/EmmaPlugin| EMMA Plugin]]


== Web-Server ==
== Web-Server ==
 
[[IGetDBWiki/GettingStarted/WebServer| Web-Server]]
IGetDB should be able to run in any servlet-container, although it has been tested with Tomcat 5.5 only.
 
=== Compilation  and Creation of .war File ===
 
Simply run:
<pre><nowiki>
ant war
</nowiki></pre>
 
 
This creates the <code><nowiki>igetdb.war</nowiki></code> file in <code><nowiki>share/webserver/webapps/</nowiki></code>. The target "war" has a dependency on the target "build": If any classes need to be compiled, this happens automatically.
 
=== Changing the Server-Port ===
 
To avoid clashes with other IGetDB instances running on the same machine all ports used by Tomcat are defined in the <code><nowiki>ant.properties</nowiki></code> file. When you have a fresh checkout, the file should look like this:
 
<pre><nowiki>
CATALINA_HOME /vol/bioinfo/share/apache-tomcat-5.5.15
#SERVER_PORT 8005
#HTTP_PORT 8080
#AJP_PORT 8009
#REDIRECT_PORT 8443
#SHUTDOWN_COMMAND SHUTDOWN
</nowiki></pre>
 
If you would run the command <code><nowiki>ant web.start</nowiki></code>, ant would fail with a message such as this:
 
<pre><nowiki>
web.conf.check:
 
BUILD FAILED
CVS/bioinfo/igetdb/build.xml:74: Please define the Tomcat ports in the ant.properties file.
</nowiki></pre>
 
All you need to do is uncomment the four properties definitions <code><nowiki>SERVER_PORT</nowiki></code>, <code><nowiki>HTTP_PORT</nowiki></code>, <code><nowiki>AJP_PORT</nowiki></code>, and <code><nowiki>REDIRECT_PORT</nowiki></code> and '''change''' the numbers to your favourite port numbers. The property <code><nowiki>SHUTDOWN_COMMAND</nowiki></code> must be uncommented as well. Changing the shutdown command is not compulsory, but advisable.
 
=== Start/Stop the Web-Server ===
 
Depending on where you want to develop you might need to change the file <code><nowiki>ant.properties</nowiki></code>. It defines the base directory of the Tomcat server, also called <code><nowiki>CATALINA_HOME</nowiki></code>. The checked in version defines <code><nowiki>CATALINA_HOME</nowiki></code> for our Solaris environment.
 
Important: you need to define the <code><nowiki>JAVA_HOME</nowiki></code> environment variable in your shell. It should point to the base directory of your Java installation (n.b. our rcinfo packages do '''not''' define this variable). The variable is needed by the Tomcat start script.
 
* Starting the webserver: <code><nowiki>ant web.start</nowiki></code>
* Stopping the webserver: <code><nowiki>ant web.stop</nowiki></code>


== Documentation ==
== Documentation ==
 
[[IGetDBWiki/GettingStarted/Documentation| Documentation]]
----
'''As developers we are also responsible for documentation. Please let's try the following conventions:'''
* document your code
* use the specific documentation tools of the domain
* use JavaDoc comments for documenting Java classes
* when using Eclipse use the Java formatter profile "Java Conventions"
* use POD for documenting Perl module
* use perlmodule Pod::Usage for documenting perl-scripts
* each script needs a usage message (see above)
* [[O2DBIWiki|O2DBI]]-documentation (will create POD-doku for server classes)
----
The other main source is the perldoc documentation. The generated [[O2DBIWiki|O2DBI]]-servermodules are pod documented. You can read them with:
<pre><nowiki>
perldoc module.pm
</nowiki></pre>
 
Other modules may also have pod-documentation but this is not guaranteed. The documentation found can also be incomplete or rather outdated. If you wish to generate the documentation for all perl modules you can do so be executing the shell script:
 
<pre><nowiki>
CVS/bioinfo/igetdb/share/exec/create_html_docs.pl
</nowiki></pre>
 
It generates an HTML version of the perldoc documentation in the directory 'CVS/bioinfo/igetdb/share/doc/html'.
 
Additional documentation can be found in CVS/bioinfo/igetdb/share/doc.


== Directory Structure ==
== Directory Structure ==
 
[[IGetDBWiki/GettingStarted/DirectoryStructure| Directory Structure]]
The directory `CVS/bioinfo/igetdb/` contains the specific components of the igetdb software:
 
* `/bin` start wrapper(s) for executable scripts in `/share/exec`.
To run a script in share exec type: `gendb_start scriptname.pl -p project [options]`
* `/share` contains all shared files
** `/exec` executable scripts, such as the importer scripts GenDB->IGetDB and SAMS->IGetDB
** `/doc` contains written and generated (e.g. `ant doc`) documentation
* `/WebContent` contains web-server specific code and the document root
** `/META-INF` contains a default version of the MANIFEST.MF file required for the `.war` file
** `/WEB-INF` contains the servlet configuration file `web.xml`
*** `/lib` contains all the `.jar` files the application is depending on
* `/src` contains the database schema and source code
** `/conf` contains all the configuration and resource files that are to be included into the `.war` file
** `/java` contains the Java source code

Latest revision as of 14:33, 28 October 2011

Getting Started

This HowTo explains briefly how to get started with developing code for IGetDB project.

Code Example

You can download some example source-code showing how to access an IGetDB mart and convert the results into a nice pie-chart: Media:IGetDBWiki$$GettingStarted$igetdb_1_0-tutorial.zip

Setup of the IGetDB project class in GPMS 2

Setup of the IGetDB project class in GPMS 2 (internal wiki)

DB Access

All IGetDB projects are backed by the projectmanagement system GPMS. To be able to work with IGetDB you need an account.

Version Control

Version Control

API Documentation

The API documentation of IGetDB is not checked in as this causes more trouble then it's worth. To generate your own copy of the API documentation, simply run ant doc in igetdb directory.

Setting up the IGetDB-exporter for EMMA

EMMA Plugin

Web-Server

Web-Server

Documentation

Documentation

Directory Structure

Directory Structure