From 24249691384092c34fbaacae0c634f80b6fb40b8 Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Mon, 30 Nov 2009 10:12:30 +0000
Subject: [PATCH] LMS-1275 empty screening plugin

SVN: 13599
---
 .../OpenBIS-without-entry-point.gwt.xml       |   5 +
 .../DefaultClientPluginFactoryProvider.java   |   1 +
 .../server/dataaccess/db/DAOUtils.java        |   2 +-
 .../web/client/IScreeningClientService.java   |  54 +++++
 .../client/IScreeningClientServiceAsync.java  |  50 +++++
 .../client/web/client/ScreeningConstants.java |  27 +++
 .../application/ClientPluginFactory.java      | 207 ++++++++++++++++++
 .../client/web/client/application/Dict.java   |  35 +++
 .../application/ScreeningSampleViewer.java    | 106 +++++++++
 .../application/ScreeningViewContext.java     |  36 +++
 .../client/web/public/screening-dictionary.js |  23 ++
 .../web/server/ScreeningClientService.java    | 114 ++++++++++
 .../server/ScreeningClientServiceServlet.java |  53 +++++
 .../IScreeningBusinessObjectFactory.java      |  35 +++
 .../ScreeningBusinessObjectFactory.java       |  45 ++++
 .../server/ScreeningSampleServerPlugin.java   |  69 ++++++
 .../screening/server/ScreeningServer.java     | 120 ++++++++++
 .../server/ScreeningServerLogger.java         |  69 ++++++
 .../screening/shared/IScreeningServer.java    |  38 ++++
 .../screening/shared/ResourceNames.java       |  44 ++++
 20 files changed, 1132 insertions(+), 1 deletion(-)
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/ScreeningConstants.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningSampleViewer.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/IScreeningBusinessObjectFactory.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningBusinessObjectFactory.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningSampleServerPlugin.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/OpenBIS-without-entry-point.gwt.xml b/openbis/source/java/ch/systemsx/cisd/openbis/OpenBIS-without-entry-point.gwt.xml
index 3c1ed9400f3..45b0ff9dcde 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/OpenBIS-without-entry-point.gwt.xml
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/OpenBIS-without-entry-point.gwt.xml
@@ -36,6 +36,11 @@
     <script src="generic-dictionary.js"/>
     <public path="plugin/generic/client/web/public"/>
     <source path="plugin/generic/client/web/client"/>
+
+    <!-- Screening plugin -->
+    <script src="screening-dictionary.js"/>
+    <public path="plugin/screening/client/web/public"/>
+    <source path="plugin/screening/client/web/client"/>
     <!-- Automatically generated part - END -->
 
   <!-- Do not define servlets here, use web.xml -->
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/DefaultClientPluginFactoryProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/DefaultClientPluginFactoryProvider.java
index 9f7a5ac9628..b403bd3e26f 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/DefaultClientPluginFactoryProvider.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/DefaultClientPluginFactoryProvider.java
@@ -52,6 +52,7 @@ public class DefaultClientPluginFactoryProvider implements IClientPluginFactoryP
     {
         // Automatically generated part - START
         registerPluginFactory(new ch.systemsx.cisd.openbis.plugin.demo.client.web.client.application.ClientPluginFactory(originalViewContext));
+        registerPluginFactory(new ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ClientPluginFactory(originalViewContext));
         // Automatically generated part - END
     }
 
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOUtils.java
index 9250477d8e2..190fa365b65 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOUtils.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOUtils.java
@@ -35,7 +35,7 @@ final class DAOUtils
     /**
      * Don't try to get properties for more than 10000 entities.
      */
-    final static int MAX_COUNT_FOR_PROPERTIES = 10000;
+    final static int MAX_COUNT_FOR_PROPERTIES = 20000;
 
     /**
      * Returns the number of entities that the given <var>critera</var> will return.
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java
new file mode 100644
index 00000000000..b8ddd7ac240
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client;
+
+import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService;
+import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+
+/**
+ * Service interface for the <i>screening</i> <i>GWT</i> client.
+ * <p>
+ * Each method should throw {@link UserFailureException}. The authorisation framework can throw it
+ * when the user has insufficient privileges. If it is not marked, the GWT client will report
+ * unexpected exception.
+ * </p>
+ * 
+ * @author Tomasz Pylak
+ */
+public interface IScreeningClientService extends IClientService
+{
+
+    /**
+     * For given {@link TechId} returns corresponding {@link SampleParentWithDerived}.
+     */
+    public SampleParentWithDerived getSampleGenerationInfo(final TechId sampleId, String baseIndexURL)
+            throws UserFailureException;
+
+    /**
+     * Registers a new sample.
+     */
+    public void registerSample(final String sessionKey, final NewSample sample)
+            throws UserFailureException;
+
+    /**
+     * Get number of experiments.
+     */
+    public int getNumberOfExperiments() throws UserFailureException;
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java
new file mode 100644
index 00000000000..5eabf04699f
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync;
+import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+
+/**
+ * Service interface for the <i>screening</i> <i>GWT</i> client.
+ * 
+ * @author Christian Ribeaud
+ */
+public interface IScreeningClientServiceAsync extends IClientServiceAsync
+{
+
+    /** @see IScreeningClientService#getSampleGenerationInfo(TechId, String) */
+    public void getSampleGenerationInfo(final TechId sampleId, String baseIndexUrl,
+            final AsyncCallback<SampleParentWithDerived> callback);
+
+    /**
+     * @see IScreeningClientService#registerSample(String, NewSample)
+     */
+    public void registerSample(final String sessionKey, final NewSample sample,
+            final AsyncCallback<Void> asyncCallback) throws UserFailureException;
+
+    /**
+     * @see IScreeningClientService#getNumberOfExperiments()
+     */
+    public void getNumberOfExperiments(final AsyncCallback<Integer> asyncCallback)
+            throws UserFailureException;
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/ScreeningConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/ScreeningConstants.java
new file mode 100644
index 00000000000..49224c41d90
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/ScreeningConstants.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client;
+
+/**
+ * @author Tomasz Pylak
+ */
+public class ScreeningConstants
+{
+    public static final String PLATE_PLUGIN_TYPE_CODE = "PLATExxxxxxxxxxxxx";
+
+    public static final String WELL_PLUGIN_TYPE_CODE = "WELLxxxxxxxxxxxxx";
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
new file mode 100644
index 00000000000..3e5459ea16b
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import com.extjs.gxt.ui.client.widget.Component;
+import com.google.gwt.user.client.ui.Widget;
+
+import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareWidget;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DummyComponent;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItemFactory;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.ClientPluginAdapter;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPluginFactory;
+import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifiable;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType;
+import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.GenericViewContext;
+import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleRegistrationForm;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.ScreeningConstants;
+
+/**
+ * {@link IClientPluginFactory} implementation for <i>screening</i> plugin.
+ * <p>
+ * Currently, this implementation only runs for a sample of type SampleTypeCode#CELL_PLATE.
+ * </p>
+ * 
+ * @author Tomasz Pylak
+ */
+public final class ClientPluginFactory extends
+        AbstractClientPluginFactory<IScreeningClientServiceAsync>
+{
+
+    public ClientPluginFactory(final IViewContext<ICommonClientServiceAsync> originalViewContext)
+    {
+        super(originalViewContext);
+    }
+
+    //
+    // AbstractClientPluginFactory
+    //
+
+    @Override
+    protected final IViewContext<IScreeningClientServiceAsync> createViewContext(
+            final IViewContext<ICommonClientServiceAsync> originalViewContext)
+    {
+        return new ScreeningViewContext(originalViewContext);
+    }
+
+    //
+    // IClientPluginFactory
+    //
+
+    public final Set<String> getEntityTypeCodes(final EntityKind entityKind)
+    {
+        if (entityKind == EntityKind.SAMPLE)
+        {
+            Set<String> types = new HashSet<String>();
+            types.add(ScreeningConstants.PLATE_PLUGIN_TYPE_CODE);
+            types.add(ScreeningConstants.WELL_PLUGIN_TYPE_CODE);
+            return types;
+        }
+        return Collections.emptySet();
+    }
+
+    @SuppressWarnings("unchecked")
+    public <T extends EntityType, I extends IIdentifiable> IClientPlugin<T, I> createClientPlugin(
+            final EntityKind entityKind)
+    {
+        if (EntityKind.EXPERIMENT.equals(entityKind))
+        {
+            return (IClientPlugin<T, I>) new ExperimentClientPlugin();
+        }
+        if (EntityKind.SAMPLE.equals(entityKind))
+        {
+            return (IClientPlugin<T, I>) new SampleClientPlugin();
+        }
+        throw new UnsupportedOperationException("IClientPlugin for entity kind '" + entityKind
+                + "' not implemented yet.");
+    }
+
+    //
+    // Helper classes
+    //
+
+    private final class SampleClientPlugin implements IClientPlugin<SampleType, IIdentifiable>
+    {
+        //
+        // IViewClientPlugin
+        //
+
+        public final ITabItemFactory createEntityViewer(final IIdentifiable identifiable)
+        {
+            final TechId sampleId = TechId.create(identifiable);
+            return new ITabItemFactory()
+                {
+                    public ITabItem create()
+                    {
+                        final ScreeningSampleViewer sampleViewer =
+                                new ScreeningSampleViewer(getViewContext(), sampleId);
+                        return DefaultTabItem.createUnaware(identifiable.getCode(), sampleViewer,
+                                false);
+                    }
+
+                    public String getId()
+                    {
+                        return ScreeningSampleViewer.createId(sampleId);
+                    }
+                };
+        }
+
+        public final DatabaseModificationAwareWidget createRegistrationForEntityType(
+                final SampleType sampleType)
+        {
+            GenericSampleRegistrationForm form =
+                    new GenericSampleRegistrationForm(new GenericViewContext(getViewContext()
+                            .getCommonViewContext()), sampleType);
+            return new DatabaseModificationAwareWidget(form, form);
+        }
+
+        public final Widget createBatchRegistrationForEntityType(final SampleType sampleType)
+        {
+            return new DummyComponent();
+        }
+
+        public ITabItemFactory createEntityEditor(final IIdentifiable identifiable)
+        {
+            return new ITabItemFactory()
+                {
+                    public ITabItem create()
+                    {
+                        return createDummyTab(identifiable.getCode());
+                    }
+
+                    public String getId()
+                    {
+                        return DummyComponent.ID;
+                    }
+                };
+        }
+
+    }
+
+    private final static class ExperimentClientPlugin extends
+            ClientPluginAdapter<ExperimentType, IIdentifiable>
+    {
+
+        //
+        // IViewClientPlugin
+        //
+
+        @Override
+        public final ITabItemFactory createEntityViewer(final IIdentifiable identifiable)
+        {
+            return new ITabItemFactory()
+                {
+                    public ITabItem create()
+                    {
+                        return createDummyTab(identifiable.getCode());
+                    }
+
+                    public String getId()
+                    {
+                        return DummyComponent.ID;
+                    }
+                };
+        }
+    }
+
+    private static ITabItem createDummyTab(final String identifier)
+    {
+        Component component = new DummyComponent();
+        return DefaultTabItem.createUnaware(identifier, component, false);
+    }
+
+    // @Override
+    // public IModule tryGetModule()
+    // {
+    // return new ScreeningModule(getViewContext());
+    // }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
new file mode 100644
index 00000000000..45d15b22810
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application;
+
+/**
+ * An {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict} extension for
+ * <i>screening</i> specific message keys.
+ * 
+ * @author Tomasz Pylak
+ */
+public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict
+{
+    public static final String MODULE_MENU_TITLE = "module_menu_title";
+
+    public static final String STATISTICS_SCREENING_TAB_HEADER = "statistics_tab_header";
+
+    private Dict()
+    {
+        // Can not be instantiated.
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningSampleViewer.java
new file mode 100644
index 00000000000..dd985ceaf5a
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningSampleViewer.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application;
+
+import com.google.gwt.user.client.ui.Widget;
+
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractViewer;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
+import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleViewer;
+
+/**
+ * The <i>screening</i> sample viewer.
+ * 
+ * @author Tomasz Pylak
+ */
+public final class ScreeningSampleViewer extends AbstractViewer<IScreeningClientServiceAsync, Sample>
+{
+    private static final String PREFIX = "screening-sample-viewer_";
+
+    public static final String ID_PREFIX = GenericConstants.ID_PREFIX + PREFIX;
+
+    private final TechId sampleId;
+
+    public ScreeningSampleViewer(final IViewContext<IScreeningClientServiceAsync> viewContext,
+            final TechId sampleId)
+    {
+        super(viewContext, createId(sampleId));
+        this.sampleId = sampleId;
+        reloadData();
+    }
+
+    public static final String createId(final TechId sampleId)
+    {
+        return ID_PREFIX + sampleId;
+    }
+
+    private final Widget createUI(final SampleParentWithDerived sampleGeneration)
+    {
+        return GenericSampleViewer.createPropertyGrid(sampleId, sampleGeneration, viewContext);
+    }
+
+    /**
+     * Load the sample information.
+     */
+    protected void reloadData()
+    {
+        SampleInfoCallback callback = new SampleInfoCallback(viewContext, this);
+        viewContext.getService().getSampleGenerationInfo(sampleId, getBaseIndexURL(), callback);
+    }
+
+    //
+    // Helper classes
+    //
+
+    private final class SampleInfoCallback extends AbstractAsyncCallback<SampleParentWithDerived>
+    {
+        private final ScreeningSampleViewer sampleViewer;
+
+        private SampleInfoCallback(final IViewContext<IScreeningClientServiceAsync> viewContext,
+                ScreeningSampleViewer sampleViewer)
+        {
+            super(viewContext);
+            this.sampleViewer = sampleViewer;
+        }
+
+        //
+        // AbstractAsyncCallback
+        //
+
+        /**
+         * Sets the {@link SampleParentWithDerived} for this <var>generic</var> sample viewer.
+         * <p>
+         * This method triggers the whole <i>GUI</i> construction.
+         * </p>
+         */
+        @Override
+        protected final void process(final SampleParentWithDerived result)
+        {
+            sampleViewer.updateOriginalData(result.getParent());
+            sampleViewer.removeAll();
+            sampleViewer.add(sampleViewer.createUI(result));
+            sampleViewer.layout();
+        }
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java
new file mode 100644
index 00000000000..67c4929605d
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java
@@ -0,0 +1,36 @@
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application;
+
+import com.google.gwt.core.client.GWT;
+
+import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractPluginViewContext;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
+
+/**
+ * The <i>screening</i> plugin specific {@link IViewContext} implementation.
+ * 
+ * @author Tomasz Pylak
+ */
+public final class ScreeningViewContext extends AbstractPluginViewContext<IScreeningClientServiceAsync>
+{
+    private static final String TECHNOLOGY_NAME = "screening";
+
+    public ScreeningViewContext(final IViewContext<ICommonClientServiceAsync> commonViewContext)
+    {
+        super(commonViewContext);
+    }
+
+    @Override
+    protected String getTechnology()
+    {
+        return TECHNOLOGY_NAME;
+    }
+
+    @Override
+    protected IScreeningClientServiceAsync createClientServiceAsync()
+    {
+        return GWT.create(IScreeningClientService.class);
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
new file mode 100644
index 00000000000..4adf3212701
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
@@ -0,0 +1,23 @@
+// screening dictionary
+var screening = {
+
+	//
+	// Module
+	//
+	
+	STATISTICS: "Statistics",
+		
+	module_menu_title: "Screening",
+	statistics_tab_header: "Statistics",
+
+  //
+  // Sample Viewer
+  //
+  
+  sample: "Sample",
+  sample_type: "Sample Type",
+  generated_samples: "Children Samples",
+  
+  // LAST LINE: KEEP IT AT THE END
+  lastline: "" // we need a line without a comma
+};
\ No newline at end of file
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java
new file mode 100644
index 00000000000..31e226aed28
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.server;
+
+import java.util.Collection;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Component;
+
+import ch.rinn.restrictions.Private;
+import ch.systemsx.cisd.common.servlet.IRequestContextProvider;
+import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException;
+import ch.systemsx.cisd.openbis.generic.client.web.server.AbstractClientService;
+import ch.systemsx.cisd.openbis.generic.client.web.server.AttachmentRegistrationHelper;
+import ch.systemsx.cisd.openbis.generic.client.web.server.translator.UserFailureExceptionTranslator;
+import ch.systemsx.cisd.openbis.generic.shared.IServer;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewAttachment;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
+
+/**
+ * The {@link IScreeningClientService} implementation.
+ * 
+ * @author Tomasz Pylak
+ */
+@Component(value = ResourceNames.SCREENING_PLUGIN_SERVICE)
+public final class ScreeningClientService extends AbstractClientService implements
+        IScreeningClientService
+{
+
+    @Resource(name = ResourceNames.SCREENING_PLUGIN_SERVER)
+    private IScreeningServer server;
+
+    public ScreeningClientService()
+    {
+    }
+
+    @Private
+    ScreeningClientService(final IScreeningServer server,
+            final IRequestContextProvider requestContextProvider)
+    {
+        super(requestContextProvider);
+        this.server = server;
+    }
+
+    //
+    // AbstractClientService
+    //
+
+    @Override
+    protected final IServer getServer()
+    {
+        return server;
+    }
+
+    //
+    // IScreeningClientService
+    //
+
+    public final SampleParentWithDerived getSampleGenerationInfo(final TechId sampleId,
+            String baseIndexURL) throws UserFailureException
+    {
+        try
+        {
+            final String sessionToken = getSessionToken();
+            final SampleParentWithDerived sampleGenerationDTO =
+                    server.getSampleInfo(sessionToken, sampleId);
+            return sampleGenerationDTO;
+        } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e)
+        {
+            throw UserFailureExceptionTranslator.translate(e);
+        }
+    }
+
+    public final void registerSample(final String sessionKey, final NewSample sample)
+            throws UserFailureException
+    {
+
+        final String sessionToken = getSessionToken();
+        new AttachmentRegistrationHelper()
+            {
+                @Override
+                public void register(Collection<NewAttachment> attachments)
+                {
+                    server.registerSample(sessionToken, sample, attachments);
+                }
+            }.process(sessionKey, getHttpSession(), sample.getAttachments());
+    }
+
+    public int getNumberOfExperiments() throws UserFailureException
+    {
+        final String sessionToken = getSessionToken();
+        return server.getNumberOfExperiments(sessionToken);
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java
new file mode 100644
index 00000000000..a4b01ba5e64
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.client.web.server;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import ch.systemsx.cisd.common.servlet.GWTRPCServiceExporter;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
+
+/**
+ * The {@link GWTRPCServiceExporter} for the <i>screening</i> service.
+ * 
+ * @author Christian Ribeaud
+ */
+@Controller
+@RequestMapping(
+    { "/screening", "/openbis/screening" })
+public final class ScreeningClientServiceServlet extends GWTRPCServiceExporter
+{
+    private static final long serialVersionUID = 1L;
+
+    @Resource(name = ResourceNames.SCREENING_PLUGIN_SERVICE)
+    private IScreeningClientService service;
+
+    //
+    // GWTRPCServiceExporter
+    //
+
+    @Override
+    protected final Object getService()
+    {
+        return service;
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/IScreeningBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/IScreeningBusinessObjectFactory.java
new file mode 100644
index 00000000000..a893b78c125
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/IScreeningBusinessObjectFactory.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.server;
+
+import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO;
+import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
+
+/**
+ * A <i>screening</i> plugin specific business object factory.
+ * 
+ * @author Tomasz Pylak
+ */
+public interface IScreeningBusinessObjectFactory
+{
+
+    /**
+     * Creates a {@link ISampleBO} <i>Business Object</i>.
+     */
+    public ISampleBO createSampleBO(final Session session);
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningBusinessObjectFactory.java
new file mode 100644
index 00000000000..289b83d0b8c
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningBusinessObjectFactory.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.server;
+
+import org.springframework.stereotype.Component;
+
+import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO;
+import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
+import ch.systemsx.cisd.openbis.plugin.AbstractPluginBusinessObjectFactory;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
+
+/**
+ * The unique {@link IScreeningBusinessObjectFactory} implementation.
+ * 
+ * @author Tomasz Pylak
+ */
+@Component(ResourceNames.SCREENING_BUSINESS_OBJECT_FACTORY)
+public final class ScreeningBusinessObjectFactory extends AbstractPluginBusinessObjectFactory
+        implements IScreeningBusinessObjectFactory
+{
+
+    //
+    // IGenericBusinessObjectFactory
+    //
+
+    public final ISampleBO createSampleBO(final Session session)
+    {
+        return getCommonBusinessObjectFactory().createSampleBO(session);
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningSampleServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningSampleServerPlugin.java
new file mode 100644
index 00000000000..435dc01ec07
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningSampleServerPlugin.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.server;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.springframework.stereotype.Component;
+
+import ch.systemsx.cisd.openbis.generic.server.plugin.ISampleServerPlugin;
+import ch.systemsx.cisd.openbis.generic.server.plugin.ISampleTypeSlaveServerPlugin;
+import ch.systemsx.cisd.openbis.generic.server.plugin.SampleServerPluginRegistry;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind;
+import ch.systemsx.cisd.openbis.plugin.AbstractSampleServerPlugin;
+import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.ScreeningConstants;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
+
+/**
+ * The {@link ISampleServerPlugin} implementation for plates and wells.
+ * <p>
+ * This class is annotated with {@link Component} so that it automatically gets registered to
+ * {@link SampleServerPluginRegistry} by <i>Spring</i>.
+ * </p>
+ * 
+ * @author Tomasz Pylak
+ */
+@Component(ResourceNames.SCREENING_SAMPLE_SERVER_PLUGIN)
+public final class ScreeningSampleServerPlugin extends AbstractSampleServerPlugin
+{
+    private ScreeningSampleServerPlugin()
+    {
+    }
+
+    //
+    // ISampleServerPlugin
+    //
+
+    public final Set<String> getEntityTypeCodes(final EntityKind entityKind)
+    {
+        if (entityKind == EntityKind.SAMPLE)
+        {
+            Set<String> types = new HashSet<String>();
+            types.add(ScreeningConstants.PLATE_PLUGIN_TYPE_CODE);
+            types.add(ScreeningConstants.WELL_PLUGIN_TYPE_CODE);
+            return types;
+        }
+        return Collections.emptySet();
+    }
+
+    public final ISampleTypeSlaveServerPlugin getSlaveServer()
+    {
+        return getGenericSampleTypeSlaveServerPlugin();
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java
new file mode 100644
index 00000000000..d5062c94bc0
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.server;
+
+import java.util.Collection;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Component;
+
+import ch.rinn.restrictions.Private;
+import ch.systemsx.cisd.authentication.ISessionManager;
+import ch.systemsx.cisd.common.exceptions.NotImplementedException;
+import ch.systemsx.cisd.openbis.generic.server.AbstractServer;
+import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO;
+import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory;
+import ch.systemsx.cisd.openbis.generic.server.plugin.IDataSetTypeSlaveServerPlugin;
+import ch.systemsx.cisd.openbis.generic.server.plugin.ISampleTypeSlaveServerPlugin;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewAttachment;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
+import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
+import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier;
+import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTranslator;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
+
+/**
+ * The concrete {@link IScreeningServer} implementation.
+ * 
+ * @author Tomasz Pylak
+ */
+@Component(ResourceNames.SCREENING_PLUGIN_SERVER)
+public final class ScreeningServer extends AbstractServer<IScreeningServer> implements
+        IScreeningServer
+{
+    @Resource(name = ResourceNames.SCREENING_BUSINESS_OBJECT_FACTORY)
+    private IScreeningBusinessObjectFactory businessObjectFactory;
+
+    public ScreeningServer()
+    {
+    }
+
+    @Private
+    ScreeningServer(final ISessionManager<Session> sessionManager, final IDAOFactory daoFactory,
+            final IScreeningBusinessObjectFactory businessObjectFactory,
+            final ISampleTypeSlaveServerPlugin sampleTypeSlaveServerPlugin,
+            final IDataSetTypeSlaveServerPlugin dataSetTypeSlaveServerPlugin)
+    {
+        super(sessionManager, daoFactory, sampleTypeSlaveServerPlugin, dataSetTypeSlaveServerPlugin);
+        this.businessObjectFactory = businessObjectFactory;
+    }
+
+    //
+    // IInvocationLoggerFactory
+    //
+
+    /**
+     * Creates a logger used to log invocations of objects of this class.
+     */
+    public final IScreeningServer createLogger(final boolean invocationSuccessful,
+            final long elapsedTime)
+    {
+        return new ScreeningServerLogger(getSessionManager(), invocationSuccessful, elapsedTime);
+    }
+
+    //
+    // IScreeningServer
+    //
+
+    public final SampleParentWithDerived getSampleInfo(final String sessionToken,
+            final SampleIdentifier identifier)
+    {
+        final Session session = getSession(sessionToken);
+        final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session);
+        sampleBO.loadBySampleIdentifier(identifier);
+        final SamplePE sample = sampleBO.getSample();
+        return SampleTranslator.translate(getSampleTypeSlaveServerPlugin(sample.getSampleType())
+                .getSampleInfo(session, sample), session.getBaseIndexURL());
+    }
+
+    public final SampleParentWithDerived getSampleInfo(final String sessionToken,
+            final TechId sampleId)
+    {
+        final Session session = getSession(sessionToken);
+        final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session);
+        sampleBO.loadDataByTechId(sampleId);
+        final SamplePE sample = sampleBO.getSample();
+        return SampleTranslator.translate(getSampleTypeSlaveServerPlugin(sample.getSampleType())
+                .getSampleInfo(session, sample), session.getBaseIndexURL());
+    }
+
+    public final void registerSample(final String sessionToken, final NewSample newSample,
+            final Collection<NewAttachment> attachments)
+    {
+        throw new NotImplementedException();
+    }
+
+    public int getNumberOfExperiments(String sessionToken)
+    {
+        return getDAOFactory().getExperimentDAO().listExperiments().size();
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java
new file mode 100644
index 00000000000..c1ab1a06710
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.server;
+
+import java.util.Collection;
+
+import ch.systemsx.cisd.authentication.ISessionManager;
+import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewAttachment;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
+import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
+import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier;
+import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer;
+
+/**
+ * The <i>screening</i> specific {@link AbstractServerLogger} extension.
+ * 
+ * @author Tomasz Pylak
+ */
+final class ScreeningServerLogger extends AbstractServerLogger implements IScreeningServer
+{
+    ScreeningServerLogger(final ISessionManager<Session> sessionManager,
+            final boolean invocationSuccessful, final long elapsedTime)
+    {
+        super(sessionManager, invocationSuccessful, elapsedTime);
+    }
+
+    public final SampleParentWithDerived getSampleInfo(final String sessionToken,
+            final SampleIdentifier identifier)
+    {
+        logAccess(sessionToken, "get_sample_info", "CODE(%s)", identifier);
+        return null;
+    }
+
+    public final SampleParentWithDerived getSampleInfo(final String sessionToken, final TechId sampleId)
+    {
+        logAccess(sessionToken, "get_sample_info", "ID(%s)", sampleId);
+        return null;
+    }
+
+    public void registerSample(final String sessionToken, final NewSample newSample,
+            final Collection<NewAttachment> attachments)
+    {
+        logTracking(sessionToken, "register_sample", "SAMPLE_TYPE(%s) SAMPLE(%s) ATTACHMENTS(%s)",
+                newSample.getSampleType(), newSample.getIdentifier(), attachments.size());
+    }
+
+    public int getNumberOfExperiments(String sessionToken)
+    {
+        logTracking(sessionToken, "get_number_of_experiments", "");
+        return 0;
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java
new file mode 100644
index 00000000000..baba43f4921
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.shared;
+
+import org.springframework.transaction.annotation.Transactional;
+
+import ch.systemsx.cisd.openbis.generic.shared.IPluginCommonServer;
+import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet;
+import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed;
+
+/**
+ * The <i>screening</i> server.
+ * 
+ * @author Tomasz Pylak
+ */
+public interface IScreeningServer extends IPluginCommonServer
+{
+    /**
+     * Returns number of experiments.
+     */
+    @Transactional
+    @RolesAllowed(RoleSet.OBSERVER)
+    public int getNumberOfExperiments(String sessionToken);
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java
new file mode 100644
index 00000000000..fbffe71220a
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2008 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.plugin.screening.shared;
+
+/**
+ * Resource name used in <i>screening</i> plug-in.
+ * <p>
+ * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here
+ * should not conflict with already existing bean names. Look for other <code>ResourceNames</code>
+ * classes.
+ * </p>
+ * 
+ * @author Tomasz Pylak
+ */
+public final class ResourceNames
+{
+    private ResourceNames()
+    {
+        // Can not be instantiated.
+    }
+
+    public final static String SCREENING_PLUGIN_SERVICE = "screening-plugin-service";
+
+    public final static String SCREENING_PLUGIN_SERVER = "screening-plugin-server";
+
+    public final static String SCREENING_BUSINESS_OBJECT_FACTORY =
+            "screening-business-object-factory";
+
+    public final static String SCREENING_SAMPLE_SERVER_PLUGIN = "screening-sample-server-plugin";
+}
-- 
GitLab