How to contribute and what to work on

Read the overview of how to contribute here.

Basics of the OpenClinica Code

Maven is used as the build management system and Mercurial (also know as Hg) is used for source control.

The source code can be obtained from OpenClinica repository. Submit your code as mercurial patch as an attachment to the Issue Tracker ticket and we will add it to the code repository manually. In future, this might change and OpenClinica community repository might be available for code submissions directly. 

A typical feature might consist of a database change as well as middle-tier and back end integration.

For database changes, OpenClinica uses a 3rd party library called liquibase to upgrade the database & schema from version to version. Liquibase does a good job in maintaining the OpenClinica versions and making sure scripts are run at install/upgrade time. If the code requires a database change, such as adding a table, altering a table etc, it is important to put in liquibase script.

The business layer code implementation is based on a typical UI-Controller-transaction management model. The UI layer is common uses jsps, with JSTL libraries along with javascript and Jquery libraries.

There are 2(3) kinds of controllers used all across the OpenClinica application

  1. Base controller is SecureController –> This is used widely all across the application and extends SingleThreadedModel (which is deprecated Java Servlet API 2.4). If you are developing a controller, please avoid extending this. As there is no reason to use SingleThreadedModel in OpenClinica application and this would choke up the system resources when many simultaneous requests are made. 
  2. Base Controller as CoreSecureController–> In order to avoid the performance issues stated above with SecureController, we removed the SingleThreaded model and came up with this servlet controller for data entry module. This can be used as an alternative.
  3. The Spring MVC controller–> this would be the best way available in OpenClinica. The suggested approach to avoid all the problems stated above. You can look at rules framework to see the examples of existing approach. 

Similarly on the transaction management side, there are 2 broader approaches:

  1. Hibernate-spring transaction model
  2. JDBC/PSQL approach

All the legacy code is written in preparedStatements using JDBC. and 90% of the existing classes use this. For example, if you have to deal with any of the objects such as Study or CRF, it would be easier to use the existing beans. However, if you have a new set of tables and have a transaction model attached to it. use the Hibernate/Spring approach. There are already existing implementation for hibernate part of the code,

As you might be aware, we are extensively utilizing javascript libraries for implementing the printable forms module, and this is the preferred paradigm for future development.

Thanks and please do not hesitate to ask questions or seek guidance on the forum.

Setting up Your Development Environment

Here is some useful information on how to set-up a local OpenClinica development environment