User Tools

Site Tools


Installing a Webapp in OpenBIS STAGE

(1) Download the simple example from

(2) Unzip it in the core plugins folder:

# ~/stage/openBIS/servers/core-plugins> unzip 

(3) Enable the new core plugin by editing the core-plugins.propeties file:

# ~/stage/openBIS/servers/core-plugins> vi  

Once edited this file has the following content:

enabled-modules = screening, service-demo

#disabled-core-plugins = screening:
disabled-core-plugins = screening:data-sources, screening:drop-boxes, screening:image-overview-plugins, screening:maintenance-tasks, screening:services, screening:dss-data-sources

(4) Restart openBIS:

#  ~/stage/openBIS/servers/openBIS-server/jetty/logs> 
Stopping Data Store Server (not running - nothing to do)
Shutting openBIS down...
#  ~/stage/openBIS/servers/openBIS-server/jetty/logs> 
Starting openBIS...
Starting Data Store Server (pid 5918)

Info: During openBIS start, two new symlinks are created in the jetty webapp directory pointing to the two new installed wepapps from the “service-demo” example:

#  ~/stage/openBIS/servers/openBIS-server/jetty/webapps/openbis/webapp> ls -al
total 16
drwxr-xr-x 2 mx_nas mx-servers 4096 Oct  2 12:28 .
drwxr-xr-x 9 mx_nas mx-servers 4096 Aug 20 17:41 ..
lrwxrwxrwx 1 mx_nas mx-servers  118 Oct  2 12:28 aggregation -> /home/openbis/stage/openBIS/servers/openBIS-server/jetty/../../core-plugins/service-demo/1/as/webapps/aggregation/html
lrwxrwxrwx 1 mx_nas mx-servers  116 Oct  2 12:28 ingestion -> /home/openbis/stage/openBIS/servers/openBIS-server/jetty/../../core-plugins/service-demo/1/as/webapps/ingestion/html

(5) Adapt webapp.js:

#  ~/stage/openBIS/servers/core-plugins/service-demo/1/as/webapps/aggregation/html> vi webapp.js
#  ~/stage/openBIS/servers/core-plugins/service-demo/1/as/webapps/ingestion/html> vi webapp.js

What to adapt:

  • The openBIS server we use for our data.

In our case the hostname is

openbisServer = new openbis('', '');
  • The DSS (data source) to contact.

To find out what the code of the data source is, either have a look at the of the data store server, (key: data-store-server-code = DSS1), or have a look at the openbis DB calling <openBIS_DB>=# select code from data_stores;
In our case tha value is dss-screening:

openbisServer.createReportFromAggregationService("dss-screening", "example-aggregation-service", parameters, displayReturnedTable);

(6) For the ingestion service, adapt the script which registers a new sample into openBIS:

#  ~/stage/openBIS/servers/core-plugins/service-demo/1/dss/reporting-plugins/example-ingestion-service> vi

It is necessary to set an existing experiment and sample type.
In our case we set as experiment /BEE/VACCINIA_TEAM/VACCINIA-DU-K1 and as sample type CONTROL_WELL:

  sampleId = "/BEE/" + sampleCode
  sample = tr.createNewSample(sampleId, "CONTROL_WELL")
  exp = tr.getExperiment("/BEE/VACCINIA_TEAM/VACCINIA-DU-K1")

(7) The wepapps can be accessed at the URLs:

Calling external libraries from Jython script

1. The lib should go into folder where the Jython script resides. Simply create a lib folder and put all jars inside.
Here is an example:

# ~/openbis_example_wepapp/servers/core-plugins/appExample/1/dss/reporting-plugins/apiExample> ll lib/

total 17104
drwxr-xr-x  7 kohleman  staff      238 Oct  9 17:23 ./
drwxr-xr-x  6 kohleman  staff      204 Oct  9 17:25 ../
-rw-r--r--@ 1 kohleman  staff   168586 Sep 27 14:34 cisd-hcscld.jar
-rw-r--r--@ 1 kohleman  staff  1252347 Sep 27 14:34 cisd-jhdf5-core.jar
-rw-r--r--@ 1 kohleman  staff  2852257 Sep 27 14:34 hdf5-linux-intel.jar
-rw-r--r--@ 1 kohleman  staff  2652865 Sep 27 14:34 hdf5-macosx-intel.jar
-rw-r--r--@ 1 kohleman  staff  1821318 Sep 27 14:34 hdf5-windows-intel.jar

2. Then restart openBIS. This creates links in the dss/lib folder to those jars. For old version, this doesn't happen and the jars should be copied there directly.

3. In the jython script use the import command, for example:

from ch.ethz.sis.hcscld import CellLevelDataset

The * star does not work, you have to import each class separately.

4. And that is it! Use Java from Jython as in any other case.

beewm/devel/webapp_and_aggregation_service.txt · Last modified: 2013/10/15 18:13 by