diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java index 1eb3749f924ff0cb57fb916257f2ea768163af32..91fb45ebce81d867bc888dbe9e46718f7f95e121 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java @@ -60,15 +60,9 @@ abstract public class TabContent extends ContentPanel setLayout(new FitLayout()); } - public void setDisplayID(IDisplayTypeIDGenerator generator, String suffix) + public void setDisplayID(IDisplayTypeIDGenerator generator) { - if (suffix != null) - { - this.displayId = generator.createID(suffix); - } else - { - this.displayId = generator.createID(); - } + this.displayId = generator.createID(); } public String getDisplayID() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java index ac283edc7b80e337c92db9d6f69aed9c33266069..25b9faf114c11314cdf99a1a5d772fd4f321b2e1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java @@ -62,7 +62,7 @@ public class DisplaySettingsManager { private final long time; - private final Object modifier; // grid or section panel + private final Object modifier; // grid or tab panel public static Modification create(Object modifier) { @@ -90,9 +90,8 @@ public class DisplaySettingsManager private final Map<String, Modification> columnModifications = new HashMap<String, Modification>(); - /** last display settings {@link Modification} for sections */ - private final Map<String, Modification> sectionModifications = - new HashMap<String, Modification>(); + /** last display settings {@link Modification} for tabs */ + private final Map<String, Modification> tabModifications = new HashMap<String, Modification>(); private final DisplaySettings displaySettings; @@ -359,9 +358,9 @@ public class DisplaySettingsManager .getModifier(), delayMs); } - public void storeSectionSettings(String displayTypeID, boolean display, Object modifier) + public void storeTabSettings(String tabGroupDisplayID, String tabDisplayID, Object modifier) { - updateSectionSettings(displayTypeID, display, modifier); + updateTabSettings(tabGroupDisplayID, tabDisplayID, modifier); updater.executeDelayed(QUITE_TIME_BEFORE_SETTINGS_SAVED_MS); } @@ -437,34 +436,34 @@ public class DisplaySettingsManager } /** - * @returns section settings for given display id - is the section visible or not<br> + * @returns tab settings for given panel - which tab should be selected<br> * <br> * NOTE: Returned value should be used read only, or modification time should be set * manually after a modification. */ @SuppressWarnings("deprecation") - public final Boolean getSectionSettings(String sectionDisplayTypeID) + public final String getTabSettings(String tabGroupDisplayTypeID) { - return displaySettings.getSectionSettings().get(sectionDisplayTypeID); + return displaySettings.getTabSettings().get(tabGroupDisplayTypeID); } /** * update section settings for given display id (modification date is updated automatically) */ @SuppressWarnings("deprecation") - private final void updateSectionSettings(String sectionDisplayTypeID, Boolean newSettings, + private final void updateTabSettings(String tabGroupDisplayID, String selectedTabDisplayID, Object modifier) { - displaySettings.getSectionSettings().put(sectionDisplayTypeID, newSettings); - sectionModifications.put(sectionDisplayTypeID, Modification.create(modifier)); + displaySettings.getTabSettings().put(tabGroupDisplayID, selectedTabDisplayID); + tabModifications.put(tabGroupDisplayID, Modification.create(modifier)); } /** - * @returns last section setting {@link Modification} or null if no modification was yet made + * @returns last tab setting {@link Modification} or null if no modification was yet made */ - public final Modification tryGetLastSectionSettingsModification(String sectionDisplayTypeID) + public final Modification tryGetLastTabSettingsModification(String tabDisplayTypeID) { - return sectionModifications.get(sectionDisplayTypeID); + return tabModifications.get(tabDisplayTypeID); } // TODO work in progress, ignore for now. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java index 62160308b22dfd6e6ec41432e56ad387ba814136..49e0a68f74ecdfad581704d49e475c169fbde3e0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplayTypeIDGenerator.java @@ -1,4 +1,5 @@ /* + * Copyright 2009 ETH Zuerich, CISD * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -91,6 +92,14 @@ public enum DisplayTypeIDGenerator implements IDisplayTypeIDGenerator SAMPLE_TYPE_BROWSER("sample-type-browser"), + GENERIC_DATASET_VIEWER("generic_dataset_viewer"), + + GENERIC_EXPERIMENT_VIEWER("generic_experiment_viewer"), + + GENERIC_SAMPLE_VIEWER("generic_sample_viewer"), + + GENERIC_MATERIAL_VIEWER("generic_material_viewer"), + ; private final String genericNameOrPrefix; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java index 0e975f9370f67d1d668143045a1fcd7be94d5d45..e07af1db226b218d24a70d5bc14b37937406c1bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java @@ -38,8 +38,6 @@ public class ModulesSectionsManager private IEntityInformationHolderWithIdentifier entity; - private String displayIdSuffix; - private List<IModule> modules; /** @@ -47,11 +45,10 @@ public class ModulesSectionsManager * {@link #initialize(List)}. */ @SuppressWarnings("hiding") - public void initialize(final SectionsPanel container, final String displayIdSuffix, + public void initialize(final SectionsPanel container, final IEntityInformationHolderWithIdentifier entity) { this.container = container; - this.displayIdSuffix = displayIdSuffix; this.entity = entity; if (modules != null) { @@ -61,7 +58,7 @@ public class ModulesSectionsManager /** * Sets the values of chosen fields. Adds module sections to given container if called after - * {@link #initialize(SectionsPanel, String, IEntityInformationHolderWithIdentifier)}. + * {@link #initialize(SectionsPanel, IEntityInformationHolderWithIdentifier)}. */ @SuppressWarnings("hiding") public void initialize(final List<IModule> modules) @@ -80,8 +77,7 @@ public class ModulesSectionsManager final Collection<? extends TabContent> sections = module.getSections(entity); for (final TabContent panel : sections) { - panel.setDisplayID(DisplayTypeIDGenerator.MODULE_SECTION, module.getName() + "-" - + displayIdSuffix); + panel.setDisplayID(DisplayTypeIDGenerator.MODULE_SECTION); container.addPanel(panel); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java index 830ca88dd9b650367f2469cc947a4994fe9bdb40..f34cfaed1ec4ccbfe683c571d671b0230953cb8a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java @@ -17,6 +17,7 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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.IDisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplaySettingsManager.Modification; /** @@ -33,6 +34,8 @@ public class SectionsPanel extends LayoutContainer private final TabPanel toolbar; + private String displayId; + private final IViewContext<ICommonClientServiceAsync> viewContext; public SectionsPanel(IViewContext<ICommonClientServiceAsync> viewContext) @@ -40,6 +43,7 @@ public class SectionsPanel extends LayoutContainer this.viewContext = viewContext; setLayout(new FillLayout()); toolbar = new TabPanel(); + toolbar.setAutoSelect(false); super.add(toolbar); addRefreshDisplaySettingsListener(); } @@ -64,34 +68,25 @@ public class SectionsPanel extends LayoutContainer lastRefreshCheckTime = System.currentTimeMillis(); } - /** checks if update of section settings and refresh of layout is needed */ + /** checks if update of tab settings and refresh of layout is needed */ private boolean isRefreshNeeded() { - boolean result = false; - for (SectionElement sectionElement : elements) + if (lastRefreshCheckTime == null + || isModificationDoneInAnotherViewSinceLastRefresh()) { - if (lastRefreshCheckTime == null) - { - // No need to refresh when sections are displayed for the first time. - return false; - } else if (isModificationDoneInAnotherViewSinceLastRefresh(sectionElement)) - { - // Section settings have been modified in another view of the - // same type. Refresh of section settings is needed. - return true; - } - // do nothing - other sections may have been modified + // Refresh when panel is displayed for the first time or if + // tab settings have been modified in another view of the + // same type. + return true; } - return result; + return false; } - private boolean isModificationDoneInAnotherViewSinceLastRefresh( - SectionElement element) + private boolean isModificationDoneInAnotherViewSinceLastRefresh() { - final String sectionID = element.getPanel().getDisplayID(); final Modification lastModificationOrNull = viewContext.getDisplaySettingsManager() - .tryGetLastSectionSettingsModification(sectionID); + .tryGetLastTabSettingsModification(getDisplayID()); return lastModificationOrNull != null && lastModificationOrNull.getModifier().equals(SectionsPanel.this) == false && lastModificationOrNull.getTime() > lastRefreshCheckTime; @@ -102,15 +97,20 @@ public class SectionsPanel extends LayoutContainer { for (SectionElement sectionElement : elements) { - final String sectionID = sectionElement.getPanel().getDisplayID(); - Boolean newSettings = - viewContext.getDisplaySettingsManager().getSectionSettings( - sectionID); - if (newSettings != null) + final String thisTabID = sectionElement.getPanel().getDisplayID(); + String tabToActivateID = + viewContext.getDisplaySettingsManager().getTabSettings( + getDisplayID()); + if (tabToActivateID != null && tabToActivateID.equals(thisTabID)) { - // sectionElement.getButton().toggle(newSettings); + toolbar.setSelection(sectionElement); + return; } } + if (elements.size() > 0) + { + toolbar.setSelection(elements.get(0)); + } } }); @@ -118,13 +118,13 @@ public class SectionsPanel extends LayoutContainer public void addPanel(final TabContent panel) { + final SectionElement element = new SectionElement(panel, viewContext); // sections will be disposed when section panel is removed, not when they are hidden // (see onDetach()) panel.disableAutoDisposeComponents(); elements.add(element); addToToolbar(element); - // panel.setContentVisible(true); } @Override @@ -158,7 +158,7 @@ public class SectionsPanel extends LayoutContainer private TabContent panel; public SectionElement(final TabContent panel, - IViewContext<ICommonClientServiceAsync> viewContext) + final IViewContext<ICommonClientServiceAsync> viewContext) { setClosable(false); setLayout(new FitLayout()); @@ -166,12 +166,15 @@ public class SectionsPanel extends LayoutContainer setText(panel.getHeading()); panel.setHeaderVisible(false); add(panel); + addListener(Events.Select, new Listener<TabPanelEvent>() { public void handleEvent(TabPanelEvent be) { panel.setContentVisible(true); layout(); + viewContext.getDisplaySettingsManager().storeTabSettings(getDisplayID(), + panel.getDisplayID(), SectionsPanel.this); } }); } @@ -187,4 +190,26 @@ public class SectionsPanel extends LayoutContainer } } + public String getDisplayID() + { + if (displayId == null) + { + throw new IllegalStateException("Undefined display ID"); + } else + { + return displayId; + } + } + + public void setDisplayID(IDisplayTypeIDGenerator generator, String suffix) + { + if (suffix != null) + { + this.displayId = generator.createID(suffix); + } else + { + this.displayId = generator.createID(); + } + } + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DisplaySettings.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DisplaySettings.java index bb96b0bfd7dec94ae77b2392da2d726e949c5225..c5d5e6229ff08d3c0800519845acfd7a89b76333 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DisplaySettings.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DisplaySettings.java @@ -43,7 +43,10 @@ public class DisplaySettings implements Serializable, IsSerializable private Map<String, List<ColumnSetting>> columnSettings = new LinkedHashMap<String, List<ColumnSetting>>(); - private Map<String, Boolean> sectionSettings = new HashMap<String, Boolean>(); + @SuppressWarnings("unused") + private Map<String, Boolean> sectionSettings; + + private Map<String, String> tabSettings = new HashMap<String, String>(); private Map<String, String> dropDownSettings = new HashMap<String, String>(); @@ -65,13 +68,13 @@ public class DisplaySettings implements Serializable, IsSerializable /** @deprecated Should be used only by DisplaySettingsManager. */ @Deprecated - public Map<String, Boolean> getSectionSettings() + public Map<String, String> getTabSettings() { - if (sectionSettings == null) + if (tabSettings == null) { - sectionSettings = new HashMap<String, Boolean>(); + tabSettings = new HashMap<String, String>(); } - return sectionSettings; + return tabSettings; } /** @deprecated Should be used only by DisplaySettingsManager. */ @@ -112,9 +115,9 @@ public class DisplaySettings implements Serializable, IsSerializable } @SuppressWarnings("unused") - private final void setSectionSettings(Map<String, Boolean> sectionSettings) + private final void setTabSettings(Map<String, String> tabSettings) { - this.sectionSettings = sectionSettings; + this.tabSettings = tabSettings; } @SuppressWarnings("unused") diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java index 8febfb99efe87fa31c426f798ec5bef747f8aea8..91d2d102611bd9fa9c69a5314f4c0cf5e4f7ce9d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java @@ -170,6 +170,7 @@ abstract public class GenericDataSetViewer extends AbstractViewer<ExternalData> { final SectionsPanel container = new SectionsPanel(viewContext.getCommonViewContext()); displayIdSuffix = getDisplayIdSuffix(dataset.getDataSetType().getCode()); + container.setDisplayID(DisplayTypeIDGenerator.GENERIC_DATASET_VIEWER, displayIdSuffix); List<TabContent> additionalPanels = createAdditionalSectionPanels(); for (TabContent panel : additionalPanels) @@ -178,22 +179,20 @@ abstract public class GenericDataSetViewer extends AbstractViewer<ExternalData> } // parents final TabContent parentsSection = new DataSetParentsSection(viewContext, dataset); - parentsSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_PARENTS_SECTION, - displayIdSuffix); + parentsSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_PARENTS_SECTION); container.addPanel(parentsSection); // children final TabContent childrenSection = new DataSetChildrenSection(viewContext, dataset); - childrenSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_CHILDREN_SECTION, - displayIdSuffix); + childrenSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_CHILDREN_SECTION); container.addPanel(childrenSection); // data final TabContent dataSection = new DataViewSection(viewContext, dataset); - dataSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_DATA_SECTION, displayIdSuffix); + dataSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_DATA_SECTION); container.addPanel(dataSection); // container.layout(); - moduleSectionManager.initialize(container, displayIdSuffix, dataset); + moduleSectionManager.initialize(container, dataset); return container; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java index c6fd45d4aa73823500b1732e807d325150e50c3a..a3ca048ff2e8a4a9ce06e58fb85c8a9b88b5ba28 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java @@ -147,7 +147,7 @@ public class GenericExperimentViewer extends AbstractViewer<Experiment> implemen this.propertiesPanelOrNull = new ExperimentPropertiesPanel(experiment, viewContext, this); add(propertiesPanelOrNull, createLeftBorderLayoutData()); - String displayIdSuffix = getDisplayIdSuffix(this.experimentType.getCode()); + final String displayIdSuffix = getDisplayIdSuffix(this.experimentType.getCode()); configureLeftPanel(displayIdSuffix); @@ -161,11 +161,10 @@ public class GenericExperimentViewer extends AbstractViewer<Experiment> implemen public void execute() { remove(loadingLabel); - String displayIdPrefix = getDisplayIdSuffix(experimentType.getCode()); - GenericExperimentViewer.this.rightPanelSectionsOrNull = - createRightPanel(displayIdPrefix); - SectionsPanel rightPanel = layoutSections(rightPanelSectionsOrNull); - moduleSectionManager.initialize(rightPanel, displayIdPrefix, experiment); + GenericExperimentViewer.this.rightPanelSectionsOrNull = createRightPanel(); + SectionsPanel rightPanel = + layoutSections(rightPanelSectionsOrNull, displayIdSuffix); + moduleSectionManager.initialize(rightPanel, experiment); add(rightPanel, createRightBorderLayoutData()); layout(); } @@ -235,25 +234,24 @@ public class GenericExperimentViewer extends AbstractViewer<Experiment> implemen return GENERIC_EXPERIMENT_VIEWER + "-" + suffix; } - private List<DisposableTabContent> createRightPanel(final String displayIdSuffix) + private List<DisposableTabContent> createRightPanel() { List<DisposableTabContent> allPanels = new ArrayList<DisposableTabContent>(); - allPanels.addAll(createAdditionalBrowserSectionPanels(displayIdSuffix)); + allPanels.addAll(createAdditionalBrowserSectionPanels()); final ExperimentSamplesSection sampleSection = new ExperimentSamplesSection(viewContext, experimentType, experimentId); - sampleSection.setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION, - displayIdSuffix); + sampleSection.setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION); allPanels.add(sampleSection); final DisposableTabContent dataSection = createExperimentDataSetSection(); - dataSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_SECTION, displayIdSuffix); + dataSection.setDisplayID(DisplayTypeIDGenerator.DATA_SET_SECTION); allPanels.add(dataSection); final AttachmentVersionsSection attachmentsSection = createAttachmentsSection(); - attachmentsSection.setDisplayID(DisplayTypeIDGenerator.ATTACHMENT_SECTION, displayIdSuffix); + attachmentsSection.setDisplayID(DisplayTypeIDGenerator.ATTACHMENT_SECTION); allPanels.add(attachmentsSection); return allPanels; @@ -272,9 +270,11 @@ public class GenericExperimentViewer extends AbstractViewer<Experiment> implemen }; } - private SectionsPanel layoutSections(List<DisposableTabContent> allPanels) + private SectionsPanel layoutSections(List<DisposableTabContent> allPanels, + String displayIdSuffix) { final SectionsPanel container = new SectionsPanel(viewContext.getCommonViewContext()); + container.setDisplayID(DisplayTypeIDGenerator.GENERIC_EXPERIMENT_VIEWER, displayIdSuffix); for (DisposableTabContent panel : allPanels) { container.addPanel(panel); @@ -283,7 +283,7 @@ public class GenericExperimentViewer extends AbstractViewer<Experiment> implemen return container; } - protected List<DisposableTabContent> createAdditionalBrowserSectionPanels(String displyIdSuffix) + protected List<DisposableTabContent> createAdditionalBrowserSectionPanels() { return Collections.emptyList(); } 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 4bc63bb088e229830e344365a14fa609c05b5bf8..16549e59aa4ad612150aa7b8fc871aec88f49297 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 @@ -37,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractDatabaseModificationObserverWithCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserverWithMainObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.PropertyTypeRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractViewer; @@ -129,13 +130,14 @@ abstract public class GenericMaterialViewer extends AbstractViewer<Material> imp displayIdSuffix = getDisplayIdSuffix(material.getMaterialType().getCode()); final SectionsPanel container = new SectionsPanel(viewContext.getCommonViewContext()); + container.setDisplayID(DisplayTypeIDGenerator.GENERIC_MATERIAL_VIEWER, displayIdSuffix); List<TabContent> additionalPanels = createAdditionalSectionPanels(); for (TabContent panel : additionalPanels) { container.addPanel(panel); } container.layout(); - moduleSectionManager.initialize(container, displayIdSuffix, material); + moduleSectionManager.initialize(container, material); return container; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index f9e474ea6536ba671ac15edd8a17888a5c930f65..52e592d69bb6d5cabe542eb29162f0b0dc0e2669 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -193,6 +193,7 @@ abstract public class GenericSampleViewer extends AbstractViewer<Sample> impleme displayIdSuffix = getDisplayIdSuffix(generator.getSampleType().getCode()); final SectionsPanel container = new SectionsPanel(viewContext.getCommonViewContext()); + container.setDisplayID(DisplayTypeIDGenerator.GENERIC_SAMPLE_VIEWER, displayIdSuffix); List<TabContent> additionalPanels = createAdditionalSectionPanels(); for (TabContent panel : additionalPanels) { @@ -200,34 +201,31 @@ abstract public class GenericSampleViewer extends AbstractViewer<Sample> impleme } // Contained samples containerSamplesSection = new ContainerSamplesSection(viewContext, generator); - containerSamplesSection.setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION, - displayIdSuffix); + containerSamplesSection.setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION); container.addPanel(containerSamplesSection); // Derived samples derivedSamplesSection = new DerivedSamplesSection(viewContext, generator); - derivedSamplesSection.setDisplayID(DisplayTypeIDGenerator.DERIVED_SAMPLES_SECTION, - displayIdSuffix); + derivedSamplesSection.setDisplayID(DisplayTypeIDGenerator.DERIVED_SAMPLES_SECTION); container.addPanel(derivedSamplesSection); // Parent samples parentSamplesSection = new ParentSamplesSection(viewContext, generator); - parentSamplesSection.setDisplayID(DisplayTypeIDGenerator.PARENT_SAMPLES_SECTION, - displayIdSuffix); + parentSamplesSection.setDisplayID(DisplayTypeIDGenerator.PARENT_SAMPLES_SECTION); container.addPanel(parentSamplesSection); // Data Sets CheckBox showOnlyDirectlyConnectedCheckBox = createShowOnlyDirectlyConnectedCheckBox(); dataSetBrowser = new SampleDataSetsSection(viewContext, showOnlyDirectlyConnectedCheckBox, sampleId, generator.getSampleType()); - dataSetBrowser.setDisplayID(DisplayTypeIDGenerator.DATA_SET_SECTION, displayIdSuffix); + dataSetBrowser.setDisplayID(DisplayTypeIDGenerator.DATA_SET_SECTION); container.addPanel(dataSetBrowser); // Attachments attachmentsSection = createAttachmentsSection(generator); - attachmentsSection.setDisplayID(DisplayTypeIDGenerator.ATTACHMENT_SECTION, displayIdSuffix); + attachmentsSection.setDisplayID(DisplayTypeIDGenerator.ATTACHMENT_SECTION); container.addPanel(attachmentsSection); container.layout(); - moduleSectionManager.initialize(container, displayIdSuffix, generator); + moduleSectionManager.initialize(container, generator); return container; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java index 4d7c14bd0290c4e53d18f1c9976c20cb67518fd6..025a4e306e369c095b348d9930eefe850b87fbe0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java @@ -28,27 +28,26 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; import ch.systemsx.cisd.openbis.generic.server.ICommonServerForInternalUse; import ch.systemsx.cisd.openbis.generic.server.util.TestInitializer; -import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DisplaySettings; /** - * - * * @author Franz-Josef Elmer */ @ContextConfiguration(locations = "classpath:applicationContext.xml") public abstract class SystemTestCase extends AbstractTestNGSpringContextTests { protected ICommonServerForInternalUse commonServer; + protected ICommonClientService commonClientService; + protected MockHttpServletRequest request; - + @BeforeSuite public void beforeSuite() { TestInitializer.init(); } - + /** * Sets a {@link MockHttpServletRequest} for the specified context provider */ @@ -58,7 +57,7 @@ public abstract class SystemTestCase extends AbstractTestNGSpringContextTests request = new MockHttpServletRequest(); contextProvider.setRequest(request); } - + /** * Sets <code>commonServer</code>. * <p> @@ -70,7 +69,7 @@ public abstract class SystemTestCase extends AbstractTestNGSpringContextTests { this.commonServer = commonServer; } - + /** * Sets <code>commonClientService</code>. * <p> @@ -82,7 +81,7 @@ public abstract class SystemTestCase extends AbstractTestNGSpringContextTests { this.commonClientService = commonClientService; } - + protected SessionContext logIntoCommonClientService() { SessionContext context = commonClientService.tryToLogin("test", "a"); diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ExperimentViewer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ExperimentViewer.java index 18aa8e1fc4c8205e0fd8bb3d3473fdfbb4ee080e..f777f51afa992dbf3b869e75e8324cdcbdc8c0c7 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ExperimentViewer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ExperimentViewer.java @@ -56,8 +56,7 @@ public class ExperimentViewer extends GenericExperimentViewer } @Override - protected List<DisposableTabContent> createAdditionalBrowserSectionPanels( - String displyIdSuffix) + protected List<DisposableTabContent> createAdditionalBrowserSectionPanels() { DisposableTabContent section = new DisposableTabContent(specificViewContext.getMessage(Dict.PROTEINS_SECTION), @@ -70,7 +69,7 @@ public class ExperimentViewer extends GenericExperimentViewer experimentType, experiment); } }; - section.setDisplayID(DisplayTypeIDGenerator.PROTEIN_SECTION, displyIdSuffix); + section.setDisplayID(DisplayTypeIDGenerator.PROTEIN_SECTION); return Collections.<DisposableTabContent> singletonList(section); } diff --git a/screening/etc/service.properties b/screening/etc/service.properties index 3cc4a14d5cba82ff87da98a43941e9336f16644e..550ac222008586194b11b5cc30770b3eb2ab1ef3 100644 --- a/screening/etc/service.properties +++ b/screening/etc/service.properties @@ -97,7 +97,7 @@ imaging-db.scriptFolder = source/sql # --------------------------------------------------------------------------- # Comma separated names of reporting plugins. Each plugin should have configuration properties prefixed with its name. -reporting-plugins = default-plate-image-analysis, plate-image-analysis-graph +reporting-plugins = default-plate-image-analysis, plate-image-analysis-graph, csv-viewer default-plate-image-analysis.label = Image Analysis Results default-plate-image-analysis.dataset-types = HCS_IMAGE_ANALYSIS_DATA, HCS_ANALYSIS_PER_GENE @@ -130,6 +130,13 @@ tabular-data-graph-servlet.properties-file = etc/tabular-data-graph.properties screening-dss-api-exporter-servlet.class = ch.systemsx.cisd.openbis.dss.generic.server.DssScreeningApiServlet screening-dss-api-exporter-servlet.path = /rmi-datastore-server-screening-api-v1/* + +csv-viewer.label = CSV View +csv-viewer.dataset-types = HCS_IMAGE_ANALYSIS_DATA +csv-viewer.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.TSVViewReportingPlugin +csv-viewer.separator = , + + # --------------------------------------------------------------------------- maintenance-plugins=data-set-clean-up @@ -163,7 +170,7 @@ data-set-file-name-entity-separator = _ quiet-period = 3 # code of the default space in openBIS to which the data will be imported -import-space-code = DEMO +import-space-code = TEST # Comma separated names of processing threads. Each thread should have configuration properties prefixed with its name. # E.g. 'code-extractor' property for the thread 'my-etl' should be specified as 'my-etl.code-extractor' @@ -223,12 +230,12 @@ split-channels-images.incoming-dir = ${incoming-root-dir}/incoming-images-split- split-channels-images.incoming-data-completeness-condition = auto-detection # The extractor class to use for code extraction -split-channels-images.data-set-info-extractor = ch.systemsx.cisd.etlserver.DefaultDataSetInfoExtractor -split-channels-images.data-set-info-extractor.entity-separator = ${data-set-file-name-entity-separator} -split-channels-images.data-set-info-extractor.index-of-sample-code = -1 -split-channels-images.data-set-info-extractor.index-of-data-producer-code = 1 -split-channels-images.data-set-info-extractor.index-of-data-production-date = 0 -split-channels-images.data-set-info-extractor.space-code = ${import-space-code} +split-channels-images.data-set-info-extractor = ch.systemsx.cisd.etlserver.DataSetInfoExtractorWithFileNameProperty +split-channels-images.data-set-info-extractor.file-name-property-code = EXTERNAL_IDENTIFIER +split-channels-images.data-set-info-extractor.extractor = ch.systemsx.cisd.openbis.dss.etl.biozentrum.BZDataSetInfoExtractor +split-channels-images.data-set-info-extractor.extractor.space-code = ${import-space-code} +split-channels-images.data-set-info-extractor.extractor.project-code = DEFAULT +split-channels-images.data-set-info-extractor.extractor.plate-geometry = 384_WELLS_16X24 # The extractor class to use for type extraction split-channels-images.type-extractor = ch.systemsx.cisd.etlserver.SimpleTypeExtractor @@ -237,13 +244,16 @@ split-channels-images.type-extractor.locator-type = RELATIVE_LOCATION split-channels-images.type-extractor.data-set-type = HCS_IMAGE split-channels-images.type-extractor.is-measured = true -split-channels-images.storage-processor = ch.systemsx.cisd.openbis.dss.etl.PlateStorageProcessor -split-channels-images.storage-processor.generate-thumbnails = false -split-channels-images.storage-processor.channel-codes = GFP, DAPI -split-channels-images.storage-processor.channel-labels = Gfp, Dapi -split-channels-images.storage-processor.well_geometry = 3x3 -split-channels-images.storage-processor.file-extractor = ch.systemsx.cisd.openbis.dss.etl.HCSImageFileExtractor -split-channels-images.storage-processor.data-source = imaging-db + +split-channels-images.storage-processor = ch.systemsx.cisd.openbis.dss.etl.biozentrum.LinkingStorageProcessor +split-channels-images.storage-processor.target-dir = ${root-dir}/links +split-channels-images.storage-processor.processor = ch.systemsx.cisd.openbis.dss.etl.PlateStorageProcessor +split-channels-images.storage-processor.processor.generate-thumbnails = true +split-channels-images.storage-processor.processor.channel-names = DAPI, GFP, Cy3, Cy5 +split-channels-images.storage-processor.processor.well_geometry = 4x3 +split-channels-images.storage-processor.processor.file-extractor = ch.systemsx.cisd.openbis.dss.etl.biozentrum.HCSImageFileExtractor +split-channels-images.storage-processor.processor.data-source = imaging-db +split-channels-images.storage-processor.processor.tile_mapping = -1,1,2;3,4,5;6,7,8;9,10,-1 # --------------------------------------------------------------------------- diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentPlateLocationsSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentPlateLocationsSection.java index 492bf1f5bcd630f127fe70a5ea5ef3554be96871..f000886801cd12befea6e73392dead5ce0f3d00b 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentPlateLocationsSection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentPlateLocationsSection.java @@ -66,7 +66,7 @@ public class ExperimentPlateLocationsSection extends TabContent new CheckBoxField(screeningViewContext.getMessage(Dict.EXACT_MATCH_ONLY), false); exactMatchOnly.setBoxLabel(screeningViewContext.getMessage(Dict.EXACT_MATCH_ONLY)); exactMatchOnly.setValue(true); - setDisplayID(DisplayTypeIDGenerator.PLATE_MATERIAL_REVIEWER, ID_SUFFIX); + setDisplayID(DisplayTypeIDGenerator.PLATE_MATERIAL_REVIEWER); screeningViewContext.getCommonService().listMaterialTypes( new AbstractAsyncCallback<List<MaterialType>>(screeningViewContext) { 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 6c481100b2142f4cb91977d03c454e62878e16ad..d47566f1bdaa3262e4cb1c06a99fa468aa83cefd 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 @@ -29,7 +29,7 @@ public class ExperimentWellMaterialsSection extends DisposableTabContent screeningViewContext); this.screeningViewContext = screeningViewContext; this.experiment = experiment; - setDisplayID(DisplayTypeIDGenerator.PLATE_MATERIAL_BROWSER, ID_SUFFIX); + setDisplayID(DisplayTypeIDGenerator.PLATE_MATERIAL_BROWSER); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutDatasetSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutDatasetSection.java index 0f69914dc8d5e5adcdb5012fa1f3955983a6a02a..d31b32d34b6b87b7ca4770bfe11a2e2e347186dd 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutDatasetSection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutDatasetSection.java @@ -51,7 +51,7 @@ public class PlateLayoutDatasetSection extends TabContent super("Plate Layout", viewContext); this.viewContext = viewContext; this.datasetId = datasetId; - setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION, ID_SUFFIX); + setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutSampleSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutSampleSection.java index e57fcc901cf1ba3538cc49c2fbf969999b522eb5..50f08894f8159251af6e7c3031beb5f0dc116380 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutSampleSection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayoutSampleSection.java @@ -61,7 +61,7 @@ public class PlateLayoutSampleSection extends TabContent super("Plate Layout", viewContext); this.viewContext = viewContext; this.sampleId = sampleId; - setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION, ID_SUFFIX); + setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLocationsMaterialSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLocationsMaterialSection.java index e2dc5dea4eaefaa39d4fffefd3c92238b74ba24b..5eaf6ba06ec84909d2f05d52c05e8f3aa204616d 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLocationsMaterialSection.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLocationsMaterialSection.java @@ -17,7 +17,6 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterials */ class PlateLocationsMaterialSection extends TabContent { - private static final String ID_SUFFIX = "LocationsSection"; private final IDisposableComponent reviewer; @@ -33,7 +32,7 @@ class PlateLocationsMaterialSection extends TabContent this.reviewer = PlateMaterialReviewer.create(screeningViewContext, experimentCriteriaOrNull, materialId); - setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION, ID_SUFFIX); + setDisplayID(DisplayTypeIDGenerator.CONTAINER_SAMPLES_SECTION); } @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/PlateMaterialLocationsLoader.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/PlateMaterialLocationsLoader.java index cd88d1cb6c18a104ffa87e23218b41ae157c61cb..8ba5aef55c65aa7d96cb8b4ba5cf471347f80ba9 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/PlateMaterialLocationsLoader.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/PlateMaterialLocationsLoader.java @@ -65,12 +65,12 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetReferen import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ExperimentReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImageParameters; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria.ExperimentSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria.MaterialSearchCodesCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria.MaterialSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria.SingleExperimentSearchCriteria; -import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; -import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; /** * Loades selected wells content: metadata and (if available) image dataset and feature vectors. @@ -80,8 +80,8 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; @Friend(toClasses = IScreeningQuery.class) public class PlateMaterialLocationsLoader { - private final static Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, - PlateMaterialLocationsLoader.class); + private final static Logger operationLog = + LogFactory.getLogger(LogCategory.OPERATION, PlateMaterialLocationsLoader.class); /** * Finds wells containing the specified material and belonging to the specified experiment. @@ -327,8 +327,8 @@ public class PlateMaterialLocationsLoader PlateImageParameters imageParameters = imageParams.get(imageDataset.getCode()); if (imageParameters != null) { - return DatasetImagesReference.create( - ScreeningUtils.createDatasetReference(imageDataset), imageParameters); + return DatasetImagesReference.create(ScreeningUtils + .createDatasetReference(imageDataset), imageParameters); } else { operationLog.error("Cannot find image parameters for dataset: " @@ -456,7 +456,7 @@ public class PlateMaterialLocationsLoader } criteria.setCriteria(listOfCriteria); criteria.setConnection(SearchCriteriaConnection.MATCH_ANY); - criteria.setUseWildcardSearchMode(codesCriteria.isExactMatchOnly());// FIXME + criteria.setUseWildcardSearchMode(codesCriteria.isExactMatchOnly()); return ArrayUtils.toPrimitive(daoFactory.getHibernateSearchDAO().searchForEntityIds( criteria, ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind.MATERIAL)