Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Reporting Plugins
=================
Introduction
------------
A reporting plugin runs on the DSS. It creates a report as a table or an
URL for a specified set of data sets or key-value pairs. The user can
invoke a reporting plugin in the openBIS Web application. The result
will be shown as a table or a link.
A reporting plugin is one of the three following types. The differences
are the type of input and output:
- TABLE\_MODEL: *Input*: A set of data sets. *Output*: A table
- DSS\_LINK: *Input*: One data set. *Output*: An URL
- AGGREGATION\_TABLE\_MODEL: *Input*: A set of key-value pairs.
*Output*: A table
A reporting plugin is configured on the DSS best by introducing a [core
plugin](/display/openBISDoc2010/Core+Plugins) of type
`reporting-plugins`. All reporting plugins have the following properties
in common:
|Property Key|Description|
|--- |--- |
|class|The fully-qualified Java class name of the reporting plugin. The class has to implement IReportingPluginTask.|
|label|The label. It will be shown in the GUI.|
|dataset-types|Comma-separated list of regular expressions. The plugin can create a report only for the data sets of types matching one of the regular expressions. If new data set types are registered with openBIS, the DSS will need to be restarted before the new data set types are known to the processing plugins. This is a mandatory property for reporting plugins of type TABLE_MODEL and DSS_LINK. It will be ignored if the type is AGGREGATION_TABLE_MODEL.|
|properties-file|Path to an optional file with additional properties.|
|servlet.<property>|Properties for an optional servlet. It provides resources referred by URLs in the output of the reporting plugin.
This should be used if the servlet is only needed by this reporting plugin. If other plugins also need this servlet it should be configured as a core plugin of type services.|
|allowed-api-parameter-classes|A comma-separated list of regular expression for fully-qualified class names. Any classes matching on of the regular expressions is allowed as a class of a Java parameter object of a remote API call. For more details see API Security.|
|disallowed-api-parameter-classes|A comma-separated list of regular expression for fully-qualified class names. Any classes matching on of the regular expressions is not allowed as a class of a Java parameter object of a remote API call. For more details see API Security.|
Generic Reporting Plugins
-------------------------
### DecoratingTableModelReportingPlugin
**Type**: TABLE\_MODEL
**Description**: Modifies the output of a reporting plugin of type
TABLE\_MODEL
**Configuration**:
|Property Key|Description|
|--- |--- |
|reporting-plugin.class|The fully-qualified Java class name of the wrapped reporting plugin of type TABLE_MODEL|
|reporting-plugin.<property>|Property of the wrapped reporting plugin.|
|transformation.class|The fully-qualified Java class name of the transformation. It has to implement ITableModelTransformation.|
|transformation.<property>|Property of the transformation to be applied.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.DecoratingTableModelReportingPlugin
label = Analysis Summary
dataset-types = HCS_IMAGE_ANALYSIS_DATA
reporting-plugin.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.TSVViewReportingPlugin
reporting-plugin.separator = ,
transformation.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.EntityLinksDecorator
transformation.link-columns = BARCODE, GENE
transformation.BARCODE.entity-kind = SAMPLE
transformation.BARCODE.default-space = DEMO
transformation.GENE.entity-kind = MATERIAL
transformation.GENE.material-type = GENE
##### Transformations
###### EntityLinksDecorator
**Description**: Changes plain columns into entity links.
**Configuration**:
|Property Key|Description|
|--- |--- |
|link-columns|Comma-separated list of column keys.|
|<column key>.entity-kind|Entity kind of column <column key>. Possible values are MATERIAL and SAMPLE.|
|<column key>.default-space|Optional space code for SAMPLE columns. It will be used if the column value contains only the sample code.|
|<column key>.material-type|Mandatory type code for MATERIAL columns.|
### GenericDssLinkReportingPlugin
**Type**: DSS\_LINK
**Description**: Creates an URL for a file inside the data set.
**Configuration**:
|Property Key|Description|
|--- |--- |
|download-url|Base URL. Contains protocol, domain, and port.|
|data-set-regex|Optional regular expression which specifies the file.|
|data-set-path|Optional relative path in the data set to narrow down the search.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.GenericDssLinkReportingPlugin
label = Summary
dataset-types = MS_DATA
download-url = https://my.domain.org:8443
data-set-regex = summary.*
data-set-path = report
### AggregationService
```{warning}
**Import Note on Authorization**
In AggregationServices and IngestionServices, the service programmer needs to ensure proper authorization by himself. He can do so by using the methods from [IAuthorizationService](http://svnsis.ethz.ch/doc/openbis/current/ch/systemsx/cisd/openbis/dss/generic/shared/api/internal/authorization/IAuthorizationService.html). The user id, which is needed when calling these methods, can be obtained from `DataSetProcessingContext` (when using Java), or the variable `userId` (when using Jython).
```
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
**Type: **AGGREGATION\_TABLE\_MODEL
**Description**: An abstract superclass for aggregation service
reporting plugins. An aggregation service reporting plugin takes a hash
map containing user parameters as an argument and returns tabular data
(in the form of a TableModel). The
JythonBasedAggregationServiceReportingPlugin below is a subclass that
allows for implementation of the logic in Jython.
**Configuration**: Dependent on the subclass.
To implement an aggregation service in Java, define a subclass
of `ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.AggregationService`.
This subclass must implement the method
TableModel createReport(Map<String, Object>, DataSetProcessingContext).
**Example**:
**ExampleAggregationServicePlugin**
package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
import java.io.File;
import java.util.Map;
import java.util.Properties;
import ch.systemsx.cisd.openbis.dss.generic.shared.DataSetProcessingContext;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.util.IRowBuilder;
import ch.systemsx.cisd.openbis.generic.shared.util.SimpleTableModelBuilder;
/**
* @author Chandrasekhar Ramakrishnan
*/
public class ExampleAggregationServicePlugin extends AggregationService
{
private static final long serialVersionUID = 1L;
/**
* Create a new plugin.
*
* @param properties
* @param storeRoot
*/
public ExampleAggregationServicePlugin(Properties properties, File storeRoot)
{
super(properties, storeRoot);
}
@Override
public TableModel createReport(Map<String, Object> parameters, DataSetProcessingContext context)
{
SimpleTableModelBuilder builder = new SimpleTableModelBuilder(true);
builder.addHeader("String");
builder.addHeader("Integer");
IRowBuilder row = builder.addRow();
row.setCell("String", "Hello");
row.setCell("Integer", 20);
row = builder.addRow();
row.setCell("String", parameters.get("name").toString());
row.setCell("Integer", 30);
return builder.getTableModel();
}
}
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.ExampleAggregationServicePlugin
label = My Report
#### JythonAggregationService
**Type:** AGGREGATION\_TABLE\_MODEL
**Description**: Invokes a Jython script to create an aggregation
service report. For more details see [Jython-based Reporting and
Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonAggregationService
label = My Report
script-path = script.py
### IngestionService
**Type: **AGGREGATION\_TABLE\_MODEL
**Description**: An abstract superclass for aggregation service
reporting plugins that modify entities in the database. A db-modifying
aggregation service reporting plugin takes a hash map containing user
parameters and a transaction as arguments and returns tabular data (in
the form of a TableModel). The transaction is an
[IDataSetRegistrationTransactionV2](http://svnsis.ethz.ch/doc/openbis/current/ch/systemsx/cisd/etlserver/registrator/api/v2/IDataSetRegistrationTransactionV2.html),
the same interface that is used by
[dropboxes](/display/openBISDoc2010/Dropboxes) to register and modify
entities. The JythonBasedDbModifyingAggregationServiceReportingPlugin
below is a subclass that allows for implementation of the logic in
Jython.
**Configuration**: Dependent on the subclass.
To implement an aggregation service in Java, define a subclass
of `ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.IngestionService`.
This subclass must implement the method
TableModel process(IDataSetRegistrationTransactionV2 transaction, Map<String, Object> parameters, DataSetProcessingContext context)
**Example**:
**ExampleDbModifyingAggregationService.java**
package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
import java.io.File;
import java.util.Map;
import java.util.Properties;
import ch.systemsx.cisd.etlserver.registrator.api.v2.IDataSetRegistrationTransactionV2;
import ch.systemsx.cisd.openbis.dss.generic.shared.DataSetProcessingContext;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.util.IRowBuilder;
import ch.systemsx.cisd.openbis.generic.shared.util.SimpleTableModelBuilder;
/**
* An example aggregation service
*
* @author Chandrasekhar Ramakrishnan
*/
public class ExampleDbModifyingAggregationService extends IngestionService<DataSetInformation>
{
private static final long serialVersionUID = 1L;
/**
* @param properties
* @param storeRoot
*/
public ExampleDbModifyingAggregationService(Properties properties, File storeRoot)
{
super(properties, storeRoot);
}
@Override
public TableModel process(IDataSetRegistrationTransactionV2 transaction,
Map<String, Object> parameters, DataSetProcessingContext context)
{
transaction.createNewSpace("NewDummySpace", null);
SimpleTableModelBuilder builder = new SimpleTableModelBuilder(true);
builder.addHeader("String");
builder.addHeader("Integer");
IRowBuilder row = builder.addRow();
row.setCell("String", "Hello");
row.setCell("Integer", 20);
row = builder.addRow();
row.setCell("String", parameters.get("name").toString());
row.setCell("Integer", 30);
return builder.getTableModel();
}
}
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.ExampleDbModifyingAggregationService
label = My Report
#### JythonIngestionService
**Type: **AGGREGATION\_TABLE\_MODEL
**Description**: Invokes a Jython script to register and modify entities
and create an aggregation service report. The script receives a
transaction as an argument. For more details see [Jython-based Reporting
and Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
|share-id|Optional, defaults to 1 when not stated otherwise.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonIngestionService
label = My Report
script-path = script.py
### JythonBasedReportingPlugin
**Type:** TABLE\_MODEL**
**
**Description**: Invokes a Jython script to create the report. For more
details see [Jython-based Reporting and Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonBasedReportingPlugin
label = My Report
dataset-types = MS_DATA, UNKNOWN
script-path = script.py
### TSVViewReportingPlugin
**Type:** TABLE\_MODEL**
**
**Description**: Presents the main data set file as a table. The main
file is specified by the Main Data Set Pattern and the Main Data Set
Path of the data set type. The file can be a CSV/TSV file or an Excel
file. This reporting plugin works only for one data set.
**Configuration**:
|Property Key|Description|
|--- |--- |
|separator|Separator character. This property will be ignored if the file is an Excel file. Default: TAB character|
|ignore-comments|If true all rows starting with '#' will be ignored. Default: true|
|ignore-trailing-empty-cells|If true trailing empty cells will be ignored. Default: false|
|excel-sheet|Name or index of the Excel sheet used. This property will only be used if the file is an Excel file. Default: 0|
|transpose|If true transpose the original table, that is exchange rows with columns. Default: false|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.TSVViewReportingPlugin
label = My Report
dataset-types = MS_DATA, UNKNOWN
separator = ;
Screening Reporting Plugins
---------------------------
### ScreeningJythonBasedAggregationServiceReportingPlugin
**Type:** AGGREGATION\_TABLE\_MODEL**
**
**Description**: Invokes a Jython script to create an aggregation
service report. For more details see [Jython-based Reporting and
Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
There is some extra support for screening.
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.screening.server.plugins.jython.ScreeningJythonBasedReportingPlugin
label = My Report
dataset-types = HCS_IMAGE
script-path = script.py
### ScreeningJythonBasedDbModifyingAggregationServiceReportingPlugin
**Type: **AGGREGATION\_TABLE\_MODEL**
**
**Description**: Invokes a Jython script to register and modify entities
and create an aggregation service report. The screening-specific version
has access to the screening facade for queries to the imaging database
and is given a screening transaction that supports registering plate
images and feature vectors. For more details see [Jython-based Reporting
and Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.screening.server.plugins.jython.ScreeningJythonBasedReportingPlugin
label = My Report
dataset-types = HCS_IMAGE
script-path = script.py
### ScreeningJythonBasedReportingPlugin
**Type:** TABLE\_MODEL**
**
**Description**: Invokes a Jython script to create the report. For more
details see [Jython-based Reporting and Processing
Plugins](/display/openBISDoc2010/Jython-based+Reporting+and+Processing+Plugins).
There is some extra support for screening.
**Configuration**:
|Property Key|Description|
|--- |--- |
|script-path|Path to the jython script.|
**Example**:
**plugin.properties**
class = ch.systemsx.cisd.openbis.dss.screening.server.plugins.jython.ScreeningJythonBasedAggregationServiceReportingPlugin
label = My Report