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 4e55fc527f67ee85a900bb8044edfe8d693cfd40..583ae2548833d1eefe2d574e82e96362e1d84e7d 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 @@ -92,6 +92,7 @@ public interface IPhosphoNetXClientService extends IClientService public String prepareExportRawDataSamples(TableExportCriteria<GenericTableRow> exportCriteria) throws UserFailureException; - public void copyRawData(long[] rawDataSampleIDs) throws UserFailureException; + public void processRawData(String dataSetProcessingKey, 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 6d522eb5d2d2fd679a04bcd9553b3af32f4fe404..7d43422e11260cf5b7e5b01d4a57296b73830a1b 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 @@ -111,6 +111,6 @@ public interface IPhosphoNetXClientServiceAsync extends IClientServiceAsync public void prepareExportRawDataSamples(TableExportCriteria<GenericTableRow> exportCriteria, AsyncCallback<String> callback); - /** @see IPhosphoNetXClientService#copyRawData(long[]) */ - public void copyRawData(long[] rawDataSampleIDs, AsyncCallback<Void> callback); + /** @see IPhosphoNetXClientService#processRawData(String, long[]) */ + public void processRawData(String dataSetProcessingKey, 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/RawDataProcessingMenu.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataProcessingMenu.java new file mode 100644 index 0000000000000000000000000000000000000000..ad1192bce24dddee4ceff505e3daddafbd94e01b --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataProcessingMenu.java @@ -0,0 +1,167 @@ +/* + * 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.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.menu.Menu; + +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; +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.VoidAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.IActionMenuItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractDataConfirmationDialog; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedActionWithResult; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextToolItem; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStoreServiceKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SerializableComparableIDDecorator; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class RawDataProcessingMenu extends TextToolItem +{ + private static final class CopyConfirmationDialog extends + AbstractDataConfirmationDialog<List<GenericTableRow>> + { + private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; + + private final List<GenericTableRow> samples; + + private final DatastoreServiceDescription datastoreServiceDescription; + + private CopyConfirmationDialog( + IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext, + DatastoreServiceDescription datastoreServiceDescription, + List<GenericTableRow> samples, String title) + { + super(specificViewContext, samples, title); + this.specificViewContext = specificViewContext; + this.datastoreServiceDescription = datastoreServiceDescription; + this.samples = samples; + } + + @Override + protected String createMessage() + { + String list = "["; + String delim = ""; + for (GenericTableRow sample : samples) + { + list += delim + sample.tryToGetValue(0); + delim = ", "; + } + list += "]"; + String label = datastoreServiceDescription.getLabel(); + return specificViewContext.getMessage(COPY_DATA_SETS_MESSAGE, label, list); + } + + @Override + protected void executeConfirmedAction() + { + long[] rawDataSampleIDs = new long[samples.size()]; + for (int i = 0; i < samples.size(); i++) + { + GenericTableRow row = samples.get(i); + ISerializableComparable c = row.tryToGetValue(0); + if (c instanceof SerializableComparableIDDecorator == false) + { + throw new IllegalArgumentException("Missing id: " + c); + } + rawDataSampleIDs[i] = ((SerializableComparableIDDecorator) c).getID(); + } + specificViewContext.getService().processRawData(datastoreServiceDescription.getKey(), + rawDataSampleIDs, new VoidAsyncCallback<Void>(specificViewContext)); + } + + @Override + protected void extendForm() + { + } + } + + private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; + private final IDelegatedActionWithResult<List<GenericTableRow>> selectedDataProvider; + + public RawDataProcessingMenu(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, + IDelegatedActionWithResult<List<GenericTableRow>> selectedDataProvider) + { + super(viewContext.getMessage(Dict.COPY_DATA_SETS_BUTTON_LABEL)); + this.viewContext = viewContext; + this.selectedDataProvider = selectedDataProvider; + IViewContext<ICommonClientServiceAsync> commonViewContext = + viewContext.getCommonViewContext(); + viewContext.getCommonService().listDataStoreServices(DataStoreServiceKind.PROCESSING, + new AbstractAsyncCallback<List<DatastoreServiceDescription>>(commonViewContext) + { + @Override + public final void process(List<DatastoreServiceDescription> plugins) + { + createMenu(plugins); + } + }); + } + + private void createMenu(List<DatastoreServiceDescription> plugins) + { + Menu subMenu = new Menu(); + + for (final DatastoreServiceDescription datastoreServiceDescription : plugins) + { + IActionMenuItem actionMenuItem = new IActionMenuItem() + { + + public String getMenuText(IMessageProvider messageProvider) + { + return datastoreServiceDescription.getLabel(); + } + + public String getMenuId() + { + return datastoreServiceDescription.getKey(); + } + }; + IDelegatedAction action = new IDelegatedAction() + { + + public void execute() + { + String title = viewContext.getMessage(COPY_DATA_SETS_TITLE); + List<GenericTableRow> selectedSamples = selectedDataProvider.execute(); + new CopyConfirmationDialog(viewContext, datastoreServiceDescription, + selectedSamples, title).show(); + } + }; + subMenu.add(new ActionMenu(actionMenuItem, viewContext, action)); + } + setMenu(subMenu); + } + +} 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 index 22364c4a78c37c54c6b0304c7728425956cf4afa..b50779972b68e6c3128e47bed06cb75951dae242 100644 --- 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 @@ -18,25 +18,18 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.applicatio 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.google.gwt.user.client.rpc.AsyncCallback; 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.ui.grid.GenericTableBrowserGrid; -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.application.util.IDelegatedActionWithResult; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericTableResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; @@ -45,7 +38,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; 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.GenericTableRow; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SerializableComparableIDDecorator; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; @@ -66,59 +58,6 @@ class RawDataSampleGrid extends GenericTableBrowserGrid return grid.asDisposableWithoutToolbar(); } - private static final class CopyConfirmationDialog extends - AbstractDataConfirmationDialog<List<GenericTableRow>> - { - private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; - - private final List<GenericTableRow> samples; - - private CopyConfirmationDialog( - IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext, - List<GenericTableRow> samples, String title) - { - super(specificViewContext, samples, title); - this.specificViewContext = specificViewContext; - this.samples = samples; - } - - @Override - protected String createMessage() - { - String list = "["; - String delim = ""; - for (GenericTableRow sample : samples) - { - list += delim + sample.tryToGetValue(0); - 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++) - { - GenericTableRow row = samples.get(i); - ISerializableComparable c = row.tryToGetValue(0); - if (c instanceof SerializableComparableIDDecorator == false) - { - throw new IllegalArgumentException("Missing id: " + c); - } - rawDataSampleIDs[i] = ((SerializableComparableIDDecorator) c).getID(); - } - specificViewContext.getService().copyRawData(rawDataSampleIDs, - new VoidAsyncCallback<Void>(specificViewContext)); - } - - @Override - protected void extendForm() - { - } - } private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; @@ -136,20 +75,16 @@ class RawDataSampleGrid extends GenericTableBrowserGrid }); allowMultipleSelection(); addEntityOperationsLabel(); - Button uploadButton = - new Button(viewContext.getMessage(COPY_DATA_SETS_BUTTON_LABEL), - new AbstractCreateDialogListener() - { - @Override - protected Dialog createDialog(List<GenericTableRow> samples, - IBrowserGridActionInvoker invoker) - { - return new CopyConfirmationDialog(specificViewContext, samples, - specificViewContext.getMessage(COPY_DATA_SETS_TITLE)); - } - }); - addButton(uploadButton); - + RawDataProcessingMenu button = new RawDataProcessingMenu(viewContext, + new IDelegatedActionWithResult<List<GenericTableRow>>() + { + public List<GenericTableRow> execute() + { + return getSelectedBaseObjects(); + } + }); + enableButtonOnSelectedItems(button); + addButton(button); } @Override 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 0faaf75d392e33ddbe4ddfb119a3e906418b43eb..6f307d795b6df3b2b91c8290a6ad991a25318663 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 @@ -42,11 +42,11 @@ var phosphonetx = { ALL_RAW_DATA_SAMPLES_menu_item: "All MS INJECTION Samples", ALL_RAW_DATA_SAMPLES_tab_label: "MS INJECTION Samples and Related Biological Samples", openbis_raw_data_sample_browser_CODE: "MS INJECTION Sample", - openbis_raw_data_sample_browser_REGISTRATION_DATE: "Regustration Date", + openbis_raw_data_sample_browser_REGISTRATION_DATE: "Registration Date", openbis_raw_data_sample_browser_PARENT: "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?", + copy_data_sets_button_label: "Process Data Sets", + copy_data_sets_title: "Process Data Sets Confirmation", + copy_data_sets_message: "Do you want to process '{0}' for the data sets of the samples {1}?", // LAST LINE: KEEP IT AT THE END lastline: "" // we need a line without a comma 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 a78874bc47f07f5d537ab00f9df64a79ba66ad7c..74852de88f0af8bb63afda6f816b48b66f43c2c1 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 @@ -201,10 +201,10 @@ public class PhosphoNetXClientService extends AbstractClientService implements return prepareExportEntities(exportCriteria); } - public void copyRawData(long[] rawDataSampleIDs) + public void processRawData(String dataSetProcessingKey, long[] rawDataSampleIDs) throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException { - rawDataService.copyRawData(getSessionToken(), rawDataSampleIDs); + rawDataService.processRawData(getSessionToken(), dataSetProcessingKey, rawDataSampleIDs); } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java index 3fd32b1a160d8c63a705f4730ab625fea03e96ef..cb6a0c32bb1cb826ec79035b9a371ac095a5ca8b 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java @@ -67,13 +67,15 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I } } - public void copyRawData(String sessionToken, String userID, long[] rawDataSampleIDs) + public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, + long[] rawDataSampleIDs) { checkSession(sessionToken); SessionContextDTO session = login(userID); try { - service.copyRawData(session.getSessionToken(), rawDataSampleIDs); + service.processRawData(session.getSessionToken(), dataSetProcessingKey, + rawDataSampleIDs); } finally { service.logout(session.getSessionToken()); diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java index 9dbaf9c9ddd93aa7ccf688846c32433eb826a856..228dc07ebd73f6c8b515d1837d0b67895e55ce0f 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java @@ -56,9 +56,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.authorization.validato */ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceInternal> implements IRawDataServiceInternal { - @Private static final String COPY_PROCESSING_KEY = "copy-data-sets"; - - @Private static final String GROUP_CODE = "MS_DATA"; + @Private static final String GROUP_CODE = "MS_DATA"; @Private static final String RAW_DATA_SAMPLE_TYPE = "MS_INJECTION"; @@ -95,11 +93,12 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern return loadAllRawDataSamples(getSession(sessionToken)); } - public void copyRawData(String sessionToken, long[] rawDataSampleIDs) + public void processRawData(String sessionToken, String dataSetProcessingKey, + long[] rawDataSampleIDs) { Session session = getSession(sessionToken); PersonPE person = session.tryGetPerson(); - + List<Sample> samples = loadAllRawDataSamples(session); Set<Long> sampleIDs = new HashSet<Long>(); for (Sample sample : samples) @@ -109,7 +108,7 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern sampleIDs.add(sample.getId()); } } - + ISampleDAO sampleDAO = getDAOFactory().getSampleDAO(); IExternalDataDAO externalDataDAO = getDAOFactory().getExternalDataDAO(); List<String> dataSetCodes = new ArrayList<String>(); @@ -127,10 +126,10 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern dataSetCodes.add(dataSet.getCode()); } } - String dataStoreServerCode = findDataStoreServer(); + String dataStoreServerCode = findDataStoreServer(dataSetProcessingKey); IExternalDataTable externalDataTable = businessObjectFactory.createExternalDataTable(session); - externalDataTable.processDatasets(COPY_PROCESSING_KEY, dataStoreServerCode, dataSetCodes); + externalDataTable.processDatasets(dataSetProcessingKey, dataStoreServerCode, dataSetCodes); } private List<Sample> loadAllRawDataSamples(Session session) @@ -147,7 +146,7 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern return sampleLister.list(criteria2); } - private String findDataStoreServer() + private String findDataStoreServer(String dataSetProcessingKey) { List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores(); for (DataStorePE dataStore : dataStores) @@ -156,13 +155,13 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern for (DataStoreServicePE dataStoreService : services) { if (DataStoreServiceKind.PROCESSING.equals(dataStoreService.getKind()) - && COPY_PROCESSING_KEY.equals(dataStoreService.getKey())) + && dataSetProcessingKey.equals(dataStoreService.getKey())) { return dataStore.getCode(); } } } throw new EnvironmentFailureException("No data store processing service with key '" - + COPY_PROCESSING_KEY + "' found."); + + dataSetProcessingKey + "' found."); } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalLogger.java index 98fbf7a477259a4542975b59d461cbab124e98f2..824c9dc0f08bcb3da655d2c907ea89595153cd65 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalLogger.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalLogger.java @@ -44,7 +44,7 @@ class RawDataServiceInternalLogger extends AbstractServerLogger implements IRawD return null; } - public void copyRawData(String sessionToken, long[] rawDataSampleIDs) + public void processRawData(String sessionToken, String dataSetProcessingKey, long[] rawDataSampleIDs) { int numberOfDataSets = rawDataSampleIDs == null ? 0 : rawDataSampleIDs.length; logAccess(sessionToken, "copy_raw_data", "NUMBER_OF_DATA_SETS(%s)", numberOfDataSets); diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java index 32d98dff7e08d92f3c549f3de83f87794d3589e0..7af4229bcacbda8c8b47f5273e27b371174e39f5 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java @@ -44,11 +44,13 @@ class RawDataServiceLogger extends AbstractServerLogger implements IRawDataServi return null; } - public void copyRawData(String sessionToken, String userID, long[] rawDataSampleIDs) + public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, + long[] rawDataSampleIDs) { int numberOfDataSets = rawDataSampleIDs == null ? 0 : rawDataSampleIDs.length; - logAccess(sessionToken, "copy_raw_data", "USER_ID(%s) NUMBER_OF_DATA_SETS(%s)", userID, - numberOfDataSets); + logAccess(sessionToken, "copy_raw_data", + "USER_ID(%s) DSS_PROCESSING_PLUGIN(%s) NUMBER_OF_DATA_SETS(%s)", userID, + dataSetProcessingKey, numberOfDataSets); } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java index 542e60a5b70c42a76f6b2a90f95832a312073afe..9160444ef8c306c1016e0273a8e441bebf5fc9c7 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java @@ -39,8 +39,14 @@ public interface IRawDataService extends IServer @Transactional(readOnly = true) @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER) public List<Sample> listRawDataSamples(String sessionToken, String userID); - + + /** + * Processes the data sets of specified samples by the DSS processing plug-in of specified key + * for the specified user. Implementations should check that the specified user is allowed + * to read specified samples. + */ @Transactional(readOnly = true) @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER) - public void copyRawData(String sessionToken, String userID, long[] rawDataSampleIDs); + public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, + long[] rawDataSampleIDs); } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataServiceInternal.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataServiceInternal.java index f0b3483c468d880bcf06393f08ba2fcf71361d55..d782ccf07da5eaebfa5a434b81970711ff464901 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataServiceInternal.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataServiceInternal.java @@ -45,5 +45,5 @@ public interface IRawDataServiceInternal extends IServer @Transactional(readOnly = true) @RolesAllowed(RoleSet.USER) - public void copyRawData(String sessionToken, long[] rawDataSampleIDs); + public void processRawData(String sessionToken, String dataSetProcessingKey, long[] rawDataSampleIDs); } \ No newline at end of file diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java index 392f06676b380f8031d7c18c15ad6be3b68c6bfb..6b4ef6d7726ebf821ffa70c80991e25921b46f49 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java @@ -67,6 +67,6 @@ public class RawDataTestClient Sample sample = samples.get(i); ids[i] = sample.getId(); } - service.copyRawData(sessionToken, "test_a", ids); + service.processingRawData(sessionToken, "test_a", "copy-data-sets", ids); } } diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalTest.java index 866bfec3698d73568aa435d204cbc646341b3922..6b4074dee2a4038555c81c85419a2959b6cf1dc9 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalTest.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.server; import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStoreServiceKind.PROCESSING; import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStoreServiceKind.QUERIES; -import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal.COPY_PROCESSING_KEY; import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal.GROUP_CODE; import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal.RAW_DATA_SAMPLE_TYPE; @@ -57,6 +56,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInterna @Friend(toClasses=RawDataServiceInternal.class) public class RawDataServiceInternalTest extends AbstractServerTestCase { + private static final String COPY_PROCESSING_KEY = "copy-data-sets"; private IRawDataServiceInternal service; private ICommonBusinessObjectFactory boFactory; private ISampleLister sampleLister; @@ -126,7 +126,7 @@ public class RawDataServiceInternalTest extends AbstractServerTestCase }); - service.copyRawData(SESSION_TOKEN, ids); + service.processRawData(SESSION_TOKEN, COPY_PROCESSING_KEY, ids); context.assertIsSatisfied(); } diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceTest.java index 0424cfea03e47b8e14b97a38f1e8d41e1b2347a3..af5128232cd6c5a9b2f2c098e6ca1e79a171aa8e 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceTest.java @@ -99,7 +99,7 @@ public class RawDataServiceTest extends AbstractServerTestCase try { - service.copyRawData(SESSION_TOKEN, "abc", new long[0]); + service.processingRawData(SESSION_TOKEN, "abc", null, new long[0]); fail("UserFailureException expected"); } catch (UserFailureException ex) { @@ -118,11 +118,11 @@ public class RawDataServiceTest extends AbstractServerTestCase context.checking(new Expectations() { { - one(internalService).copyRawData(session2.getSessionToken(), ids); + one(internalService).processRawData(session2.getSessionToken(), null, ids); } }); - service.copyRawData(SESSION_TOKEN, "abc", ids); + service.processingRawData(SESSION_TOKEN, "abc", null, ids); context.assertIsSatisfied(); }