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.
There are 2(3) kinds of controllers used all across the OpenClinica application
- 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.
- 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.
- 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:
- Hibernate-spring transaction model
- 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,
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