Skip to content
Snippets Groups Projects
Commit ca276f55 authored by izabel's avatar izabel
Browse files

[LMS-660] integrate sample registration with plugin architecture

SVN: 9096
parent d41fe39f
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
package ch.systemsx.cisd.openbis.generic.client.web.client.application; 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.application.framework.ITabItem;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType;
/** /**
* The sample view plugin. * The sample view plugin.
...@@ -30,4 +33,9 @@ public interface ISampleViewClientPlugin ...@@ -30,4 +33,9 @@ public interface ISampleViewClientPlugin
* Shows a detailed view of the sample identifier by given <var>sampleIdentifier</var>. * Shows a detailed view of the sample identifier by given <var>sampleIdentifier</var>.
*/ */
public ITabItem createSampleViewer(final String sampleIdentifier); public ITabItem createSampleViewer(final String sampleIdentifier);
/**
* Shows a registration form for samples of type <var>sampleTypeCode</var>.
*/
public Widget createRegistrationClientForSampleType(SampleType sampleTypeCode);
} }
...@@ -29,7 +29,6 @@ import com.google.gwt.user.client.Element; ...@@ -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.GenericViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample_browser.SampleTypeSelectionWidget; 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.generic.client.web.client.dto.SampleType;
import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleRegistrationForm;
/** /**
* @author Izabela Adamczyk * @author Izabela Adamczyk
...@@ -55,7 +54,10 @@ public class SampleRegistrationPanel extends ContentPanel ...@@ -55,7 +54,10 @@ public class SampleRegistrationPanel extends ContentPanel
if (selectedType != null) if (selectedType != null)
{ {
removeAll(); removeAll();
add(new GenericSampleRegistrationForm(viewContext, selectedType)); add(viewContext.getClientPluginFactoryProvider().getClientPluginFactory(
selectedType.getCode()).createViewClientForSampleType(
selectedType.getCode()).createRegistrationClientForSampleType(
selectedType));
layout(); layout();
} }
} }
......
...@@ -18,6 +18,8 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application; ...@@ -18,6 +18,8 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application;
import java.util.Set; 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.IGenericClientServiceAsync;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; 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.IClientPluginFactory;
...@@ -25,6 +27,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleVie ...@@ -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.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; 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.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; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample.GenericSampleViewer;
/** /**
...@@ -101,5 +105,10 @@ public final class ClientPluginFactory extends ...@@ -101,5 +105,10 @@ public final class ClientPluginFactory extends
} }
}; };
} }
public Widget createRegistrationClientForSampleType(SampleType sampleType)
{
return new GenericSampleRegistrationForm(getViewContext(), sampleType);
}
} }
} }
...@@ -19,13 +19,17 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application; ...@@ -19,13 +19,17 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application;
import java.util.Collections; import java.util.Collections;
import java.util.Set; 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.IGenericClientServiceAsync;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; 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.IClientPluginFactory;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleViewClientPlugin; 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.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DummyComponent;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.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.generic.client.web.client.application.SampleTypeCode;
import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync;
...@@ -105,5 +109,10 @@ public final class ClientPluginFactory extends ...@@ -105,5 +109,10 @@ public final class ClientPluginFactory extends
} }
}; };
} }
public Widget createRegistrationClientForSampleType(SampleType sampleTypeCode)
{
return new DummyComponent();
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment