diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ISampleViewClientPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ISampleViewClientPlugin.java index 2c0bb47b7443369de6f31c2a41e2d6adc2dcdb0c..625d329247a32cab2943bd709d1799c28c60e617 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ISampleViewClientPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ISampleViewClientPlugin.java @@ -16,7 +16,10 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; +import com.google.gwt.user.client.ui.Widget; + import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; /** * The sample view plugin. @@ -30,4 +33,9 @@ public interface ISampleViewClientPlugin * Shows a detailed view of the sample identifier by given <var>sampleIdentifier</var>. */ public ITabItem createSampleViewer(final String sampleIdentifier); + + /** + * Shows a registration form for samples of type <var>sampleTypeCode</var>. + */ + public Widget createRegistrationClientForSampleType(SampleType sampleTypeCode); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java index 739ee11fa495b74abb3ad2d7046ef13b41af1b7f..4256cb34a43154a3c4bc6d79c28c74c4389fe832 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java @@ -29,7 +29,6 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample_browser.SampleTypeSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; -import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleRegistrationForm; /** * @author Izabela Adamczyk @@ -55,7 +54,10 @@ public class SampleRegistrationPanel extends ContentPanel if (selectedType != null) { removeAll(); - add(new GenericSampleRegistrationForm(viewContext, selectedType)); + add(viewContext.getClientPluginFactoryProvider().getClientPluginFactory( + selectedType.getCode()).createViewClientForSampleType( + selectedType.getCode()).createRegistrationClientForSampleType( + selectedType)); layout(); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java index 239b8c3ccc9a69dc9061a04fc286ef42aad533d4..69c900b33d3129ed0b5c33a899af0c020586aee6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java @@ -18,6 +18,8 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application; import java.util.Set; +import com.google.gwt.user.client.ui.Widget; + import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IClientPluginFactory; @@ -25,6 +27,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleVie import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleRegistrationForm; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleViewer; /** @@ -101,5 +105,10 @@ public final class ClientPluginFactory extends } }; } + + public Widget createRegistrationClientForSampleType(SampleType sampleType) + { + return new GenericSampleRegistrationForm(getViewContext(), sampleType); + } } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java index 54e8616feffc94f46fe2914f5476287bcddf18bf..5d53d86496fae83f8b20d598881da41f88f1b059 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java @@ -19,13 +19,17 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application; import java.util.Collections; import java.util.Set; +import com.google.gwt.user.client.ui.Widget; + import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleViewClientPlugin; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DummyComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.SampleTypeCode; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; @@ -105,5 +109,10 @@ public final class ClientPluginFactory extends } }; } + + public Widget createRegistrationClientForSampleType(SampleType sampleTypeCode) + { + return new DummyComponent(); + } } }