diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewModel.java index f3712195f1e99655a2f3921f4ec63aa284fccd1c..bacccd9a5216bac1354d8a333ec80b13b32c8499 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewModel.java @@ -32,7 +32,7 @@ public class GenericViewModel private SessionContext sessionContext; private ViewMode viewMode; - + private boolean anonymousLogin; public final ApplicationInfo getApplicationInfo() @@ -74,7 +74,12 @@ public class GenericViewModel { return anonymousLogin; } - + + public boolean isEmbeddedMode() + { + return viewMode == ViewMode.EMBEDDED; + } + public boolean isDisplaySettingsSaving() { return isAnonymousLogin() == false && ViewMode.NORMAL.equals(getViewMode()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java index 5d86f7e9e66e5492c02eb6fec8ff0afae8831099..6823814620ad11eb5a0aab42f174882b89ccefca 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java @@ -108,7 +108,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; -import ch.systemsx.cisd.openbis.generic.shared.basic.ViewMode; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ColumnSetting; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; @@ -286,7 +285,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod } } }); - if (viewContext.getModel().getViewMode() == ViewMode.EMBEDDED) + if (viewContext.getModel().isEmbeddedMode()) { removeButtons(PagingToolBarButtonKind.CONFIG, PagingToolBarButtonKind.FILTERS, PagingToolBarButtonKind.REFRESH); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java index 8344ac5abac3453fd4a7f9046d0f3da4b97b12bc..6ca167983d4a6902169fa0ceb22eba7ea7763f14 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java @@ -43,7 +43,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericCon import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; -import ch.systemsx.cisd.openbis.generic.shared.basic.ViewMode; /** * {@link PagingToolBar} extension with overwritten behavior of the <i>Refresh</i> button and @@ -311,7 +310,7 @@ public final class BrowserGridPagingToolBar extends PagingToolBar public static Button createExportButton(IViewContext<?> viewContext, final IBrowserGridActionInvoker invoker) { - if (viewContext.getModel().getViewMode() == ViewMode.EMBEDDED) + if (viewContext.getModel().isEmbeddedMode()) { return createVisibleColumnsExportButton(viewContext, invoker); } else diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java index f93338cdd341d140f0351b880a04e3f881ae7acb..c47390fbdbadaee51ac26817ce83a6fd92b8294e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java @@ -125,7 +125,7 @@ abstract public class GenericMaterialViewer extends AbstractViewerWithVerticalSp final SectionsPanel container = new SectionsPanel(viewContext.getCommonViewContext(), ID_PREFIX + material.getId()); container.setDisplayID(DisplayTypeIDGenerator.GENERIC_MATERIAL_VIEWER, displayIdSuffix); - List<TabContent> additionalPanels = createAdditionalSectionPanels(); + List<TabContent> additionalPanels = createAdditionalSectionPanels(material); for (TabContent panel : additionalPanels) { container.addSection(panel); @@ -154,7 +154,7 @@ abstract public class GenericMaterialViewer extends AbstractViewerWithVerticalSp * To be subclassed. Creates additional panels of the viewer in the right side section besides * components, datasets and attachments */ - protected List<TabContent> createAdditionalSectionPanels() + protected List<TabContent> createAdditionalSectionPanels(Material material) { return new ArrayList<TabContent>(); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java index 907a7c6dfd2992ba7b3dc3f4a492bd60c029623f..b3de35b817bd1446c56f25d84fed339a2c5a79bb 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java @@ -49,18 +49,21 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ImageSampleViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ImagingMaterialViewer; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.MaterialReplicaSummaryViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.MicroscopyDatasetViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.PlateDatasetViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.PlateSampleViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.sample.LibrarySampleBatchRegistrationForm; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ScreeningConstants; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.SingleExperimentSearchCriteria; /** * {@link IClientPluginFactory} implementation for <i>screening</i> plugin. @@ -172,8 +175,8 @@ public final class ClientPluginFactory extends AbstractClientPluginFactory<Scree } /** - * opens material viewer showing wells in which the material is contained, with a selected - * experiment + * Opens material detail viewer. Shows wells in which the material is contained, with a selected + * experiment. In embedded mode only the content of the replica summary tab is presented. * * @param experimentCriteriaOrNull note that null does NOT mean searching in all experiments, * but that single experiment should be specified by the user. @@ -183,10 +186,42 @@ public final class ClientPluginFactory extends AbstractClientPluginFactory<Scree final ExperimentSearchCriteria experimentCriteriaOrNull, final IViewContext<IScreeningClientServiceAsync> viewContext) { - AbstractTabItemFactory tab = - createImagingMaterialViewerTabFactory(material, experimentCriteriaOrNull, - viewContext); - DispatcherHelper.dispatchNaviEvent(tab); + String experimentPermId = tryGetExperimentPermId(experimentCriteriaOrNull); + if (viewContext.getModel().isEmbeddedMode() && experimentPermId != null) + { + // TODO 2011-05-17, Tomasz Pylak: it should be possible to open this veiw + // for all experiments as well + MaterialIdentifier materialIdentifier = asMaterialIdentifier(material); + MaterialReplicaSummaryViewer.openTab(viewContext, experimentPermId, materialIdentifier); + } else + { + AbstractTabItemFactory tab = + createImagingMaterialViewerTabFactory(material, experimentCriteriaOrNull, + viewContext); + DispatcherHelper.dispatchNaviEvent(tab); + } + } + + private static String tryGetExperimentPermId(ExperimentSearchCriteria criteriaOrNull) + { + if (criteriaOrNull == null) + { + return null; + } + SingleExperimentSearchCriteria singleExperiment = criteriaOrNull.tryGetExperiment(); + if (singleExperiment != null) + { + return singleExperiment.getExperimentPermId(); + } else + { + return null; + } + } + + private static MaterialIdentifier asMaterialIdentifier( + IEntityInformationHolderWithPermId material) + { + return new MaterialIdentifier(material.getCode(), material.getEntityType().getCode()); } private static final AbstractTabItemFactory createImagingMaterialViewerTabFactory( @@ -215,7 +250,7 @@ public final class ClientPluginFactory extends AbstractClientPluginFactory<Scree @Override public HelpPageIdentifier getHelpPageIdentifier() { - return ImagingMaterialViewer.getHelpPageIdentifier(); + return HelpPageIdentifier.createSpecific("Well Content Material Viewer"); } @Override 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 8f472ece650ce9aeef0489678a692b77f6170f7f..e5b43fc07f6acccc737065d0f9df70feafc331ae 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 @@ -64,6 +64,9 @@ public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.clie public static final String PLATE_LOCATIONS = "plate_locations"; + public static final String REPLICA_SUMMARY_MATERIAL_SECTION_TITLE = + "REPLICA_SUMMARY_MATERIAL_SECTION_TITLE"; + public static final String EXPERIMENT_PLATE_MATERIAL_REVIEWER_SECTION = "EXPERIMENT_PLATE_MATERIAL_REVIEWER_SECTION"; 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 8e66d055a52290f2550575bc1f5c679f733942a9..ee205fe0dc9490c9ea18a845b8097add863e8368 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 @@ -35,6 +35,8 @@ public enum DisplayTypeIDGenerator implements IDisplayTypeIDGenerator PLATE_LOCATIONS_MATERIAL_SECTION("plate-locations-material-section"), + REPLICA_SUMMARY_MATERIAL_SECTION("replica-summary-material-section"), + EXPERIMENT_PLATE_LOCATIONS_SECTION("plate-locations-experiment-section"), EXPERIMENT_WELL_MATERIALS_SECTION("experiment-well-materials-section"), diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java index cbe7485c7d3569f679367d22503a0a4a9f13da02..19314c9b8b5a27ef80bc0189a8957596088d20df 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java @@ -35,7 +35,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IMo import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ExperimentFeatureVectorSummarySection; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ExperimentAnalysisSummarySection; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ExperimentWellMaterialsSection; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.WellSearchComponent; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.GlobalWellSearchLocatorResolver; @@ -113,7 +113,7 @@ public class ScreeningModule implements IModule { sections.add(WellSearchComponent.create(viewContext, entity)); sections.add(new ExperimentWellMaterialsSection(viewContext, entity)); - sections.add(new ExperimentFeatureVectorSummarySection(viewContext, entity)); + sections.add(new ExperimentAnalysisSummarySection(viewContext, entity)); } return sections; } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java index ce0d7cf341c8079e9250c3c9120c8f796498f11a..9aedd1d548bde8152eb3029587a0674ea9de39ca 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java @@ -8,10 +8,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocatorResolverRegistry; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.FeatureVectorSummaryResolver; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.ExperimentAnalysisSummaryResolver; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.GlobalWellSearchLocatorResolver; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.ImagingMaterialLocatorResolver; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.MaterialReplicaFeatureSummaryResolver; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.MaterialReplicaSummaryResolver; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.PlateMetadataBrowserLocatorResolver; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.locator.WellSearchLocatorResolver; @@ -50,8 +50,8 @@ public final class ScreeningViewContext extends handlerRegistry.registerHandler(new PlateMetadataBrowserLocatorResolver(this)); handlerRegistry.registerHandler(new WellSearchLocatorResolver(this)); handlerRegistry.registerHandler(new GlobalWellSearchLocatorResolver(this)); - handlerRegistry.registerHandler(new FeatureVectorSummaryResolver(this)); - handlerRegistry.registerHandler(new MaterialReplicaFeatureSummaryResolver(this)); + handlerRegistry.registerHandler(new ExperimentAnalysisSummaryResolver(this)); + handlerRegistry.registerHandler(new MaterialReplicaSummaryResolver(this)); } public static ScreeningDisplaySettingsManager getTechnologySpecificDisplaySettingsManager( diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java similarity index 69% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryGrid.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java index 63b81226d8f81c907c66e28788059fb854d95fcb..04355edd397f18a8028d915c4f19e4cab6615167 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java @@ -29,17 +29,18 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; -import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ClientPluginFactory; 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.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialFeatureVectorSummary; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.grids.FeatureVectorSummaryGridColumnIDs; /** @@ -47,7 +48,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.grids.FeatureV * * @author Kaloyan Enimanev */ -public class FeatureVectorSummaryGrid extends TypedTableGrid<MaterialFeatureVectorSummary> +public class ExperimentAnalysisSummaryGrid extends TypedTableGrid<MaterialFeatureVectorSummary> { private static final String PREFIX = GenericConstants.ID_PREFIX + "experiment-feature-vector-summary"; @@ -56,54 +57,57 @@ public class FeatureVectorSummaryGrid extends TypedTableGrid<MaterialFeatureVect public static final String GRID_ID = PREFIX + TypedTableGrid.GRID_POSTFIX; - private final IViewContext<IScreeningClientServiceAsync> specificViewContext; - - private final IEntityInformationHolderWithPermId experiment; + private final IViewContext<IScreeningClientServiceAsync> screeningViewContext; + private final IEntityInformationHolderWithIdentifier experiment; public static IDisposableComponent create( IViewContext<IScreeningClientServiceAsync> viewContext, - IEntityInformationHolderWithPermId experiment) + IEntityInformationHolderWithIdentifier experiment) { - return new FeatureVectorSummaryGrid(viewContext, experiment).asDisposableWithoutToolbar(); + return new ExperimentAnalysisSummaryGrid(viewContext, experiment) + .asDisposableWithoutToolbar(); } - private ICellListenerAndLinkGenerator<MaterialFeatureVectorSummary> createMaterialReplicaSummaryLinkGenerator() { return new ICellListenerAndLinkGenerator<MaterialFeatureVectorSummary>() + { + + public void handle(TableModelRowWithObject<MaterialFeatureVectorSummary> rowItem, + boolean specialKeyPressed) + { + Material material = rowItem.getObjectOrNull().getMaterial(); + openMaterialDetailViewer(material); + } + + public String tryGetLink(MaterialFeatureVectorSummary entity, + ISerializableComparable comparableValue) { + Material material = entity.getMaterial(); + return ScreeningLinkExtractor.tryCreateMaterialDetailsLink(material, + getExperimentAsSearchCriteria()); + } + }; + } - public void handle( - TableModelRowWithObject<MaterialFeatureVectorSummary> rowItem, - boolean specialKeyPressed) - { - Material material = rowItem.getObjectOrNull().getMaterial(); - MaterialIdentifier materialIdentifier = - new MaterialIdentifier(material.getCode(), material - .getMaterialType().getCode()); - MaterialReplicaFeatureSummaryViewer.openTab(specificViewContext, - experiment.getPermId(), materialIdentifier); - } - - public String tryGetLink(MaterialFeatureVectorSummary entity, - ISerializableComparable comparableValue) - { - Material material = entity.getMaterial(); - return ScreeningLinkExtractor - .createMaterialReplicaSummaryLink(experiment - .getPermId(), material.getCode(), material - .getMaterialType().getCode()); - } - }; + private void openMaterialDetailViewer(Material material) + { + ClientPluginFactory.openImagingMaterialViewer(material, getExperimentAsSearchCriteria(), + screeningViewContext); + } + + private ExperimentSearchCriteria getExperimentAsSearchCriteria() + { + return ExperimentSearchCriteria.createExperiment(experiment); } - FeatureVectorSummaryGrid(IViewContext<IScreeningClientServiceAsync> viewContext, - final IEntityInformationHolderWithPermId experiment) + ExperimentAnalysisSummaryGrid(IViewContext<IScreeningClientServiceAsync> viewContext, + final IEntityInformationHolderWithIdentifier experiment) { super(viewContext.getCommonViewContext(), BROWSER_ID, true, DisplayTypeIDGenerator.EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION); - this.specificViewContext = viewContext; + this.screeningViewContext = viewContext; this.experiment = experiment; ICellListenerAndLinkGenerator<MaterialFeatureVectorSummary> linkGenerator = @@ -120,7 +124,7 @@ public class FeatureVectorSummaryGrid extends TypedTableGrid<MaterialFeatureVect DefaultResultSetConfig<String, TableModelRowWithObject<MaterialFeatureVectorSummary>> resultSetConfig, AsyncCallback<TypedTableResultSet<MaterialFeatureVectorSummary>> callback) { - specificViewContext.getService().listExperimentFeatureVectorSummary(resultSetConfig, + screeningViewContext.getService().listExperimentFeatureVectorSummary(resultSetConfig, new TechId(experiment), callback); } @@ -130,8 +134,8 @@ public class FeatureVectorSummaryGrid extends TypedTableGrid<MaterialFeatureVect TableExportCriteria<TableModelRowWithObject<MaterialFeatureVectorSummary>> exportCriteria, AbstractAsyncCallback<String> callback) { - specificViewContext.getService() - .prepareExportFeatureVectorSummary(exportCriteria, callback); + screeningViewContext.getService().prepareExportFeatureVectorSummary(exportCriteria, + callback); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentFeatureVectorSummarySection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummarySection.java similarity index 88% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentFeatureVectorSummarySection.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummarySection.java index aedc1509681b1a1236dc6346ec42d3a4297f3951..1a55399b350bb9dab321f5518e516ab420cb1abe 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentFeatureVectorSummarySection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummarySection.java @@ -13,14 +13,14 @@ import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.D * * @author Kaloyan Enimanev */ -public class ExperimentFeatureVectorSummarySection extends DisposableTabContent +public class ExperimentAnalysisSummarySection extends DisposableTabContent { private final IViewContext<IScreeningClientServiceAsync> screeningViewContext; private final IEntityInformationHolderWithIdentifier experiment; - public ExperimentFeatureVectorSummarySection( + public ExperimentAnalysisSummarySection( IViewContext<IScreeningClientServiceAsync> screeningViewContext, IEntityInformationHolderWithIdentifier experiment) { @@ -34,7 +34,7 @@ public class ExperimentFeatureVectorSummarySection extends DisposableTabContent @Override protected IDisposableComponent createDisposableContent() { - return FeatureVectorSummaryGrid.create(screeningViewContext, experiment); + return ExperimentAnalysisSummaryGrid.create(screeningViewContext, experiment); } } \ No newline at end of file diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryViewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryViewer.java similarity index 96% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryViewer.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryViewer.java index 8d5bb943e41b37ed9d2951c919a62be16197d81c..a07993047425e46ef374ca0bf64714001d3bd29c 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/FeatureVectorSummaryViewer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryViewer.java @@ -50,8 +50,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.u * * @author Kaloyan Enimanev */ -// TODO 2011-05-05, Tomasz Pylak: rename to ExperimentAnalysisSummaryViewer -public class FeatureVectorSummaryViewer +public class ExperimentAnalysisSummaryViewer { public static void openTab( @@ -103,7 +102,7 @@ public class FeatureVectorSummaryViewer public String getId() { return ScreeningModule.ID - + ScreeningLinkExtractor.FEATURE_VECTOR_SUMMARY_ACTION + + ScreeningLinkExtractor.EXPERIMENT_ANALYSIS_SUMMARY_ACTION + experiment.getCode(); } @@ -146,7 +145,7 @@ public class FeatureVectorSummaryViewer addHeader(panel, viewContext, experiment); final IDisposableComponent gridComponent = - FeatureVectorSummaryGrid.create(viewContext, experiment); + ExperimentAnalysisSummaryGrid.create(viewContext, experiment); panel.add(gridComponent.getComponent(), new BorderLayoutData(LayoutRegion.CENTER)); return new IDisposableComponent() diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialBrowserGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialBrowserGrid.java index 040636e99473d6474949004951af745e7cf9e710..d5a093dd3c2a38d62ec11608b904fd2dd64cf903 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialBrowserGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialBrowserGrid.java @@ -108,8 +108,7 @@ public class ExperimentWellMaterialBrowserGrid extends MaterialBrowserGrid if (editMode == false) { ExperimentSearchCriteria experimentCriteria = - ExperimentSearchCriteria.createExperiment(experiment.getId(), - experiment.getPermId(), experiment.getIdentifier()); + ExperimentSearchCriteria.createExperiment(experiment); ClientPluginFactory.openImagingMaterialViewer(material, experimentCriteria, screeningViewContext); } else diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialsSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialsSection.java index 60b912f6767f64f79d6abc15c6263970f5dcc57c..96ffbf34a8700bb69048dda386f2a1c2bf493de4 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialsSection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentWellMaterialsSection.java @@ -9,7 +9,8 @@ import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.D import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator; /** - * Experiment section panel which shows all materials in the experiment. + * Experiment section with {@link ExperimentWellMaterialBrowserGrid} which shows all materials in + * the experiment (a.k.a. Library Index). * * @author Piotr Buczek */ 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 f351f2a7cb0ada303e8c25fb92d96acdb0d01ec4..4531397ba7e757cfa55ed4f551f24781f548f4cc 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 @@ -24,16 +24,16 @@ import com.google.gwt.user.client.rpc.AsyncCallback; 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.framework.DatabaseModificationAwareComponent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; 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.GenericViewContext; 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.ExperimentSearchCriteria; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.SingleExperimentSearchCriteria; /** - * A viewer for a material which can be a content of the well. + * Material detail viewer in screening context. * * @author Tomasz Pylak */ @@ -74,18 +74,42 @@ public class ImagingMaterialViewer extends GenericMaterialViewer } @Override - protected List<TabContent> createAdditionalSectionPanels() + protected List<TabContent> createAdditionalSectionPanels(Material material) { List<TabContent> sections = new ArrayList<TabContent>(); - sections.add(new WellSearchMaterialSection(screeningViewContext, materialId, - experimentCriteriaOrNull)); + + WellSearchMaterialSection wellSearchSection = + new WellSearchMaterialSection(screeningViewContext, materialId, + experimentCriteriaOrNull); + sections.add(wellSearchSection); + + // TODO 2011-05-17, Tomasz Pylak: the section is visible only if experiment is initially + // selected. Allow to switch between "Material in one assay" and "Material in all assays" + // summaries. Extract experiment chooser from WellSearchGrid + String experimentPermId = tryGetExperimentPermId(); + if (experimentPermId != null) + { + MaterialReplicaSummarySection replicaSummarySection = + new MaterialReplicaSummarySection(screeningViewContext, material, + experimentPermId); + sections.add(replicaSummarySection); + } return sections; } - public static HelpPageIdentifier getHelpPageIdentifier() + private String tryGetExperimentPermId() { - return HelpPageIdentifier.createSpecific("Well Content Material Viewer"); + 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/MaterialDisambiguationGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java index 2c091376bfa77a412548ce9f40d9224712b1557c..4ee85f27003c0896f0593a23aa922ff9e997a209 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java @@ -42,17 +42,13 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteri import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ClientPluginFactory; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningDisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.dto.ExperimentIdentifierSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria; -import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria; -import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.SingleExperimentSearchCriteria; /** * Displays a list of well content materials matching the search criteria and allows to go to their @@ -94,7 +90,7 @@ public class MaterialDisambiguationGrid extends TypedTableGrid<Material> { List<Material> materials = grid.getContainedGridElements(); Material material = materials.get(0); - grid.openImagingMaterialViewer(material); + grid.openMaterialDetailViewer(material); } else { DispatcherHelper.dispatchNaviEvent(disambiguationTabFactory); @@ -225,81 +221,25 @@ public class MaterialDisambiguationGrid extends TypedTableGrid<Material> { public String tryGetLink(Material material, ISerializableComparable value) { - ExperimentSearchCriteria experimentSearchCriteria = - searchCriteria.getExperimentCriteria(); - if (experimentSearchCriteria.tryGetExperiment() != null) - { - String experimentPermId = - experimentSearchCriteria.tryGetExperiment() - .getExperimentPermId(); - return createMaterialReplicaSummaryLink(material, experimentPermId); - } else - { - return tryCreateMaterialDetailViewLink(material, - experimentSearchCriteria); - } + return ScreeningLinkExtractor.tryCreateMaterialDetailsLink(material, + searchCriteria.getExperimentCriteria()); } public void handle(TableModelRowWithObject<Material> row, boolean specialKeyPressed) { Material material = row.getObjectOrNull(); - openImagingMaterialViewer(material); + openMaterialDetailViewer(material); } }; registerListenerAndLinkGenerator(MaterialGridColumnIDs.SHOW_DETAILS, listenerLinkGenerator); registerListenerAndLinkGenerator(MaterialGridColumnIDs.CODE, listenerLinkGenerator); } - private void openMaterialReplicaSummary(Material material, String experimentPermId) + private void openMaterialDetailViewer(Material material) { - MaterialIdentifier materialIdentifier = - new MaterialIdentifier(material.getCode(), material.getMaterialType().getCode()); - MaterialReplicaFeatureSummaryViewer.openTab(screeningViewContext, experimentPermId, - materialIdentifier); - } - - private static String createMaterialReplicaSummaryLink(Material material, - String experimentPermId) - { - return ScreeningLinkExtractor.createMaterialReplicaSummaryLink(experimentPermId, - material.getCode(), material.getMaterialType().getCode()); - } - - private static String tryCreateMaterialDetailViewLink(Material material, - ExperimentSearchCriteria experimentSearchCriteria) - { - ExperimentIdentifierSearchCriteria experimentCriteria = - convertExperimentCriteria(experimentSearchCriteria); - return ScreeningLinkExtractor.tryCreateMaterialDetailsLink(material, experimentCriteria); - } - - private static ExperimentIdentifierSearchCriteria convertExperimentCriteria( - ExperimentSearchCriteria experimentSearchCriteria) - { - SingleExperimentSearchCriteria experiment = experimentSearchCriteria.tryGetExperiment(); - if (experiment != null) - { - return new ExperimentIdentifierSearchCriteria(experiment.getExperimentIdentifier()); - } else - { - return ExperimentIdentifierSearchCriteria.createSearchAll(); - } - } - - private void openImagingMaterialViewer(Material material) - { - ExperimentSearchCriteria experimentSearchCriteria = searchCriteria.getExperimentCriteria(); - if (experimentSearchCriteria.tryGetExperiment() != null) - { - String experimentPermId = - experimentSearchCriteria.tryGetExperiment().getExperimentPermId(); - openMaterialReplicaSummary(material, experimentPermId); - } else - { - ClientPluginFactory.openImagingMaterialViewer(material, - searchCriteria.getExperimentCriteria(), screeningViewContext); - } + ClientPluginFactory.openImagingMaterialViewer(material, + searchCriteria.getExperimentCriteria(), screeningViewContext); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryViewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryComponent.java similarity index 71% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryViewer.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryComponent.java index 6bc6244d44d98e0f4731615341e9822cbdcdc2f0..26cbf05533613a92a98a2be073845bbdac6698be 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryViewer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryComponent.java @@ -26,6 +26,7 @@ import java.util.Set; import com.extjs.gxt.ui.client.Style.Orientation; import com.extjs.gxt.ui.client.Style.Scroll; +import com.extjs.gxt.ui.client.util.Margins; import com.extjs.gxt.ui.client.widget.Component; import com.extjs.gxt.ui.client.widget.Html; import com.extjs.gxt.ui.client.widget.LayoutContainer; @@ -41,23 +42,14 @@ 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.IViewContext; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; -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.generic.shared.basic.dto.MaterialIdentifier; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningDisplayTypeIDGenerator; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningModule; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ChannelWidgetWithListener.ISimpleChanneledViewerFactory; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageDatasetParameters; @@ -66,12 +58,14 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellImage; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellReplicaImage; /** - * A viewer that comprises several UI elements to produce a holistic UI for material replica feature - * summaries. + * Component which for a specified material and experiment presents 1. feature vectors (detailed and + * aggregated across all replicas of one assay) 2. images grouped by biological and technical + * replicates. * * @author Kaloyan Enimanev + * @author Tomasz Pylak */ -public class MaterialReplicaFeatureSummaryViewer +public class MaterialReplicaSummaryComponent { private static final String LOADING_IMAGES_DICT_MSG = "Loading images..."; @@ -83,129 +77,22 @@ public class MaterialReplicaFeatureSummaryViewer private static final int ONE_IMAGE_SIZE_FACTOR_PX = 60; - public static void openTab(IViewContext<IScreeningClientServiceAsync> screeningViewContext, - String experimentPermId, MaterialIdentifier materialIdentifier) + public static IDisposableComponent createViewer( + IViewContext<IScreeningClientServiceAsync> screeningViewContext, + IEntityInformationHolderWithPermId experiment, Material material) { - MaterialReplicaFeatureSummaryViewer viewer = - new MaterialReplicaFeatureSummaryViewer(screeningViewContext); - screeningViewContext.getCommonService().getEntityInformationHolder(EntityKind.EXPERIMENT, - experimentPermId, viewer.createExperimentFoundCallback(materialIdentifier)); + return new MaterialReplicaSummaryComponent(screeningViewContext).createViewer(experiment, + material); } private final IViewContext<IScreeningClientServiceAsync> screeningViewContext; - private MaterialReplicaFeatureSummaryViewer( + private MaterialReplicaSummaryComponent( IViewContext<IScreeningClientServiceAsync> screeningViewContext) { this.screeningViewContext = screeningViewContext; } - private ExperimentFoundCallback createExperimentFoundCallback( - MaterialIdentifier materialIdentifier) - { - return new ExperimentFoundCallback(materialIdentifier); - } - - private class ExperimentFoundCallback extends - AbstractAsyncCallback<IEntityInformationHolderWithPermId> - { - - private final MaterialIdentifier materialIdentifier; - - ExperimentFoundCallback(MaterialIdentifier materialIdentifier) - { - super(screeningViewContext); - this.materialIdentifier = materialIdentifier; - } - - @Override - protected void process(IEntityInformationHolderWithPermId experiment) - { - screeningViewContext.getCommonService().getExperimentInfo(new TechId(experiment), - new AbstractAsyncCallback<Experiment>(screeningViewContext) - { - @Override - protected void process(Experiment result) - { - viewContext.getCommonService().getMaterialInformationHolder( - materialIdentifier, new MaterialFoundCallback(result)); - } - }); - } - } - - private class MaterialFoundCallback extends - AbstractAsyncCallback<IEntityInformationHolderWithPermId> - { - - private final Experiment experiment; - - MaterialFoundCallback(Experiment experiment) - { - super(screeningViewContext); - this.experiment = experiment; - } - - @Override - protected void process(IEntityInformationHolderWithPermId material) - { - screeningViewContext.getService().getMaterialInfo(new TechId(material), - new AbstractAsyncCallback<Material>(screeningViewContext) - { - @Override - protected void process(Material result) - { - AbstractTabItemFactory factory = - createTabFactory(experiment, result); - DispatcherHelper.dispatchNaviEvent(factory); - } - }); - } - } - - private AbstractTabItemFactory createTabFactory(final Experiment experiment, - final Material material) - { - return new AbstractTabItemFactory() - { - - @Override - public String getId() - { - return ScreeningModule.ID - + ScreeningLinkExtractor.MATERIAL_REPLICA_SUMMARY_ACTION - + experiment.getCode() + material.getPermId(); - } - - @Override - public ITabItem create() - { - IDisposableComponent tabComponent = createViewer(experiment, material); - return DefaultTabItem.create(getTabTitle(), tabComponent, screeningViewContext); - } - - @Override - public String tryGetLink() - { - return ScreeningLinkExtractor.createMaterialReplicaSummaryLink(experiment - .getPermId(), material.getCode(), material.getEntityType().getCode()); - } - - @Override - public String getTabTitle() - { - return getMaterialName(material) + " in " + experiment.getCode() + " Summary"; - } - - @Override - public HelpPageIdentifier getHelpPageIdentifier() - { - return null; - } - - }; - } - private class ImagesFoundCallback extends AbstractAsyncCallback<List<WellReplicaImage>> { private final LayoutContainer imagesPanel; @@ -220,7 +107,9 @@ public class MaterialReplicaFeatureSummaryViewer protected void process(List<WellReplicaImage> images) { imagesPanel.removeAll(); - imagesPanel.add(createImagePanel(images)); + imagesPanel.setLayout(new RowLayout()); + imagesPanel.add(createImagePanel(images), new RowData(-1, -1, + new Margins(10, 0, 10, 10))); imagesPanel.layout(); } } @@ -237,7 +126,6 @@ public class MaterialReplicaFeatureSummaryViewer ChannelChooserPanel channelChooser = new ChannelChooserPanel(defaultChannelState); LayoutContainer panel = new LayoutContainer(); panel.setLayout(new RowLayout()); - panel.add(new Html("<br>"), new RowData(1, -1)); panel.add(channelChooser); Map<String, List<WellReplicaImage>> labelToReplicasMap = createSortedImageMap(images); @@ -250,22 +138,9 @@ public class MaterialReplicaFeatureSummaryViewer labelToReplicasMap.remove(orphanGroupKey); } panel.add(createBiologicalReplicatesImagesPanel(labelToReplicasMap, channelChooser)); - ensureAllImagesVisible(panel); return panel; } - // WORKAROUND: in normal mode the height of menu and tab is not taken into account, - // so we add empty space to make - private void ensureAllImagesVisible(LayoutContainer panel) - { - if (screeningViewContext.isSimpleOrEmbeddedMode() == false) - { - Text box = new Text(); - box.setHeight(100); - panel.add(box); - } - } - private Widget createOrphanTechnicalReplicatesPanel( List<WellReplicaImage> orphanTechnicalReplicates, ChannelChooserPanel channelChooser) { @@ -418,7 +293,8 @@ public class MaterialReplicaFeatureSummaryViewer return widgetWithListener.asWidget(); } - private IDisposableComponent createViewer(Experiment experiment, Material material) + private IDisposableComponent createViewer(IEntityInformationHolderWithPermId experiment, + Material material) { final LayoutContainer panel = new Viewport(); panel.setLayout(new RowLayout(Orientation.VERTICAL)); @@ -427,17 +303,19 @@ public class MaterialReplicaFeatureSummaryViewer Widget materialInfo = createMaterialInfo(screeningViewContext, experiment, material); panel.add(materialInfo, new RowData(-1, -1, PropertiesUtil.createHeaderInfoMargin())); + TechId materialTechId = new TechId(material); + TechId experimentTechId = new TechId(experiment); final IDisposableComponent gridComponent = - MaterialReplicaFeatureSummaryGrid.create(screeningViewContext, new TechId( - experiment), new TechId(material)); + MaterialReplicaFeatureSummaryGrid.create(screeningViewContext, experimentTechId, + materialTechId); // NOTE: if the width is 100% then the vertical scrollbar of the grid is not visible panel.add(gridComponent.getComponent(), new RowData(0.97, 400)); LayoutContainer imagesPanel = new LayoutContainer(); imagesPanel.add(new Text(LOADING_IMAGES_DICT_MSG)); panel.add(imagesPanel); - screeningViewContext.getService().listWellImages(new TechId(material.getId()), - new TechId(experiment.getId()), new ImagesFoundCallback(imagesPanel)); + screeningViewContext.getService().listWellImages(materialTechId, experimentTechId, + new ImagesFoundCallback(imagesPanel)); return new IDisposableComponent() { @@ -465,7 +343,7 @@ public class MaterialReplicaFeatureSummaryViewer private static Widget createMaterialInfo( final IViewContext<IScreeningClientServiceAsync> viewContext, - final Experiment experiment, final Material material) + final IEntityInformationHolderWithPermId experiment, final Material material) { LayoutContainer panel = new LayoutContainer(); panel.setLayout(new RowLayout()); @@ -481,7 +359,7 @@ public class MaterialReplicaFeatureSummaryViewer private static Widget createHeaderWithLinks( final IViewContext<IScreeningClientServiceAsync> viewContext, - final Experiment experiment, final Material material) + final IEntityInformationHolderWithPermId experiment, final Material material) { Widget headingWidget = createHeaderTitle(experiment, material); Text emptyBox = new Text(); @@ -496,7 +374,8 @@ public class MaterialReplicaFeatureSummaryViewer return headerPanel; } - private static Html createHeaderTitle(final Experiment experiment, final Material material) + private static Html createHeaderTitle(final IEntityInformationHolderWithPermId experiment, + final Material material) { String headingText = getMaterialType(material) + " " + getMaterialName(material) + " in assay " @@ -517,7 +396,8 @@ public class MaterialReplicaFeatureSummaryViewer return ("" + text.charAt(0)).toUpperCase() + text.substring(1).toLowerCase(); } - private static String getMaterialName(Material material) + /** @return the best short description of the material. */ + public static String getMaterialName(Material material) { if (material.getEntityType().getCode() .equalsIgnoreCase(ScreeningConstants.GENE_PLUGIN_TYPE_CODE)) @@ -534,20 +414,20 @@ public class MaterialReplicaFeatureSummaryViewer private static Widget createAssayAnalysisSummaryLink( final IViewContext<IScreeningClientServiceAsync> viewContext, - final Experiment experiment, final Material material) + final IEntityInformationHolderWithPermId experiment, final Material material) { // add link to feature vector summary for the experiment String linkUrl = ScreeningLinkExtractor.createExperimentAnalysisSummaryBrowserLink(experiment .getPermId()); - String linkText = "Show assay " + experiment.getCode() + " summary"; + String linkText = "Show assay " + experiment.getCode() + " analysis summary"; Widget linkWidget = LinkRenderer.getLinkWidget(linkText, new ClickHandler() { public void onClick(ClickEvent event) { // TODO KE: We bind ourselves with // the implementation of the other view instead of relying on the browser - FeatureVectorSummaryViewer.openTab(viewContext, experiment.getPermId()); + ExperimentAnalysisSummaryViewer.openTab(viewContext, experiment.getPermId()); } }, linkUrl); return linkWidget; @@ -563,4 +443,5 @@ public class MaterialReplicaFeatureSummaryViewer ScreeningConstants.GENE_SYMBOLS); return propertiesPanel; } + } 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 new file mode 100644 index 0000000000000000000000000000000000000000..4da94a1ff2786debc47239206d9ce5694f97c758 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummarySection.java @@ -0,0 +1,78 @@ +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.IEntityInformationHolderWithPermId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; +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 IDisposableComponent viewer; + + public MaterialReplicaSummarySection( + IViewContext<IScreeningClientServiceAsync> screeningViewContext, Material material, + String experimentPermId) + { + super(screeningViewContext.getMessage(Dict.REPLICA_SUMMARY_MATERIAL_SECTION_TITLE), + screeningViewContext, material); + this.screeningViewContext = screeningViewContext; + this.material = material; + this.experimentPermId = experimentPermId; + + setHeaderVisible(false); + setIds(DisplayTypeIDGenerator.REPLICA_SUMMARY_MATERIAL_SECTION); + } + + @Override + protected void showContent() + { + screeningViewContext.getCommonService().getEntityInformationHolder(EntityKind.EXPERIMENT, + experimentPermId, + new AbstractAsyncCallback<IEntityInformationHolderWithPermId>(screeningViewContext) + { + @Override + protected void process(IEntityInformationHolderWithPermId experiment) + { + 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(IEntityInformationHolderWithPermId experiment) + { + this.viewer = + MaterialReplicaSummaryComponent.createViewer(screeningViewContext, experiment, + material); + 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 new file mode 100644 index 0000000000000000000000000000000000000000..59b321892106a958c1519799417841b6d3f4f423 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaSummaryViewer.java @@ -0,0 +1,193 @@ +/* + * Copyright 2011 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.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.framework.AbstractTabItemFactory; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; +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.Material; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningModule; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; + +/** + * Opens an independent tab with {@link MaterialReplicaSummaryComponent}. + * + * @author Tomasz Pylak + */ +public class MaterialReplicaSummaryViewer +{ + /** + * Fetches experiment and opens a tab with {@link MaterialReplicaSummaryComponent}. + * + * @param material should be enriched with properties + */ + public static void openTab(IViewContext<IScreeningClientServiceAsync> screeningViewContext, + String experimentPermId, Material material) + { + MaterialReplicaSummaryViewer viewer = + new MaterialReplicaSummaryViewer(screeningViewContext); + AbstractAsyncCallback<IEntityInformationHolderWithPermId> experimentFoundCallback = + viewer.createExperimentFoundCallback(material); + viewer.fetchExperimentByPermId(experimentPermId, experimentFoundCallback); + } + + /** + * Fetches material and experiment and opens a tab with {@link MaterialReplicaSummaryComponent}. + */ + public static void openTab(IViewContext<IScreeningClientServiceAsync> screeningViewContext, + String experimentPermId, MaterialIdentifier materialIdentifier) + { + MaterialReplicaSummaryViewer viewer = + new MaterialReplicaSummaryViewer(screeningViewContext); + AbstractAsyncCallback<IEntityInformationHolderWithPermId> experimentFoundCallback = + viewer.createExperimentFoundCallback(materialIdentifier); + viewer.fetchExperimentByPermId(experimentPermId, experimentFoundCallback); + } + + private final IViewContext<IScreeningClientServiceAsync> screeningViewContext; + + private MaterialReplicaSummaryViewer( + IViewContext<IScreeningClientServiceAsync> screeningViewContext) + { + this.screeningViewContext = screeningViewContext; + } + + private void fetchExperimentByPermId(String experimentPermId, + AbstractAsyncCallback<IEntityInformationHolderWithPermId> experimentFoundCallback) + { + screeningViewContext.getCommonService().getEntityInformationHolder(EntityKind.EXPERIMENT, + experimentPermId, experimentFoundCallback); + } + + // NOTE: material is already fetched + private AbstractAsyncCallback<IEntityInformationHolderWithPermId> createExperimentFoundCallback( + final Material material) + { + return new AbstractAsyncCallback<IEntityInformationHolderWithPermId>(screeningViewContext) + { + @Override + protected void process(IEntityInformationHolderWithPermId experiment) + { + openTab(experiment, material); + } + }; + } + + // NOTE: material has to be still fetched + private AbstractAsyncCallback<IEntityInformationHolderWithPermId> createExperimentFoundCallback( + final MaterialIdentifier materialIdentifier) + { + return new AbstractAsyncCallback<IEntityInformationHolderWithPermId>(screeningViewContext) + { + @Override + protected void process(IEntityInformationHolderWithPermId experiment) + { + viewContext.getCommonService().getMaterialInformationHolder(materialIdentifier, + new MaterialFoundCallback(experiment)); + } + }; + } + + private class MaterialFoundCallback extends + AbstractAsyncCallback<IEntityInformationHolderWithPermId> + { + private final IEntityInformationHolderWithPermId experiment; + + MaterialFoundCallback(IEntityInformationHolderWithPermId experiment) + { + super(screeningViewContext); + this.experiment = experiment; + } + + @Override + protected void process(IEntityInformationHolderWithPermId material) + { + screeningViewContext.getService().getMaterialInfo(new TechId(material), + new AbstractAsyncCallback<Material>(screeningViewContext) + { + @Override + protected void process(Material result) + { + openTab(experiment, result); + } + }); + } + } + + private void openTab(IEntityInformationHolderWithPermId experiment, Material material) + { + AbstractTabItemFactory factory = createTabFactory(experiment, material); + DispatcherHelper.dispatchNaviEvent(factory); + } + + private AbstractTabItemFactory createTabFactory( + final IEntityInformationHolderWithPermId experiment, final Material material) + { + return new AbstractTabItemFactory() + { + + @Override + public String getId() + { + return ScreeningModule.ID + + ScreeningLinkExtractor.MATERIAL_REPLICA_SUMMARY_ACTION + + experiment.getCode() + material.getPermId(); + } + + @Override + public ITabItem create() + { + IDisposableComponent tabComponent = + MaterialReplicaSummaryComponent.createViewer(screeningViewContext, + experiment, material); + return DefaultTabItem.create(getTabTitle(), tabComponent, screeningViewContext); + } + + @Override + public String tryGetLink() + { + return ScreeningLinkExtractor.createMaterialReplicaSummaryLink(experiment + .getPermId(), material.getCode(), material.getEntityType().getCode()); + } + + @Override + public String getTabTitle() + { + return MaterialReplicaSummaryComponent.getMaterialName(material) + " in " + + experiment.getCode() + " Summary"; + } + + @Override + public HelpPageIdentifier getHelpPageIdentifier() + { + return null; + } + + }; + } + +} diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java index e4cfd9442eee33a7a5db5e183dc66330f9aa7426..f0ebd4f8193929550bf4766c25c3d90dec7f8726 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java @@ -222,7 +222,7 @@ public class WellContentDialog extends Dialog ExperimentReference experimentReference) { return new SingleExperimentSearchCriteria(experimentReference.getId(), - experimentReference.getPermId(), experimentReference.getExperimentIdentifier()); + experimentReference.getPermId(), experimentReference.getIdentifier()); } private static String getSessionId(IViewContext<?> viewContext) diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchComponent.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchComponent.java index b107be7a26e2cfa8ce8de402ff8674f7a245e58b..6f3ddba03f18949c07ca61c650eccd0737c2c8c6 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchComponent.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchComponent.java @@ -33,8 +33,8 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCrit import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.MaterialSearchCriteria; /** - * Allows to find wells were selected materials are contained. Used in experiment section panel or - * as a standalone module. + * Allows to specify search criteria for materials contained in wells. Used in experiment section + * panel or as a standalone module. * * @author Tomasz Pylak */ @@ -98,8 +98,7 @@ public class WellSearchComponent extends TabContent { return ExperimentSearchCriteria.createAllExperiments(); } - return ExperimentSearchCriteria.createExperiment(experimentOrNull.getId(), - experimentOrNull.getPermId(), experimentOrNull.getIdentifier()); + return ExperimentSearchCriteria.createExperiment(experimentOrNull); } public WellSearchComponent(IViewContext<IScreeningClientServiceAsync> screeningViewContext, 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 dd9108cb18daea9a0e48f1c5817bcd77b775c85b..17d6625cea89c8eadd78870f02559d824b847a7d 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 @@ -140,8 +140,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> protected void process(Experiment experiment) { ExperimentSearchCriteria experimentCriteria = - ExperimentSearchCriteria.createExperiment(experiment.getId(), - experiment.getPermId(), experiment.getIdentifier()); + ExperimentSearchCriteria.createExperiment(experiment); WellSearchGrid.openTab(screeningViewContext, experimentCriteria, materialSearchCriteria, showCombinedResults); } @@ -363,7 +362,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> private static String tryCreateMaterialDetailsLink(WellContent wellContent, Material material) { - String experimentIdentifier = wellContent.getExperiment().getExperimentIdentifier(); + String experimentIdentifier = wellContent.getExperiment().getIdentifier(); return ScreeningLinkExtractor.tryCreateMaterialDetailsLink(material, experimentIdentifier); } @@ -371,8 +370,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> { ExperimentReference experiment = wellContent.getExperiment(); ExperimentSearchCriteria experimentCriteria = - ExperimentSearchCriteria.createExperiment(experiment.getId(), - experiment.getPermId(), experiment.getExperimentIdentifier()); + ExperimentSearchCriteria.createExperiment(experiment); ClientPluginFactory.openImagingMaterialViewer(material, experimentCriteria, viewContext); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/FeatureVectorSummaryResolver.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ExperimentAnalysisSummaryResolver.java similarity index 66% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/FeatureVectorSummaryResolver.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ExperimentAnalysisSummaryResolver.java index 8e4fb4f41418e61d7e8a997a84f5c6b57acd2408..ee700888df81775dbc5507eb20a9033c199d5779 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/FeatureVectorSummaryResolver.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ExperimentAnalysisSummaryResolver.java @@ -5,21 +5,21 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.Ab import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.FeatureVectorSummaryViewer; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.ExperimentAnalysisSummaryViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; /** - * Locator resolver for plate metadata browser. + * Locator resolver for experiment analysis summary view. * * @author Kaloyan Enimanev */ -public class FeatureVectorSummaryResolver extends AbstractViewLocatorResolver +public class ExperimentAnalysisSummaryResolver extends AbstractViewLocatorResolver { private final IViewContext<IScreeningClientServiceAsync> viewContext; - public FeatureVectorSummaryResolver(IViewContext<IScreeningClientServiceAsync> viewContext) + public ExperimentAnalysisSummaryResolver(IViewContext<IScreeningClientServiceAsync> viewContext) { - super(ScreeningLinkExtractor.FEATURE_VECTOR_SUMMARY_ACTION); + super(ScreeningLinkExtractor.EXPERIMENT_ANALYSIS_SUMMARY_ACTION); this.viewContext = viewContext; } @@ -28,9 +28,9 @@ public class FeatureVectorSummaryResolver extends AbstractViewLocatorResolver String experimentPermId = getMandatoryParameter( locator, - ScreeningLinkExtractor.FEATURE_VECTOR_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY); + ScreeningLinkExtractor.EXPERIMENT_ANALYSIS_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY); - FeatureVectorSummaryViewer.openTab(viewContext, experimentPermId); + ExperimentAnalysisSummaryViewer.openTab(viewContext, experimentPermId); } } \ No newline at end of file diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ImagingMaterialLocatorResolver.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ImagingMaterialLocatorResolver.java index 86dad3e7e5809db6f68c64a0612e5e7cd953f9a8..57c52812dbffa8bb82f39052f38244c492358064 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ImagingMaterialLocatorResolver.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/ImagingMaterialLocatorResolver.java @@ -49,11 +49,13 @@ public class ImagingMaterialLocatorResolver extends MaterialLocatorResolver Map<String, String> parameters) { String experimentIdentifierOrNull = - parameters.get(ScreeningLinkExtractor.MATERIAL_DETAIL_EXPERIMENT_IDENT_PARAMETER_KEY); + parameters + .get(ScreeningLinkExtractor.MATERIAL_DETAIL_EXPERIMENT_IDENT_PARAMETER_KEY); if (experimentIdentifierOrNull == null) { String searchAllExp = - parameters.get(ScreeningLinkExtractor.MATERIAL_DETAIL_SEARCH_ALL_EXPERIMENTS_PARAMETER_KEY); + parameters + .get(ScreeningLinkExtractor.MATERIAL_DETAIL_SEARCH_ALL_EXPERIMENTS_PARAMETER_KEY); if (StringUtils.isBlank(searchAllExp) == false && searchAllExp.equalsIgnoreCase("false") == false) { @@ -133,9 +135,7 @@ public class ImagingMaterialLocatorResolver extends MaterialLocatorResolver protected void process(Experiment experiment) { ExperimentSearchCriteria experimentCriteria = - ExperimentSearchCriteria.createExperiment( - experiment.getId(), experiment.getPermId(), - experiment.getIdentifier()); + ExperimentSearchCriteria.createExperiment(experiment); openImagingMaterialViewer(material, experimentCriteria); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaFeatureSummaryResolver.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaSummaryResolver.java similarity index 83% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaFeatureSummaryResolver.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaSummaryResolver.java index 69bfaa2417e5ce068a69acdb7821ec080eb8fafb..3a964732dbf40fe1eecc82b68d2ca204c3c626d9 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaFeatureSummaryResolver.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/MaterialReplicaSummaryResolver.java @@ -10,20 +10,19 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.Vi import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; -import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.MaterialReplicaFeatureSummaryViewer; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.MaterialReplicaSummaryViewer; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ui.columns.specific.ScreeningLinkExtractor; /** - * Locator resolver for plate metadata browser. + * Locator resolver for material replica summary view. * * @author Kaloyan Enimanev */ -public class MaterialReplicaFeatureSummaryResolver extends AbstractViewLocatorResolver +public class MaterialReplicaSummaryResolver extends AbstractViewLocatorResolver { private final IViewContext<IScreeningClientServiceAsync> viewContext; - public MaterialReplicaFeatureSummaryResolver( - IViewContext<IScreeningClientServiceAsync> viewContext) + public MaterialReplicaSummaryResolver(IViewContext<IScreeningClientServiceAsync> viewContext) { super(ScreeningLinkExtractor.MATERIAL_REPLICA_SUMMARY_ACTION); this.viewContext = viewContext; @@ -43,8 +42,7 @@ public class MaterialReplicaFeatureSummaryResolver extends AbstractViewLocatorRe MaterialIdentifier materialIdentifier = new MaterialIdentifier(materialCode, materialTypeCode); - MaterialReplicaFeatureSummaryViewer.openTab(viewContext, experimentPermId, - materialIdentifier); + MaterialReplicaSummaryViewer.openTab(viewContext, experimentPermId, materialIdentifier); } } \ No newline at end of file diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/ScreeningLinkExtractor.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/ScreeningLinkExtractor.java index 264b99992b7c84b453f783151beb78ea3c0b63ad..9d97f7e079d80e2c58e432d46d9f0041d22f4a88 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/ScreeningLinkExtractor.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/ScreeningLinkExtractor.java @@ -24,6 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.dto.ExperimentIdentifierSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria; @@ -67,9 +68,9 @@ public class ScreeningLinkExtractor extends LinkExtractor public final static boolean WELL_SEARCH_SHOW_COMBINED_RESULTS_DEFAULT = true; - public final static String FEATURE_VECTOR_SUMMARY_ACTION = "FEATURE_VECTOR_SUMMARY"; + public final static String EXPERIMENT_ANALYSIS_SUMMARY_ACTION = "FEATURE_VECTOR_SUMMARY"; - public final static String FEATURE_VECTOR_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY = + public final static String EXPERIMENT_ANALYSIS_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY = "experimentPermId"; public final static String MATERIAL_REPLICA_SUMMARY_ACTION = "MATERIAL_REPLICA_SUMMARY"; @@ -91,8 +92,9 @@ public class ScreeningLinkExtractor extends LinkExtractor public static final String createExperimentAnalysisSummaryBrowserLink(String experimentPermId) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, FEATURE_VECTOR_SUMMARY_ACTION); - url.addParameter(FEATURE_VECTOR_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY, experimentPermId); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, EXPERIMENT_ANALYSIS_SUMMARY_ACTION); + url.addParameter(EXPERIMENT_ANALYSIS_SUMMARY_EXPERIMENT_PERMID_PARAMETER_KEY, + experimentPermId); return tryPrint(url); } @@ -126,7 +128,7 @@ public class ScreeningLinkExtractor extends LinkExtractor MaterialSearchCodesCriteria materialCodesCriteria, Boolean showCombinedResults) { ExperimentPermIdSearchCriteria experimentCriteria = - convertExperimentCriteria(experimentSearchCriteria); + convertToPermIdExperimentCriteria(experimentSearchCriteria); return createWellsSearchLink(experimentCriteria, materialCodesCriteria, showCombinedResults); } @@ -151,7 +153,7 @@ public class ScreeningLinkExtractor extends LinkExtractor } } - private static ExperimentPermIdSearchCriteria convertExperimentCriteria( + private static ExperimentPermIdSearchCriteria convertToPermIdExperimentCriteria( ExperimentSearchCriteria experimentSearchCriteria) { SingleExperimentSearchCriteria expOrNull = experimentSearchCriteria.tryGetExperiment(); @@ -164,6 +166,19 @@ public class ScreeningLinkExtractor extends LinkExtractor } } + private static ExperimentIdentifierSearchCriteria convertToIdentifierExperimentCriteria( + ExperimentSearchCriteria experimentSearchCriteria) + { + SingleExperimentSearchCriteria experiment = experimentSearchCriteria.tryGetExperiment(); + if (experiment != null) + { + return new ExperimentIdentifierSearchCriteria(experiment.getExperimentIdentifier()); + } else + { + return ExperimentIdentifierSearchCriteria.createSearchAll(); + } + } + public static String createWellsSearchLink( final ExperimentPermIdSearchCriteria experimentCriteria, final MaterialSearchCodesCriteria materialCodesCriteria, boolean showCombinedResults) @@ -238,4 +253,13 @@ public class ScreeningLinkExtractor extends LinkExtractor } return url; } + + public static String tryCreateMaterialDetailsLink(Material material, + ExperimentSearchCriteria experimentSearchCriteria) + { + ExperimentIdentifierSearchCriteria experimentCriteria = + convertToIdentifierExperimentCriteria(experimentSearchCriteria); + return tryCreateMaterialDetailsLink(material, experimentCriteria); + } + } 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 14d1f77851a1bfec2bb8a74b1694f06cd90b1086..6f45426bb0b0bac0a1f1c736e8501c8ca0be005d 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 @@ -66,6 +66,7 @@ separator: "Separator", // Gene Viewer // plate_locations: "Plate Locations", +REPLICA_SUMMARY_MATERIAL_SECTION_TITLE: "Assay Summary", // // Plate Material Reviewer diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ExperimentReference.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ExperimentReference.java index cd08b3d60fbbda8e533d2c0c2c9c4e13474bcf5d..2e98b79183291e89803629d71d682eb2226188ba 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ExperimentReference.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ExperimentReference.java @@ -16,7 +16,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto; -import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -27,7 +27,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; * * @author Tomasz Pylak */ -public class ExperimentReference implements ISerializable, IEntityInformationHolderWithPermId +public class ExperimentReference implements ISerializable, IEntityInformationHolderWithIdentifier { private static final long serialVersionUID = ServiceVersionHolder.VERSION; @@ -80,7 +80,8 @@ public class ExperimentReference implements ISerializable, IEntityInformationHol return experimentCode; } - public String getExperimentIdentifier() + /** @return experiment identifier */ + public String getIdentifier() { String SEP = "/"; return SEP + spaceCode + SEP + projectCode + SEP + experimentCode; @@ -104,6 +105,6 @@ public class ExperimentReference implements ISerializable, IEntityInformationHol @Override public String toString() { - return getExperimentIdentifier(); + return getIdentifier(); } } 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 fc74be4a9409c37ef261bb1638edfa44a23f7da4..dfe11f2c730f0466709e3f51e9e5b08284294fd6 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 @@ -22,6 +22,7 @@ import java.util.Arrays; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.common.shared.basic.utils.StringUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; @@ -104,7 +105,14 @@ public class WellSearchCriteria implements ISerializable return new ExperimentSearchCriteria(experiment); } - public static final ExperimentSearchCriteria createExperiment(long experimentId, + public static final ExperimentSearchCriteria createExperiment( + IEntityInformationHolderWithIdentifier experiment) + { + return createExperiment(experiment.getId(), experiment.getPermId(), + experiment.getIdentifier()); + } + + private static final ExperimentSearchCriteria createExperiment(long experimentId, String experimentPermId, String experimentIdentifier) { return new ExperimentSearchCriteria(new SingleExperimentSearchCriteria(experimentId,