From cf50f558438d0f337a69b847111349801e831e7d Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Mon, 4 Jul 2011 16:26:57 +0000
Subject: [PATCH] [LMS-2354] - fixed bug with infinite loop in
 WellSearchCriteria; - removed old sections from material detail view; -
 heading of Summary section should be always empty

SVN: 21969
---
 .../client/web/client/application/Dict.java   |  6 --
 .../application/DisplayTypeIDGenerator.java   |  6 +-
 .../detailviewers/ImagingMaterialViewer.java  | 64 ++-------------
 ...erialFeaturesFromAllExpermentsSection.java | 46 -----------
 .../MaterialMergedSummarySection.java         |  6 +-
 .../MaterialReplicaSummarySection.java        | 82 -------------------
 .../MaterialReplicaSummaryViewer.java         |  1 +
 .../SingleOrAllExperimentsChooser.java        | 20 ++++-
 .../detailviewers/WellSearchGrid.java         | 26 ++++--
 .../WellSearchMaterialSection.java            |  6 +-
 .../client/web/public/screening-dictionary.js |  2 -
 .../shared/basic/dto/WellSearchCriteria.java  |  6 --
 12 files changed, 51 insertions(+), 220 deletions(-)
 delete mode 100644 screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java
 delete mode 100644 screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummarySection.java

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
index b78854132fc..808f61b9ef4 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java
@@ -67,9 +67,6 @@ public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.clie
     public static final String MATERIAL_MERGED_SUMMARY_SECTION_TITLE =
             "MATERIAL_MERGED_SUMMARY_SECTION_TITLE";
 
-    public static final String MATERIAL_REPLICA_SUMMARY_SECTION_TITLE =
-            "MATERIAL_REPLICA_SUMMARY_SECTION_TITLE";
-
     public static final String EXPERIMENT_PLATE_MATERIAL_REVIEWER_SECTION =
             "EXPERIMENT_PLATE_MATERIAL_REVIEWER_SECTION";
 
@@ -79,9 +76,6 @@ public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.clie
     public static final String EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION =
             "EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION";
 
-    public static final String MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION =
-            "MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION";
-
     public static final String SCREENING_MODULE_TITLE = "SCREENING_MODULE_TITLE";
 
     public static final String PLATE_MATERIAL_REVIEWER_TITLE = "PLATE_MATERIAL_REVIEWER_TITLE";
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java
index 5ffc9eb5447..a25ad3d5512 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java
@@ -41,11 +41,7 @@ public enum DisplayTypeIDGenerator implements IDisplayTypeIDGenerator
 
     EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION("experiment-feature-vector-summary-section"),
 
-    MATERIAL_MERGED_SUMMARY_SECTION("material-merged-summary-section"),
-
-    MATERIAL_REPLICA_SUMMARY_SECTION("material-replica-summary-section"),
-
-    MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION("material-features-all-experiments-section");
+    MATERIAL_MERGED_SUMMARY_SECTION("material-merged-summary-section");
 
     private final String genericNameOrPrefix;
 
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java
index 3d2842365de..f324820193a 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java
@@ -28,9 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material;
 import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.material.GenericMaterialViewer;
 import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
-import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchByProjectCriteria;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria;
-import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.SingleExperimentSearchCriteria;
 
 /**
  * Material detail viewer in screening context.
@@ -40,8 +38,6 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCrit
 public class ImagingMaterialViewer extends GenericMaterialViewer
 {
 
-    private static final boolean SUMMARY_SECTION_IMPLEMENTED = false; // FIXME
-
     /**
      * @param experimentCriteriaOrNull if the experiment criteria are specified, they will be chosen
      *            automatically when the window opens.
@@ -80,42 +76,24 @@ public class ImagingMaterialViewer extends GenericMaterialViewer
 
         List<TabContent> sections = new ArrayList<TabContent>();
 
+        boolean restrictGlobalScopeLinkToProject =
+                isRestrictGlobalScopeLinkToProject(initialExperimentCriteriaOrNull);
+
         WellSearchMaterialSection wellSearchSection =
                 new WellSearchMaterialSection(screeningViewContext, materialId,
-                        initialExperimentCriteriaOrNull);
+                        initialExperimentCriteriaOrNull, restrictGlobalScopeLinkToProject);
         sections.add(wellSearchSection);
 
-        boolean restrictGlobalScopeLinkToProject =
-                isRestrictGlobalScopeLinkToProject(initialExperimentCriteriaOrNull);
-        if (SUMMARY_SECTION_IMPLEMENTED)
-        {
-            MaterialMergedSummarySection summarySection =
-                    new MaterialMergedSummarySection(screeningViewContext, material,
-                            initialExperimentCriteriaOrNull, restrictGlobalScopeLinkToProject);
-            sections.add(summarySection);
-        }
-
-        String experimentPermId = tryGetExperimentPermId(initialExperimentCriteriaOrNull);
-        if (experimentPermId != null)
-        {
-            MaterialReplicaSummarySection replicaSummarySection =
-                    new MaterialReplicaSummarySection(screeningViewContext, material,
-                            experimentPermId, restrictGlobalScopeLinkToProject);
-            sections.add(replicaSummarySection);
-        }
-        ExperimentSearchByProjectCriteria experimentCriteria =
-                tryConvert(initialExperimentCriteriaOrNull);
-        MaterialFeaturesFromAllExpermentsSection featuresFromAllExperimentsSection =
-                new MaterialFeaturesFromAllExpermentsSection(screeningViewContext, material,
-                        experimentCriteria);
-        sections.add(featuresFromAllExperimentsSection);
+        MaterialMergedSummarySection summarySection =
+                new MaterialMergedSummarySection(screeningViewContext, material,
+                        initialExperimentCriteriaOrNull, restrictGlobalScopeLinkToProject);
+        sections.add(summarySection);
         return sections;
     }
 
     private static boolean isRestrictGlobalScopeLinkToProject(
             ExperimentSearchCriteria experimentCriteriaOrNull)
     {
-
         if (experimentCriteriaOrNull == null)
         {
             return false;
@@ -125,30 +103,4 @@ public class ImagingMaterialViewer extends GenericMaterialViewer
         }
     }
 
-    private static ExperimentSearchByProjectCriteria tryConvert(
-            ExperimentSearchCriteria experimentCriteriaOrNull)
-    {
-        if (experimentCriteriaOrNull == null)
-        {
-            return null;
-        } else
-        {
-            return experimentCriteriaOrNull.tryAsSearchByProjectCriteria();
-        }
-    }
-
-    private static String tryGetExperimentPermId(ExperimentSearchCriteria experimentCriteriaOrNull)
-    {
-        if (experimentCriteriaOrNull != null)
-        {
-            SingleExperimentSearchCriteria experimentCriteria =
-                    experimentCriteriaOrNull.tryGetExperiment();
-            if (experimentCriteria != null)
-            {
-                return experimentCriteria.getExperimentPermId();
-            }
-        }
-        return null;
-    }
-
 }
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java
deleted file mode 100644
index f1af043ef38..00000000000
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers;
-
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent;
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent;
-import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator;
-import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchByProjectCriteria;
-
-/**
- * Material section panel showing feature vector summaries from all experiments.
- * 
- * @author Kaloyan Enimanev
- */
-public class MaterialFeaturesFromAllExpermentsSection extends DisposableTabContent
-{
-
-    private final IViewContext<IScreeningClientServiceAsync> screeningViewContext;
-
-    private final IEntityInformationHolderWithIdentifier material;
-
-    private final ExperimentSearchByProjectCriteria experimentCriteria;
-
-    public MaterialFeaturesFromAllExpermentsSection(
-            IViewContext<IScreeningClientServiceAsync> screeningViewContext,
-            IEntityInformationHolderWithIdentifier material,
-            ExperimentSearchByProjectCriteria experimentCriteria)
-    {
-        super(screeningViewContext.getMessage(Dict.MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION),
-                screeningViewContext, material);
-        this.screeningViewContext = screeningViewContext;
-        this.material = material;
-        this.experimentCriteria = experimentCriteria;
-        setIds(DisplayTypeIDGenerator.MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION);
-    }
-
-    @Override
-    protected IDisposableComponent createDisposableContent()
-    {
-        return MaterialFeaturesFromAllExperimentsGrid.create(screeningViewContext, material,
-                experimentCriteria);
-    }
-
-}
\ No newline at end of file
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialMergedSummarySection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialMergedSummarySection.java
index 5ba68f92431..96234954470 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialMergedSummarySection.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialMergedSummarySection.java
@@ -65,9 +65,6 @@ class MaterialMergedSummarySection extends DisposableTabContent
                                         @Override
                                         protected void process(Experiment experiment)
                                         {
-                                            setHeading(screeningViewContext.getMessage(
-                                                    Dict.MATERIAL_REPLICA_SUMMARY_SECTION_TITLE,
-                                                    experiment.getCode()));
                                             replaceContent(MaterialReplicaSummaryComponent
                                                     .createViewer(screeningViewContext, experiment,
                                                             material,
@@ -94,11 +91,10 @@ class MaterialMergedSummarySection extends DisposableTabContent
     protected void showContent()
     {
         super.showContent();
-        // getHeader().setText("");
         setHeading("");
         getHeader().addTool(
                 new SingleOrAllExperimentsChooser(screeningViewContext,
-                        experimentSearchCriteriaHolder,
+                        experimentSearchCriteriaHolder, restrictGlobalScopeLinkToProject,
                         createRefreshAction(experimentSearchCriteriaHolder)));
     }
 
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummarySection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummarySection.java
deleted file mode 100644
index 7e6b9072041..00000000000
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummarySection.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers;
-
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent;
-import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent;
-import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
-import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict;
-import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator;
-
-/**
- * Section in material detail view which presents {@link MaterialReplicaSummaryComponent}.
- * 
- * @author Tomasz Pylak
- */
-class MaterialReplicaSummarySection extends TabContent
-{
-    private final IViewContext<IScreeningClientServiceAsync> screeningViewContext;
-
-    private final Material material;
-
-    private final String experimentPermId;
-
-    private final boolean restrictGlobalScopeLinkToProject;
-
-    private IDisposableComponent viewer;
-
-    public MaterialReplicaSummarySection(
-            IViewContext<IScreeningClientServiceAsync> screeningViewContext, Material material,
-            String experimentPermId, boolean restrictGlobalScopeLinkToProject)
-    {
-        super(screeningViewContext.getMessage(Dict.MATERIAL_REPLICA_SUMMARY_SECTION_TITLE, ""),
-                screeningViewContext, material);
-        this.screeningViewContext = screeningViewContext;
-        this.material = material;
-        this.experimentPermId = experimentPermId;
-        this.restrictGlobalScopeLinkToProject = restrictGlobalScopeLinkToProject;
-
-        setHeaderVisible(false);
-        setIds(DisplayTypeIDGenerator.MATERIAL_REPLICA_SUMMARY_SECTION);
-    }
-
-    @Override
-    protected void showContent()
-    {
-        screeningViewContext.getCommonService().getExperimentInfoByPermId(experimentPermId,
-                new AbstractAsyncCallback<Experiment>(screeningViewContext)
-                    {
-                        @Override
-                        protected void process(Experiment experiment)
-                        {
-                            setHeading(screeningViewContext.getMessage(
-                                    Dict.MATERIAL_REPLICA_SUMMARY_SECTION_TITLE,
-                                    experiment.getCode()));
-                            createAndShowViewer(experiment);
-                            // NOTE: we need this because the viewer has been shown asynchronously
-                            // and the sections framework could perform the layout to early
-                            layout();
-                            syncSize();
-                        }
-                    });
-    }
-
-    private void createAndShowViewer(Experiment experiment)
-    {
-        this.viewer =
-                MaterialReplicaSummaryComponent.createViewer(screeningViewContext, experiment,
-                        material, restrictGlobalScopeLinkToProject);
-        add(viewer.getComponent());
-    }
-
-    @Override
-    public void disposeComponents()
-    {
-        if (viewer != null)
-        {
-            viewer.dispose();
-        }
-    }
-}
\ No newline at end of file
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryViewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryViewer.java
index ac2f43a63f1..99d3d15cec9 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryViewer.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryViewer.java
@@ -47,6 +47,7 @@ public class MaterialReplicaSummaryViewer
      * 
      * @param material should be enriched with properties
      */
+    // FIXME remove if not needed
     public static void openTab(IViewContext<IScreeningClientServiceAsync> screeningViewContext,
             String experimentPermId, boolean restrictGlobalScopeLinkToProject, Material material)
     {
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/SingleOrAllExperimentsChooser.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/SingleOrAllExperimentsChooser.java
index c0123db21da..3cd319e95b8 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/SingleOrAllExperimentsChooser.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/SingleOrAllExperimentsChooser.java
@@ -56,11 +56,15 @@ class SingleOrAllExperimentsChooser extends LayoutContainer
 
     private final ExperimentSearchCriteriaHolder experimentCriteriaHolder;
 
+    private final boolean restrictGlobalScopeLinkToProject;
+
     public SingleOrAllExperimentsChooser(IViewContext<?> viewContext,
-            ExperimentSearchCriteriaHolder experimentCriteriaHolder, IDelegatedAction refreshAction)
+            ExperimentSearchCriteriaHolder experimentCriteriaHolder,
+            boolean restrictGlobalScopeLinkToProject, IDelegatedAction refreshAction)
     {
         this.viewContext = viewContext;
         this.experimentCriteriaHolder = experimentCriteriaHolder;
+        this.restrictGlobalScopeLinkToProject = restrictGlobalScopeLinkToProject;
         this.refreshAction = refreshAction;
         ExperimentChooserFieldAdaptor singleExperimentChooser = createSingleExperimentChooser();
         RadioGroup experimentRadioChooser = createExperimentRadio(singleExperimentChooser);
@@ -70,6 +74,13 @@ class SingleOrAllExperimentsChooser extends LayoutContainer
         add(singleExperimentChooser.getField());
     }
 
+    // without project restriction
+    public SingleOrAllExperimentsChooser(IViewContext<?> viewContext,
+            ExperimentSearchCriteriaHolder experimentCriteriaHolder, IDelegatedAction refreshAction)
+    {
+        this(viewContext, experimentCriteriaHolder, false, refreshAction);
+    }
+
     private ExperimentSearchCriteria tryGetExperimentSearchCriteria()
     {
         return experimentCriteriaHolder.tryGetCriteria();
@@ -162,7 +173,8 @@ class SingleOrAllExperimentsChooser extends LayoutContainer
                         } else
                         {
                             experimentCriteriaHolder.setCriteria(ExperimentSearchCriteria
-                                    .createExperiment(singleExperimentChooserStateOrNull));
+                                    .createExperiment(singleExperimentChooserStateOrNull,
+                                            restrictGlobalScopeLinkToProject));
                             refreshAction.execute();
                         }
                     }
@@ -178,8 +190,8 @@ class SingleOrAllExperimentsChooser extends LayoutContainer
                 new SingleExperimentSearchCriteria(experiment.getId(), experiment.getPermId(),
                         experiment.getIdentifier());
         updateSingleExperimentChooser(chooserField, singleExperiment);
-        experimentCriteriaHolder.setCriteria(ExperimentSearchCriteria
-                .createExperiment(singleExperiment));
+        experimentCriteriaHolder.setCriteria(ExperimentSearchCriteria.createExperiment(
+                singleExperiment, restrictGlobalScopeLinkToProject));
         refreshAction.execute();
     }
 
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java
index 60479507242..5318d3026ed 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java
@@ -191,19 +191,32 @@ public class WellSearchGrid extends TypedTableGrid<WellContent>
 
     public static IDisposableComponent create(
             IViewContext<IScreeningClientServiceAsync> viewContext,
-            ExperimentSearchCriteria experimentCriteriaOrNull, TechId materialId)
+            ExperimentSearchCriteria experimentCriteriaOrNull, TechId materialId,
+            boolean restrictGlobalScopeLinkToProject)
     {
         return create(viewContext, experimentCriteriaOrNull,
-                MaterialSearchCriteria.createIdCriteria(materialId));
+                MaterialSearchCriteria.createIdCriteria(materialId),
+                restrictGlobalScopeLinkToProject);
     }
 
+    @Deprecated
+    // FIXME get rid of this method if possible
     private static IDisposableComponent create(
             IViewContext<IScreeningClientServiceAsync> viewContext,
             ExperimentSearchCriteria experimentCriteriaOrNull,
             MaterialSearchCriteria materialCriteria)
+    {
+        return create(viewContext, experimentCriteriaOrNull, materialCriteria, false);
+    }
+
+    private static IDisposableComponent create(
+            IViewContext<IScreeningClientServiceAsync> viewContext,
+            ExperimentSearchCriteria experimentCriteriaOrNull,
+            MaterialSearchCriteria materialCriteria, boolean restrictGlobalScopeLinkToProject)
     {
         WellSearchGrid reviewer =
-                new WellSearchGrid(viewContext, experimentCriteriaOrNull, materialCriteria);
+                new WellSearchGrid(viewContext, experimentCriteriaOrNull, materialCriteria,
+                        restrictGlobalScopeLinkToProject);
         final ToolBar toolbar = reviewer.createToolbar();
         return reviewer.asDisposableWithToolbar(new IDisposableComponent()
             {
@@ -233,18 +246,19 @@ public class WellSearchGrid extends TypedTableGrid<WellContent>
 
     private final ExperimentSearchCriteriaHolder experimentCriteriaHolder;
 
-    // private ExperimentSearchCriteria experimentCriteriaOrNull;
+    private final boolean restrictGlobalScopeLinkToProject;
 
     private ChannelChooserPanel channelChooser;
 
     private WellSearchGrid(IViewContext<IScreeningClientServiceAsync> viewContext,
             ExperimentSearchCriteria experimentCriteriaOrNull,
-            MaterialSearchCriteria materialCriteria)
+            MaterialSearchCriteria materialCriteria, boolean restrictGlobalScopeLinkToProject)
     {
         super(viewContext.getCommonViewContext(), BROWSER_ID, experimentCriteriaOrNull != null,
                 DisplayTypeIDGenerator.PLATE_MATERIAL_REVIEWER);
         this.viewContext = viewContext;
 
+        this.restrictGlobalScopeLinkToProject = restrictGlobalScopeLinkToProject;
         this.experimentCriteriaHolder =
                 new ExperimentSearchCriteriaHolder(experimentCriteriaOrNull);
         this.materialCriteria = materialCriteria;
@@ -507,7 +521,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent>
     private Component createExperimentChooser()
     {
         return new SingleOrAllExperimentsChooser(viewContext, experimentCriteriaHolder,
-                createRefreshGridAction());
+                restrictGlobalScopeLinkToProject, createRefreshGridAction());
     }
 
     @Override
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchMaterialSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchMaterialSection.java
index 83dd8986682..1c5a9a2265d 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchMaterialSection.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchMaterialSection.java
@@ -22,7 +22,8 @@ class WellSearchMaterialSection extends TabContent
 
     public WellSearchMaterialSection(
             IViewContext<IScreeningClientServiceAsync> screeningViewContext,
-            final TechId materialId, ExperimentSearchCriteria experimentCriteriaOrNull)
+            final TechId materialId, ExperimentSearchCriteria experimentCriteriaOrNull,
+            boolean restrictGlobalScopeLinkToProject)
     {
         super(
                 screeningViewContext
@@ -30,7 +31,8 @@ class WellSearchMaterialSection extends TabContent
                 screeningViewContext, materialId);
         setHeaderVisible(false);
         this.reviewer =
-                WellSearchGrid.create(screeningViewContext, experimentCriteriaOrNull, materialId);
+                WellSearchGrid.create(screeningViewContext, experimentCriteriaOrNull, materialId,
+                        restrictGlobalScopeLinkToProject);
         setIds(DisplayTypeIDGenerator.PLATE_LOCATIONS_MATERIAL_SECTION);
     }
 
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
index 02e4b0118b9..34b53f1bef3 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js
@@ -67,7 +67,6 @@ separator: "Separator",
 //
 plate_locations: "Plate Locations",
 MATERIAL_MERGED_SUMMARY_SECTION_TITLE: "Summary",
-MATERIAL_REPLICA_SUMMARY_SECTION_TITLE: "{0} Summary",
 
 //
 // Plate Material Reviewer 
@@ -97,7 +96,6 @@ material_replica_feature_summary_MEDIAN: "Median",
 material_replica_feature_summary_DEVIATION: "Deviation",
 
 material_features_from_all_experiments_ASSAY: "Experiment",
-MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION: "All Experiments",
 
 EXACT_MATCH_ONLY: "Exact Matches Only",
 WELLS_SEARCH_SHOW_COMBINED_RESULTS: "Show all matching results combined",
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellSearchCriteria.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellSearchCriteria.java
index cf6607688c7..a925b0df343 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellSearchCriteria.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellSearchCriteria.java
@@ -151,12 +151,6 @@ public class WellSearchCriteria implements ISerializable
             this.projectIdOrNull = projectIdOrNull;
         }
 
-        public static ExperimentSearchCriteria createExperiment(
-                SingleExperimentSearchCriteria experiment)
-        {
-            return createExperiment(experiment);
-        }
-
         public static ExperimentSearchCriteria createExperiment(
                 SingleExperimentSearchCriteria experiment, boolean restrictGlobalScopeLinkToProject)
         {
-- 
GitLab