diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java index ca845babddb501a35d2979cc3fec0f6067b535a9..a4ea41631590d1763ac2e17e6bae00221ad06876 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java @@ -19,10 +19,12 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentAndReferenceCriteria; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; @@ -83,5 +85,12 @@ public interface IPhosphoNetXClientService extends IClientService TableExportCriteria<SampleWithPropertiesAndAbundance> exportCriteria) throws UserFailureException; + public ResultSet<Sample> listRawDataSamples(IResultSetConfig<String, Sample> criteria) + throws UserFailureException; + + public String prepareExportRawDataSamples(TableExportCriteria<Sample> exportCriteria) + throws UserFailureException; + public void copyRawData(long[] rawDataSampleIDs) throws UserFailureException; + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java index a3c740ee2bd63bcd54a3ad24b7eb68802784172c..256196ea6d8fdb92a57d1a935d7bc047d6ae9d68 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java @@ -21,9 +21,11 @@ import java.util.List; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentAndReferenceCriteria; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; @@ -99,4 +101,15 @@ public interface IPhosphoNetXClientServiceAsync extends IClientServiceAsync public void prepareExportSamplesWithAbundance( TableExportCriteria<SampleWithPropertiesAndAbundance> exportCriteria, AsyncCallback<String> callback); + + /** @see IPhosphoNetXClientService#listRawDataSamples(IResultSetConfig) */ + public void listRawDataSamples(IResultSetConfig<String, Sample> criteria, + AsyncCallback<ResultSet<Sample>> callback); + + /** @see IPhosphoNetXClientService#prepareExportRawDataSamples(TableExportCriteria) */ + public void prepareExportRawDataSamples(TableExportCriteria<Sample> exportCriteria, + AsyncCallback<String> callback); + + /** @see IPhosphoNetXClientService#copyRawData(long[]) */ + public void copyRawData(long[] rawDataSampleIDs, AsyncCallback<Void> callback); } \ No newline at end of file diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java index 0e2904ddc8fdd729a41a95232b1a42fba56a0c83..8ce60800da90df12737a0eae71d0a0979475de15 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java @@ -78,5 +78,14 @@ public class Dict // SampleAbundance Browser public static final String ABUNDANCE = "abundance"; + + // RawDataSample Browser + + public static final String BIOLOGICAL_SAMPLE_IDENTIFIER = "biological_sample_identifier"; + public static final String MS_INJECTION_SAMPLE_CODE = "ms_injection_sample_code"; + + public static final String COPY_DATA_SETS_BUTTON_LABEL = "copy_data_sets_button_label"; + public static final String COPY_DATA_SETS_TITLE = "copy_data_sets_title"; + public static final String COPY_DATA_SETS_MESSAGE = "copy_data_sets_message"; } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java index 72097342eadac84137e23f934fa6814d793f471d..d39c574f91f5135f117e7f6ad4a70102be1cfec5 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java @@ -29,7 +29,10 @@ public enum PhosphoNetXDisplayTypeIDGenerator implements IDisplayTypeIDGenerator PROTEIN_SUMMARY_BROWSER_GRID("protein-summary-browser-grid"), - DATA_SET_PROTEIN_BROWSER_GRID("data-set-protein-browser-grid"), ; + DATA_SET_PROTEIN_BROWSER_GRID("data-set-protein-browser-grid"), + + RAW_DATA_SAMPLE_BROWSER_GRID("raw-data-sample-browser-grid"), + ; private final String genericNameOrPrefix; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java index 983a633cb7f45fb9172c18cb6e8c0bcc67077ef6..8c32c533cfe5e17ddda8d1c40e6f4e83fec36a16 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java @@ -49,6 +49,15 @@ public class QueryMenu extends TopMenuItem { return ProteinByExperimentBrowserGrid.create(viewContext); } + }, + ALL_RAW_DATA_SAMPLES() + { + @Override + IDisposableComponent createComponent( + IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + return RawDataSampleGrid.create(viewContext); + } } ; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java new file mode 100644 index 0000000000000000000000000000000000000000..0dac34d682d302cdb81e42c8584f030328696354 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java @@ -0,0 +1,196 @@ +/* + * Copyright 2010 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.phosphonetx.client.web.client.application; + +import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.createOrDelete; +import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.edit; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict.COPY_DATA_SETS_BUTTON_LABEL; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict.COPY_DATA_SETS_MESSAGE; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict.COPY_DATA_SETS_TITLE; + +import java.util.List; + +import com.extjs.gxt.ui.client.widget.Dialog; +import com.extjs.gxt.ui.client.widget.button.Button; +import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.VoidAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractSimpleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ColumnDefsAndConfigs; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IBrowserGridActionInvoker; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListener; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractDataConfirmationDialog; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.columns.RawDataSampleColDefKind; + +/** + * @author Franz-Josef Elmer + */ +class RawDataSampleGrid extends AbstractSimpleBrowserGrid<Sample> +{ + private static final class CopyConfirmationDialog extends + AbstractDataConfirmationDialog<List<Sample>> + { + private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; + private final List<Sample> samples; + + private CopyConfirmationDialog(IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext, + List<Sample> samples, String title) + { + super(specificViewContext, samples, title); + this.specificViewContext = specificViewContext; + this.samples = samples; + } + + @Override + protected String createMessage() + { + String list = "["; + String delim = ""; + for (Sample sample : samples) + { + list += delim + sample.getCode(); + delim = ", "; + } + list += "]"; + return specificViewContext.getMessage(COPY_DATA_SETS_MESSAGE, list); + } + + @Override + protected void executeConfirmedAction() + { + long[] rawDataSampleIDs = new long[samples.size()]; + for (int i = 0; i < samples.size(); i++) + { + rawDataSampleIDs[i] = samples.get(i).getId(); + } + specificViewContext.getService().copyRawData(rawDataSampleIDs, + new VoidAsyncCallback<Void>(specificViewContext)); + } + + @Override + protected void extendForm() + { + } + } + + public static final String BROWSER_ID = + GenericConstants.ID_PREFIX + "raw-data-sample-browser"; + + public static final String GRID_ID = BROWSER_ID + "-grid"; + + public static IDisposableComponent create( + final IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + RawDataSampleGrid grid = new RawDataSampleGrid(viewContext); + return grid.asDisposableWithoutToolbar(); + } + + private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; + + RawDataSampleGrid(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + super(viewContext.getCommonViewContext(), BROWSER_ID, GRID_ID, true, + PhosphoNetXDisplayTypeIDGenerator.RAW_DATA_SAMPLE_BROWSER_GRID); + specificViewContext = viewContext; + allowMultipleSelection(); + registerLinkClickListenerFor(RawDataSampleColDefKind.CODE.id(), new ICellListener<Sample>() + { + public void handle(Sample rowItem) + { + showEntityViewer(rowItem, false); + } + }); + addEntityOperationsLabel(); + Button uploadButton = + new Button(viewContext.getMessage(COPY_DATA_SETS_BUTTON_LABEL), + new AbstractCreateDialogListener() + { + @Override + protected Dialog createDialog(List<Sample> samples, + IBrowserGridActionInvoker invoker) + { + return new CopyConfirmationDialog(specificViewContext, samples, + specificViewContext.getMessage(COPY_DATA_SETS_TITLE)); + } + }); + addButton(uploadButton); + } + + @Override + protected IColumnDefinitionKind<Sample>[] getStaticColumnsDefinition() + { + return RawDataSampleColDefKind.values(); + } + + @Override + protected ColumnDefsAndConfigs<Sample> createColumnsDefinition() + { + ColumnDefsAndConfigs<Sample> schema = super.createColumnsDefinition(); + GridCellRenderer<BaseEntityModel<?>> linkCellRenderer = createInternalLinkCellRenderer(); + schema.setGridCellRendererFor(RawDataSampleColDefKind.CODE.id(), linkCellRenderer); + return schema; + } + + @Override + protected List<IColumnDefinition<Sample>> getInitialFilters() + { + return asColumnFilters(new RawDataSampleColDefKind[] {RawDataSampleColDefKind.CODE}); + } + + @Override + protected void listEntities(DefaultResultSetConfig<String, Sample> resultSetConfig, + AbstractAsyncCallback<ResultSet<Sample>> callback) + { + specificViewContext.getService().listRawDataSamples(resultSetConfig, callback); + } + + @Override + protected void prepareExportEntities(TableExportCriteria<Sample> exportCriteria, + AbstractAsyncCallback<String> callback) + { + specificViewContext.getService().prepareExportRawDataSamples(exportCriteria, callback); + } + + public DatabaseModificationKind[] getRelevantModifications() + { + return new DatabaseModificationKind[] + { createOrDelete(ObjectKind.SAMPLE_TYPE), edit(ObjectKind.SAMPLE_TYPE), + createOrDelete(ObjectKind.GROUP), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + } + + @Override + protected void showEntityViewer(Sample entity, boolean editMode) + { + showEntityInformationHolderViewer(entity, editMode); + } +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/SampleAbundanceBrowserGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/SampleAbundanceBrowserGrid.java index e87a5f2a789215c0ab6700d76c9650c6a04703e1..517b6fd8033c45396e3d790a7404ac745ede8a8f 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/SampleAbundanceBrowserGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/SampleAbundanceBrowserGrid.java @@ -28,12 +28,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.RealNumberRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; @@ -50,13 +46,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; 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.IIdentifiable; 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.EntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.columns.SampleAbundanceColDefKind; @@ -293,21 +287,7 @@ public class SampleAbundanceBrowserGrid @Override protected void showEntityViewer(SampleWithPropertiesAndAbundance sample, boolean editMode) { - final EntityKind entityKind = EntityKind.SAMPLE; - final ITabItemFactory tabView; - final IClientPluginFactory clientPluginFactory = - viewContext.getClientPluginFactoryProvider().getClientPluginFactory(entityKind, - sample.getSampleType()); - final IClientPlugin<SampleType, IIdentifiable> createClientPlugin = - clientPluginFactory.createClientPlugin(entityKind); - if (editMode) - { - tabView = createClientPlugin.createEntityEditor(sample); - } else - { - tabView = createClientPlugin.createEntityViewer(sample); - } - DispatcherHelper.dispatchNaviEvent(tabView); + showEntityInformationHolderViewer(sample, editMode); } @Override diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/RawDataSampleColDefKind.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/RawDataSampleColDefKind.java new file mode 100644 index 0000000000000000000000000000000000000000..809c602e0bd2d3133d05497c8583c793a39b82b3 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/RawDataSampleColDefKind.java @@ -0,0 +1,77 @@ +/* + * Copyright 2008 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.phosphonetx.client.web.client.application.columns; + +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict.MS_INJECTION_SAMPLE_CODE; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict.BIOLOGICAL_SAMPLE_IDENTIFIER; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.AbstractColumnDefinitionKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; + +public enum RawDataSampleColDefKind implements IColumnDefinitionKind<Sample> +{ + CODE(new AbstractColumnDefinitionKind<Sample>(MS_INJECTION_SAMPLE_CODE) + { + @Override + public String tryGetValue(Sample entity) + { + return entity.getCode(); + } + }), + + REGISTRATION_DATE(new AbstractColumnDefinitionKind<Sample>(Dict.REGISTRATION_DATE, + AbstractColumnDefinitionKind.DATE_COLUMN_WIDTH) + { + @Override + public String tryGetValue(Sample entity) + { + return renderRegistrationDate(entity); + } + }), + + SAMPLE_IDENTIFIER(new AbstractColumnDefinitionKind<Sample>(BIOLOGICAL_SAMPLE_IDENTIFIER, 150, + false) + { + @Override + public String tryGetValue(Sample entity) + { + return entity.getGeneratedFrom().getIdentifier(); + } + }), + + ; + + private final AbstractColumnDefinitionKind<Sample> columnDefinitionKind; + + private RawDataSampleColDefKind(AbstractColumnDefinitionKind<Sample> columnDefinitionKind) + { + this.columnDefinitionKind = columnDefinitionKind; + } + + public String id() + { + return name(); + } + + public AbstractColumnDefinitionKind<Sample> getDescriptor() + { + return columnDefinitionKind; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js index 6a2876facb3f11b110f31db69426bd40d1d34ebe..cf433b72061d02944c87cba1aac8bf3e701ae155 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js @@ -35,6 +35,16 @@ var phosphonetx = { // SampleAbudndance Browser abundance: "Abundance", + // RawDataSample Browser + + ALL_RAW_DATA_SAMPLES_menu_item: "All MS INJECTION Samples", + ALL_RAW_DATA_SAMPLES_tab_label: "MS INJECTION Samples and Related Biological Samples", + ms_injection_sample_code: "MS INJECTION Sample", + biological_sample_identifier: "Biological Sample", + copy_data_sets_button_label: "Copy Data Sets", + copy_data_sets_title: "Copy Data Sets Confirmation", + copy_data_sets_message: "Do you want to make the data sets of the samples {0} available for processing?", + // LAST LINE: KEEP IT AT THE END lastline: "" // we need a line without a comma }; \ No newline at end of file diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java index c09d71483689611e82233f3296718e570b63ce82..0782a2ac3cd0683ec26bb5817ac788019f38ad23 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java @@ -24,12 +24,14 @@ import org.springframework.stereotype.Component; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.servlet.IRequestContextProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.server.AbstractClientService; import ch.systemsx.cisd.openbis.generic.client.web.server.translator.UserFailureExceptionTranslator; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentAndReferenceCriteria; @@ -38,6 +40,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListPro import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinSummaryByExperimentCriteria; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListSampleAbundanceByProteinCriteria; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.ResourceNames; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.AbundanceColumnDefinition; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.AggregateFunction; @@ -57,6 +60,9 @@ public class PhosphoNetXClientService extends AbstractClientService implements { @Resource(name = ResourceNames.PHOSPHONETX_PLUGIN_SERVER) private IPhosphoNetXServer server; + + @Resource(name = ResourceNames.PHOSPHONETX_RAW_DATA_SERVICE_WEB) + private IRawDataServiceInternal rawDataService; public PhosphoNetXClientService() { @@ -179,4 +185,24 @@ public class PhosphoNetXClientService extends AbstractClientService implements return prepareExportEntities(exportCriteria); } + public ResultSet<Sample> listRawDataSamples(IResultSetConfig<String, Sample> criteria) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + final String sessionToken = getSessionToken(); + return listEntities(criteria, new RawDataSampleProvider(rawDataService, sessionToken)); + } + + public String prepareExportRawDataSamples(TableExportCriteria<Sample> exportCriteria) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + return prepareExportEntities(exportCriteria); + } + + public void copyRawData(long[] rawDataSampleIDs) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + rawDataService.copyRawData(getSessionToken(), rawDataSampleIDs); + } + + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProvider.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..11cabcd2c10cdccc99c31ae91efebd9775549a64 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProvider.java @@ -0,0 +1,48 @@ +/* + * Copyright 2010 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.phosphonetx.client.web.server; + +import java.util.List; + +import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; + +/** + * + * + * @author Franz-Josef Elmer + */ +class RawDataSampleProvider implements IOriginalDataProvider<Sample> +{ + private final IRawDataServiceInternal service; + private final String sessionToken; + + RawDataSampleProvider(IRawDataServiceInternal service, String sessionToken) + { + this.service = service; + this.sessionToken = sessionToken; + } + + public List<Sample> getOriginalData() throws UserFailureException + { + List<Sample> samples = service.listRawDataSamples(sessionToken); + return samples; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/ResourceNames.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/ResourceNames.java index 22d6db2af853a8e9e01bf4c101ea787d44cedf91..a0c44142b195e0f13b1728e6ff0118579a8f09c5 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/ResourceNames.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/ResourceNames.java @@ -33,6 +33,8 @@ public class ResourceNames public final static String PHOSPHONETX_RAW_DATA_SERVICE = "phosphonetx-raw-data-service"; + public final static String PHOSPHONETX_RAW_DATA_SERVICE_WEB = "phosphonetx-raw-data-service-web"; + public final static String PHOSPHONETX_DAO_FACTORY = "phosphonetx-dao-factory"; public final static String PHOSPHONETX_BO_FACTORY = "phosphonetx-bo-factory"; diff --git a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml index 49fe1a591d1ed9507d5d83d34a29244040d303ab..98883e8bd1f54ae2e7fb5d3145091b56f50ee49a 100644 --- a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml +++ b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml @@ -86,6 +86,13 @@ <constructor-arg ref="dao-factory"/> <constructor-arg ref="common-business-object-factory" /> </bean> + + <bean id="phosphonetx-raw-data-service-web" + class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal"> + <constructor-arg ref="session-manager" /> + <constructor-arg ref="dao-factory"/> + <constructor-arg ref="common-business-object-factory" /> + </bean> </beans> \ No newline at end of file