From c08a0506df10f07c0904d1c515a49a1c5678c2ca Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Mon, 6 Sep 2010 13:31:37 +0000 Subject: [PATCH] OBP-37 new API: Proteomics Data API with same methods as Raw Data API plus two new methods. Raw Data API are removed. Only deprecated IRawDataApiFacade for backwards compatibility. SVN: 17728 --- rtd_phosphonetx/etc/service.properties | 2 +- .../client/api/v1/FacadeFactory.java | 22 ++-- .../api/v1/IProteomicsDataApiFacade.java | 81 +++++++++++++ .../client/api/v1/IRawDataApiFacade.java | 1 + ...cade.java => ProteomicsDataApiFacade.java} | 20 +++- ...piTest.java => ProteomicsDataApiTest.java} | 31 ++++- .../phosphonetx/client/api/v1/package.html | 2 +- .../web/server/PhosphoNetXClientService.java | 8 +- .../web/server/RawDataSampleProvider.java | 6 +- ...ava => ProteomicsDataServiceInternal.java} | 107 +++++++++++++++--- ... ProteomicsDataServiceInternalLogger.java} | 21 +++- .../phosphonetx/server/api/v1/Constants.java | 4 +- ...ervice.java => ProteomicsDataService.java} | 100 +++++++++++----- ....java => ProteomicsDataServiceLogger.java} | 20 +++- ....java => ProteomicsDataServiceServer.java} | 16 +-- ...va => IProteomicsDataServiceInternal.java} | 15 ++- .../phosphonetx/shared/ResourceNames.java | 2 +- ...rvice.java => IProteomicsDataService.java} | 28 ++++- .../shared/api/v1/dto/Experiment.java | 105 +++++++++++++++++ .../java/phosphonetx-applicationContext.xml | 30 +---- ....java => ProteomicsDataApiFacadeTest.java} | 18 +-- .../web/server/RawDataSampleProviderTest.java | 6 +- ...=> ProteomicsDataServiceInternalTest.java} | 14 +-- ...st.java => ProteomicsDataServiceTest.java} | 16 +-- 24 files changed, 531 insertions(+), 144 deletions(-) create mode 100644 rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IProteomicsDataApiFacade.java rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/{RawDataApiFacade.java => ProteomicsDataApiFacade.java} (83%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/{RawDataApiTest.java => ProteomicsDataApiTest.java} (67%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/{RawDataServiceInternal.java => ProteomicsDataServiceInternal.java} (63%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/{RawDataServiceInternalLogger.java => ProteomicsDataServiceInternalLogger.java} (66%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/{RawDataService.java => ProteomicsDataService.java} (73%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/{RawDataServiceLogger.java => ProteomicsDataServiceLogger.java} (74%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/{RawDataServiceServer.java => ProteomicsDataServiceServer.java} (69%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/{IRawDataServiceInternal.java => IProteomicsDataServiceInternal.java} (74%) rename rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/{IRawDataService.java => IProteomicsDataService.java} (73%) create mode 100644 rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/dto/Experiment.java rename rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/{RawDataApiFacadeTest.java => ProteomicsDataApiFacadeTest.java} (90%) rename rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/{RawDataServiceInternalTest.java => ProteomicsDataServiceInternalTest.java} (94%) rename rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/{RawDataServiceTest.java => ProteomicsDataServiceTest.java} (95%) diff --git a/rtd_phosphonetx/etc/service.properties b/rtd_phosphonetx/etc/service.properties index 93f45ff53f0..909533fa609 100644 --- a/rtd_phosphonetx/etc/service.properties +++ b/rtd_phosphonetx/etc/service.properties @@ -125,7 +125,7 @@ processing-plugins = copy-data-sets, ms-inj-copy # The configuration of the processing plugin is the same as the reporting plugins configuration. copy-data-sets.label = Data Set Copier to User Location -copy-data-sets.dataset-types = UNKNOWN +copy-data-sets.dataset-types = UNKNOWN, PROT_RESULT copy-data-sets.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.DataSetCopierForUsers #copy-data-sets.destination = /Volumes/share-1-\$/user/cisd/felmer/phosphonetx/ copy-data-sets.destination = vesuvio:tmp/${user} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/FacadeFactory.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/FacadeFactory.java index 0f119a3f0cd..719a53f1028 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/FacadeFactory.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/FacadeFactory.java @@ -18,17 +18,17 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.api.v1; import ch.systemsx.cisd.common.api.client.ServiceFinder; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; /** - * Factory of {@link IRawDataApiFacade}. + * Factory of {@link IProteomicsDataApiFacade}. * * @author Franz-Josef Elmer */ public class FacadeFactory { private static final ServiceFinder SERVICE_FINDER = - new ServiceFinder("openbis", IRawDataService.SERVER_URL); + new ServiceFinder("openbis", IProteomicsDataService.SERVER_URL); private static final ServiceFinder GENERIC_INFO_SERVICE_FINDER = new ServiceFinder("openbis", IGeneralInformationService.SERVICE_URL); @@ -36,31 +36,31 @@ public class FacadeFactory /** * Creates a facade for specified server URL, user Id, and password. */ - public static IRawDataApiFacade create(String serverURL, String userID, String password) + public static IProteomicsDataApiFacade create(String serverURL, String userID, String password) { IGeneralInformationService infoService = createGenericInfoService(serverURL); - IRawDataService service = createService(serverURL); + IProteomicsDataService service = createService(serverURL); String sessionToken = infoService.tryToAuthenticateForAllServices(userID, password); if (sessionToken == null) { throw new IllegalArgumentException("User " + userID + " couldn't be authenticated"); } - return new RawDataApiFacade(service, infoService, sessionToken); + return new ProteomicsDataApiFacade(service, infoService, sessionToken); } /** * Creates a facade for specified url and sessionToken. */ - public static IRawDataApiFacade create(String serverURL, String sessionToken) + public static IProteomicsDataApiFacade create(String serverURL, String sessionToken) { - IRawDataService service = createService(serverURL); + IProteomicsDataService service = createService(serverURL); IGeneralInformationService infoService = createGenericInfoService(serverURL); - return new RawDataApiFacade(service, infoService, sessionToken); + return new ProteomicsDataApiFacade(service, infoService, sessionToken); } - private static IRawDataService createService(String serverURL) + private static IProteomicsDataService createService(String serverURL) { - return SERVICE_FINDER.createService(IRawDataService.class, serverURL); + return SERVICE_FINDER.createService(IProteomicsDataService.class, serverURL); } private static IGeneralInformationService createGenericInfoService(String serverURL) diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IProteomicsDataApiFacade.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IProteomicsDataApiFacade.java new file mode 100644 index 00000000000..f076af4e4ba --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IProteomicsDataApiFacade.java @@ -0,0 +1,81 @@ +/* + * 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.api.v1; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Project; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; + + +/** + * Facade for openBIS proteomics data service. + * + * @author Franz-Josef Elmer + */ +public interface IProteomicsDataApiFacade extends IRawDataApiFacade +{ + /** + * Return the session token for the logged-in user. + */ + public String getSessionToken(); + + /** + * Returns all samples of type MS_INJECTION in space MS_DATA which have a parent sample which + * the specified user is allow to read. + */ + public List<MsInjectionDataInfo> listRawDataSamples(String userID); + + /** + * Lists all processing plugins on DSS. + */ + public List<DataStoreServerProcessingPluginInfo> listDataStoreServerProcessingPluginInfos(); + + /** + * Processes the data sets of specified samples by the DSS processing plug-in of specified key + * for the specified user. Only the most recent data sets of specified type are processed. + */ + public void processingRawData(String userID, String dataSetProcessingKey, + long[] rawDataSampleIDs, String dataSetType); + + /** + * Returns all projects where the specified user has USER access rights. + */ + public List<Project> listProjects(String userID); + + /** + * Returns all experiments of type <tt>MS_SEARCH</tt> which the specified user is allowed to + * read. + */ + public List<Experiment> listSearchExperiments(String userID); + + /** + * Processes the data sets of specified experiments of type <tt>MS_SEARCH</tt> by the DSS + * processing plug-in of specified key for the specified user. It will be checked if the + * experiments are of search experiments and if the user has USER access rights. + */ + public void processSearchData(String userID, String dataSetProcessingKey, + long[] searchExperimentIDs); + + /** + * Logs current user out. + */ + public void logout(); + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IRawDataApiFacade.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IRawDataApiFacade.java index b47e523e82a..866613a3f18 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IRawDataApiFacade.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/IRawDataApiFacade.java @@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjection * * @author Franz-Josef Elmer */ +@Deprecated public interface IRawDataApiFacade { /** diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacade.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacade.java similarity index 83% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacade.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacade.java index 6840abef472..a416d909f2e 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacade.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacade.java @@ -25,8 +25,9 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Role; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SpaceWithProjectsAndRoleAssignments; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; /** @@ -34,14 +35,14 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjection * * @author Franz-Josef Elmer */ -class RawDataApiFacade implements IRawDataApiFacade +class ProteomicsDataApiFacade implements IProteomicsDataApiFacade { private static final String USER_ROLE_SET = "SPACE_USER"; - private final IRawDataService service; + private final IProteomicsDataService service; private final IGeneralInformationService generalInfoService; private final String sessionToken; - RawDataApiFacade(IRawDataService service, IGeneralInformationService generalInfoService, String sessionToken) + ProteomicsDataApiFacade(IProteomicsDataService service, IGeneralInformationService generalInfoService, String sessionToken) { this.service = service; this.generalInfoService = generalInfoService; @@ -98,6 +99,17 @@ class RawDataApiFacade implements IRawDataApiFacade return projects; } + public List<Experiment> listSearchExperiments(String userID) + { + return service.listSearchExperiments(sessionToken, userID); + } + + public void processSearchData(String userID, String dataSetProcessingKey, + long[] searchExperimentIDs) + { + service.processSearchData(sessionToken, userID, dataSetProcessingKey, searchExperimentIDs); + } + public void logout() { generalInfoService.logout(sessionToken); diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiTest.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiTest.java similarity index 67% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiTest.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiTest.java index 81ccf122bcc..f42913c27a1 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiTest.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiTest.java @@ -22,14 +22,15 @@ import java.util.Map; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Project; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; /** - * Example of usage of Raw Data API. + * Example of usage of Proteomics Data API. * * @author Franz-Josef Elmer */ -public class RawDataApiTest +public class ProteomicsDataApiTest { public static void main(String[] args) { @@ -43,7 +44,7 @@ public class RawDataApiTest String loginID = args[1]; String password = args[2]; String userID = args[3]; - IRawDataApiFacade facade = FacadeFactory.create(serverURL, loginID, password); + IProteomicsDataApiFacade facade = FacadeFactory.create(serverURL, loginID, password); System.out.println("MS_INJECTION samples:"); List<MsInjectionDataInfo> rawDataSamples = facade.listRawDataSamples(userID); @@ -61,10 +62,15 @@ public class RawDataApiTest System.out.println("DSS processing plugins:"); List<DataStoreServerProcessingPluginInfo> infos = facade.listDataStoreServerProcessingPluginInfos(); + String dataSetProcessingKey = null; for (DataStoreServerProcessingPluginInfo info : infos) { System.out.println(" key:" + info.getKey() + ", label:'" + info.getLabel() + "', data set types:" + info.getDatasetTypeCodes()); + if (info.getDatasetTypeCodes().contains("PROT_RESULT")) + { + dataSetProcessingKey = info.getKey(); + } } System.out.println("Projects:"); @@ -73,6 +79,25 @@ public class RawDataApiTest { System.out.println(project); } + + System.out.println("Search Experiments:"); + List<Experiment> experiments = facade.listSearchExperiments(userID); + long[] ids = new long[experiments.size()]; + for (int i = 0; i < experiments.size(); i++) + { + Experiment experiment = experiments.get(i); + System.out.println(experiment.getSpaceCode() + "/" + experiment.getProjectCode() + "/" + + experiment.getCode() + " [" + experiment.getId() + ", " + + experiment.getRegistrationDate() + "] " + experiment.getProperties()); + ids[i] = experiment.getId(); + } + + if (dataSetProcessingKey != null) + { + System.out.println("Process search data of " + ids.length + " experiments"); + facade.processSearchData(userID, dataSetProcessingKey , ids); + } + facade.logout(); } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/package.html b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/package.html index 2a39158eb3a..4dd85ccc624 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/package.html +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/package.html @@ -1,5 +1,5 @@ <html> <body> -API Facade +Proteomics Data API Facade </body> </html> \ 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 20c3d34ae4f..cdfa2ac7cc0 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 @@ -43,7 +43,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.IProteomicsDataServiceInternal; 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; @@ -65,7 +65,7 @@ public class PhosphoNetXClientService extends AbstractClientService implements private IPhosphoNetXServer server; @Resource(name = ResourceNames.PHOSPHONETX_RAW_DATA_SERVICE_WEB) - private IRawDataServiceInternal rawDataService; + private IProteomicsDataServiceInternal proteomicsDataService; public PhosphoNetXClientService() { @@ -224,7 +224,7 @@ public class PhosphoNetXClientService extends AbstractClientService implements throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException { final String sessionToken = getSessionToken(); - RawDataSampleProvider rawDataSampleProvider = new RawDataSampleProvider(rawDataService, sessionToken); + RawDataSampleProvider rawDataSampleProvider = new RawDataSampleProvider(proteomicsDataService, sessionToken); ResultSet<GenericTableRow> resultSet = listEntities(criteria, rawDataSampleProvider); return new GenericTableResultSet(resultSet, rawDataSampleProvider.getHeaders()); } @@ -238,7 +238,7 @@ public class PhosphoNetXClientService extends AbstractClientService implements public void processRawData(String dataSetProcessingKey, long[] rawDataSampleIDs, String dataSetType) throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException { - rawDataService.processRawData(getSessionToken(), dataSetProcessingKey, rawDataSampleIDs, dataSetType); + proteomicsDataService.processRawData(getSessionToken(), dataSetProcessingKey, rawDataSampleIDs, dataSetType); } } 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 index 91d4ab80268..b87ac048022 100644 --- 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 @@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** @@ -52,11 +52,11 @@ class RawDataSampleProvider implements IOriginalDataProvider<GenericTableRow> @Private static final String CODE = "CODE"; - private final IRawDataServiceInternal service; + private final IProteomicsDataServiceInternal service; private final String sessionToken; - RawDataSampleProvider(IRawDataServiceInternal service, String sessionToken) + RawDataSampleProvider(IProteomicsDataServiceInternal service, String sessionToken) { this.service = service; this.sessionToken = sessionToken; 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/ProteomicsDataServiceInternal.java similarity index 63% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/ProteomicsDataServiceInternal.java index b9e834fbbf1..10e322eb180 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/ProteomicsDataServiceInternal.java @@ -32,28 +32,39 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ICommonBusinessObject import ch.systemsx.cisd.openbis.generic.server.business.bo.IExternalDataTable; import ch.systemsx.cisd.openbis.generic.server.business.bo.samplelister.ISampleLister; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IExperimentDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IExternalDataDAO; +import ch.systemsx.cisd.openbis.generic.shared.authorization.validator.ExperimentValidator; import ch.systemsx.cisd.openbis.generic.shared.authorization.validator.IValidator; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStoreServiceKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; +import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTypeTranslator; import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.business.DataSetManager; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.authorization.validator.RawDataSampleValidator; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** * @author Franz-Josef Elmer */ -public class RawDataServiceInternal extends AbstractServer<IRawDataServiceInternal> implements - IRawDataServiceInternal +public class ProteomicsDataServiceInternal extends AbstractServer<IProteomicsDataServiceInternal> implements + IProteomicsDataServiceInternal { @Private static final String SPACE_CODE = "MS_DATA"; @@ -63,16 +74,18 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern private static final IValidator<MsInjectionSample> RAW_DATA_SAMPLE_VALIDATOR = new RawDataSampleValidator(); + + private static final IValidator<Experiment> EXPERIMENT_VALIDATOR = new ExperimentValidator(); private ICommonBusinessObjectFactory businessObjectFactory; private ISessionManager<Session> sessionManagerFromConstructor; - public RawDataServiceInternal() + public ProteomicsDataServiceInternal() { } - public RawDataServiceInternal(ISessionManager<Session> sessionManager, IDAOFactory daoFactory, + public ProteomicsDataServiceInternal(ISessionManager<Session> sessionManager, IDAOFactory daoFactory, ICommonBusinessObjectFactory businessObjectFactory) { super(sessionManager, daoFactory); @@ -85,9 +98,9 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern sessionManager = sessionManagerFromConstructor; } - public IRawDataServiceInternal createLogger(IInvocationLoggerContext context) + public IProteomicsDataServiceInternal createLogger(IInvocationLoggerContext context) { - return new RawDataServiceInternalLogger(getSessionManager(), context); + return new ProteomicsDataServiceInternalLogger(getSessionManager(), context); } public List<MsInjectionSample> listRawDataSamples(String sessionToken) @@ -102,11 +115,7 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern PersonPE person = session.tryGetPerson(); List<MsInjectionSample> samples = loadAllRawDataSamples(session); - Set<Long> sampleIDs = new HashSet<Long>(); - for (long id : rawDataSampleIDs) - { - sampleIDs.add(id); - } + Set<Long> sampleIDs = asSet(rawDataSampleIDs); List<String> dataSetCodes = new ArrayList<String>(); Map<String, String> parameterBindings = new HashMap<String, String>(); for (MsInjectionSample sample : samples) @@ -125,11 +134,54 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern } } - String dataStoreServerCode = findDataStoreServer(dataSetProcessingKey); - IExternalDataTable externalDataTable = - businessObjectFactory.createExternalDataTable(session); - externalDataTable.processDatasets(dataSetProcessingKey, dataStoreServerCode, dataSetCodes, - parameterBindings); + processDataSets(session, dataSetProcessingKey, dataSetCodes, parameterBindings); + } + + public List<Experiment> listSearchExperiments(String sessionToken) + { + checkSession(sessionToken); + + return listSearchExperiments(); + } + + public void processSearchData(String sessionToken, String dataSetProcessingKey, + long[] searchExperimentIDs) + { + Session session = getSession(sessionToken); + PersonPE person = session.tryGetPerson(); + + Set<Long> ids = asSet(searchExperimentIDs); + List<String> dataSetCodes = new ArrayList<String>(); + List<Experiment> experiments = listSearchExperiments(); + IExternalDataDAO dataSetDAO = getDAOFactory().getExternalDataDAO(); + IExperimentDAO experimentDAO = getDAOFactory().getExperimentDAO(); + for (Experiment experiment : experiments) + { + if (EXPERIMENT_VALIDATOR.isValid(person, experiment) + && ids.contains(experiment.getId())) + { + ExperimentPE exp = experimentDAO.tryGetByTechId(new TechId(experiment.getId())); + List<ExternalDataPE> dataSets = dataSetDAO.listExternalData(exp); + for (ExternalDataPE dataSet : dataSets) + { + dataSetCodes.add(dataSet.getCode()); + } + } + } + + processDataSets(session, dataSetProcessingKey, dataSetCodes, new HashMap<String, String>()); + } + + private List<Experiment> listSearchExperiments() + { + IDAOFactory daoFactory = getDAOFactory(); + IEntityTypeDAO entityTypeDAO = daoFactory.getEntityTypeDAO(EntityKind.EXPERIMENT); + ExperimentTypePE type = + (ExperimentTypePE) entityTypeDAO.tryToFindEntityTypeByCode("MS_SEARCH"); + List<ExperimentPE> experiments = + daoFactory.getExperimentDAO().listExperimentsWithProperties(type, null); + return ExperimentTranslator.translate(experiments, "", + ExperimentTranslator.LoadableFields.PROPERTIES); } private List<MsInjectionSample> loadAllRawDataSamples(Session session) @@ -153,6 +205,16 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern return manager.getSamples(); } + private void processDataSets(Session session, String dataSetProcessingKey, + List<String> dataSetCodes, Map<String, String> parameterBindings) + { + String dataStoreServerCode = findDataStoreServer(dataSetProcessingKey); + IExternalDataTable externalDataTable = + businessObjectFactory.createExternalDataTable(session); + externalDataTable.processDatasets(dataSetProcessingKey, dataStoreServerCode, dataSetCodes, + parameterBindings); + } + private String findDataStoreServer(String dataSetProcessingKey) { List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores(); @@ -171,4 +233,15 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern throw new EnvironmentFailureException("No data store processing service with key '" + dataSetProcessingKey + "' found."); } + + private Set<Long> asSet(long[] ids) + { + Set<Long> result = new HashSet<Long>(); + for (long id : ids) + { + result.add(id); + } + return result; + } } + 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/ProteomicsDataServiceInternalLogger.java similarity index 66% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalLogger.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/ProteomicsDataServiceInternalLogger.java index 784e9f04985..62acc184618 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/ProteomicsDataServiceInternalLogger.java @@ -21,8 +21,9 @@ import java.util.List; import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.common.spring.IInvocationLoggerContext; import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** @@ -30,10 +31,11 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; * * @author Franz-Josef Elmer */ -class RawDataServiceInternalLogger extends AbstractServerLogger implements IRawDataServiceInternal +class ProteomicsDataServiceInternalLogger extends AbstractServerLogger implements + IProteomicsDataServiceInternal { - RawDataServiceInternalLogger(ISessionManager<Session> sessionManager, + ProteomicsDataServiceInternalLogger(ISessionManager<Session> sessionManager, IInvocationLoggerContext context) { super(sessionManager, context); @@ -53,4 +55,17 @@ class RawDataServiceInternalLogger extends AbstractServerLogger implements IRawD numberOfDataSets, dataSetType); } + public List<Experiment> listSearchExperiments(String sessionToken) + { + logAccess(sessionToken, "list_search_experiments"); + return null; + } + + public void processSearchData(String sessionToken, String dataSetProcessingKey, + long[] searchExperimentIDs) + { + int numberOfDataSets = searchExperimentIDs == null ? 0 : searchExperimentIDs.length; + logAccess(sessionToken, "copy_search_data", "NUMBER_OF_DATA_SETS(%s)", numberOfDataSets); + } + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/Constants.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/Constants.java index 728de9189d9..015689596a3 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/Constants.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/Constants.java @@ -24,7 +24,7 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.server.api.v1; public class Constants { // Spring bean IDs - public final static String PHOSPHONETX_RAW_DATA_SERVICE = "phosphonetx-raw-data-service"; - public final static String PHOSPHONETX_RAW_DATA_SERVICE_INTERNAL = "phosphonetx-raw-data-service-internal"; + public final static String PROTEOMICS_DATA_SERVICE = "proteomics-data-service"; + public final static String PROTEOMICS_DATA_SERVICE_INTERNAL = "proteomics-data-service-internal"; } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataService.java similarity index 73% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataService.java index 4600bbe58f4..4f94af701e8 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataService.java @@ -47,30 +47,30 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; import ch.systemsx.cisd.openbis.generic.shared.util.DataTypeUtils; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.PropertyKey; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** - * Implementation of {@link IRawDataService}. + * Implementation of {@link IProteomicsDataService}. * * @author Franz-Josef Elmer */ -@Component(Constants.PHOSPHONETX_RAW_DATA_SERVICE) -public class RawDataService extends AbstractServer<IRawDataService> implements IRawDataService +@Component(Constants.PROTEOMICS_DATA_SERVICE) +public class ProteomicsDataService extends AbstractServer<IProteomicsDataService> implements IProteomicsDataService { - @Resource(name = Constants.PHOSPHONETX_RAW_DATA_SERVICE_INTERNAL) - private IRawDataServiceInternal service; + @Resource(name = Constants.PROTEOMICS_DATA_SERVICE_INTERNAL) + private IProteomicsDataServiceInternal service; - public RawDataService() + public ProteomicsDataService() { } - public RawDataService(final ISessionManager<Session> sessionManager, - final IDAOFactory daoFactory, IRawDataServiceInternal service) + public ProteomicsDataService(final ISessionManager<Session> sessionManager, + final IDAOFactory daoFactory, IProteomicsDataServiceInternal service) { super(sessionManager, daoFactory); this.service = service; @@ -82,9 +82,9 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I return session == null ? null : session.getSessionToken(); } - public IRawDataService createLogger(IInvocationLoggerContext context) + public IProteomicsDataService createLogger(IInvocationLoggerContext context) { - return new RawDataServiceLogger(getSessionManager(), context); + return new ProteomicsDataServiceLogger(getSessionManager(), context); } public List<MsInjectionDataInfo> listRawDataSamples(String sessionToken, String userID) @@ -133,19 +133,6 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I return info; } - private Map<PropertyKey, Serializable> translate(List<IEntityProperty> properties) - { - HashMap<PropertyKey, Serializable> map = new HashMap<PropertyKey, Serializable>(); - for (IEntityProperty property : properties) - { - PropertyType propertyType = property.getPropertyType(); - PropertyKey key = new PropertyKey(propertyType.getCode(), propertyType.getLabel()); - DataTypeCode dataTypeCode = propertyType.getDataType().getCode(); - map.put(key, DataTypeUtils.convertValueTo(dataTypeCode, property.tryGetAsString())); - } - return map; - } - public List<DataStoreServerProcessingPluginInfo> listDataStoreServerProcessingPluginInfos( String sessionToken) { @@ -195,6 +182,67 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I } } + public List<ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment> listSearchExperiments( + String sessionToken, String userID) + { + checkSession(sessionToken); + SessionContextDTO session = login(userID); + try + { + List<Experiment> experiments = service.listSearchExperiments(session.getSessionToken()); + List<ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment> result = + new ArrayList<ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment>(); + for (Experiment experiment : experiments) + { + ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment e = + new ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment(); + e.setId(experiment.getId()); + e.setCode(experiment.getCode()); + e.setProjectCode(experiment.getProject().getCode()); + e.setSpaceCode(experiment.getProject().getSpace().getCode()); + e.setRegistrationDate(experiment.getRegistrationDate()); + e.setProperties(translate(experiment.getProperties())); + result.add(e); + } + return result; + } finally + { + service.logout(session.getSessionToken()); + } + } + + public void processSearchData(String sessionToken, String userID, String dataSetProcessingKey, + long[] searchExperimentIDs) + { + checkSession(sessionToken); + SessionContextDTO session = login(userID); + try + { + service.processSearchData(session.getSessionToken(), dataSetProcessingKey, + searchExperimentIDs); + } finally + { + service.logout(session.getSessionToken()); + } + } + + private Map<PropertyKey, Serializable> translate(List<IEntityProperty> properties) + { + if (properties == null) + { + return null; + } + HashMap<PropertyKey, Serializable> map = new HashMap<PropertyKey, Serializable>(); + for (IEntityProperty property : properties) + { + PropertyType propertyType = property.getPropertyType(); + PropertyKey key = new PropertyKey(propertyType.getCode(), propertyType.getLabel()); + DataTypeCode dataTypeCode = propertyType.getDataType().getCode(); + map.put(key, DataTypeUtils.convertValueTo(dataTypeCode, property.tryGetAsString())); + } + return map; + } + private SessionContextDTO login(String userID) { SessionContextDTO session = service.tryToAuthenticate(userID, "dummy-password"); @@ -212,7 +260,7 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I public int getMinorVersion() { - return 1; + return 2; } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceLogger.java similarity index 74% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceLogger.java index 98cf6922d7a..aa5c525fea4 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceLogger.java @@ -22,17 +22,18 @@ import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.common.spring.IInvocationLoggerContext; import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; /** * @author Franz-Josef Elmer */ -class RawDataServiceLogger extends AbstractServerLogger implements IRawDataService +class ProteomicsDataServiceLogger extends AbstractServerLogger implements IProteomicsDataService { - RawDataServiceLogger(ISessionManager<Session> sessionManager, IInvocationLoggerContext context) + ProteomicsDataServiceLogger(ISessionManager<Session> sessionManager, IInvocationLoggerContext context) { super(sessionManager, context); } @@ -64,6 +65,19 @@ class RawDataServiceLogger extends AbstractServerLogger implements IRawDataServi userID, dataSetProcessingKey, numberOfDataSets, dataSetType); } + public List<Experiment> listSearchExperiments(String sessionToken, String userID) + { + logAccess(sessionToken, "list_search_experiments"); + return null; + } + + public void processSearchData(String sessionToken, String userID, String dataSetProcessingKey, + long[] searchExperimentIDs) + { + int numberOfDataSets = searchExperimentIDs == null ? 0 : searchExperimentIDs.length; + logAccess(sessionToken, "copy_search_data", "NUMBER_OF_DATA_SETS(%s)", numberOfDataSets); + } + public int getMajorVersion() { return 1; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceServer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceServer.java similarity index 69% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceServer.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceServer.java index 16c6ca3fc3a..1aaf05c81b7 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceServer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/ProteomicsDataServiceServer.java @@ -22,26 +22,26 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import ch.systemsx.cisd.common.api.server.AbstractApiServiceExporter; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; /** - * Server wrapping {@link IRawDataService}. + * Server wrapping {@link IProteomicsDataService}. * * @author Franz-Josef Elmer */ @Controller @RequestMapping( - { IRawDataService.SERVER_URL, "/openbis" + IRawDataService.SERVER_URL }) -public class RawDataServiceServer extends AbstractApiServiceExporter + { IProteomicsDataService.SERVER_URL, "/openbis" + IProteomicsDataService.SERVER_URL }) +public class ProteomicsDataServiceServer extends AbstractApiServiceExporter { - @Resource(name = Constants.PHOSPHONETX_RAW_DATA_SERVICE) - private IRawDataService service; + @Resource(name = Constants.PROTEOMICS_DATA_SERVICE) + private IProteomicsDataService service; @Override public void afterPropertiesSet() { - establishService(IRawDataService.class, service, IRawDataService.SERVICE_NAME, - IRawDataService.SERVER_URL); + establishService(IProteomicsDataService.class, service, IProteomicsDataService.SERVICE_NAME, + IProteomicsDataService.SERVER_URL); super.afterPropertiesSet(); } } 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/IProteomicsDataServiceInternal.java similarity index 74% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataServiceInternal.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IProteomicsDataServiceInternal.java index a4d819a6e21..b707130cdc5 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/IProteomicsDataServiceInternal.java @@ -23,6 +23,8 @@ import org.springframework.transaction.annotation.Transactional; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.ReturnValueFilter; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed; +import ch.systemsx.cisd.openbis.generic.shared.authorization.validator.ExperimentValidator; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.authorization.validator.RawDataSampleValidator; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; @@ -32,7 +34,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; * * @author Franz-Josef Elmer */ -public interface IRawDataServiceInternal extends IServer +public interface IProteomicsDataServiceInternal extends IServer { /** * Returns all samples of type MS_INJECTION in group MS_DATA which have a parent sample which @@ -47,4 +49,15 @@ public interface IRawDataServiceInternal extends IServer @RolesAllowed(RoleWithHierarchy.SPACE_USER) public void processRawData(String sessionToken, String dataSetProcessingKey, long[] rawDataSampleIDs, String dataSetType); + + @Transactional(readOnly = true) + @RolesAllowed(RoleWithHierarchy.SPACE_USER) + @ReturnValueFilter(validatorClass = ExperimentValidator.class) + public List<Experiment> listSearchExperiments(String sessionToken); + + @Transactional(readOnly = true) + @RolesAllowed(RoleWithHierarchy.SPACE_USER) + public void processSearchData(String sessionToken, String dataSetProcessingKey, + long[] searchExperimentIDs); + } \ No newline at end of file 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 f33481e7497..318fc560230 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 @@ -31,7 +31,7 @@ public class ResourceNames public final static String PHOSPHONETX_PLUGIN_SERVER = "phosphonetx-plugin-server"; - public final static String PHOSPHONETX_RAW_DATA_SERVICE_WEB = "phosphonetx-raw-data-service-web"; + public final static String PHOSPHONETX_RAW_DATA_SERVICE_WEB = "proteomics-data-service-web"; public final static String PHOSPHONETX_DAO_FACTORY = "phosphonetx-dao-factory"; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IProteomicsDataService.java similarity index 73% rename from rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java rename to rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IProteomicsDataService.java index d9793dedec3..79357b48be4 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IProteomicsDataService.java @@ -24,19 +24,20 @@ import ch.systemsx.cisd.common.api.IRpcService; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.Experiment; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; /** - * Service for querying raw data. * + * * @author Franz-Josef Elmer */ -public interface IRawDataService extends IRpcService +public interface IProteomicsDataService extends IRpcService { /** * Name of this service for which it is registered at the RPC name server. */ - public static final String SERVICE_NAME = "phosphonetx-raw-data"; + public static final String SERVICE_NAME = "proteomics-data"; /** * Service part of the URL to access this service remotely. @@ -59,7 +60,7 @@ public interface IRawDataService extends IRpcService /** * Returns all samples of type MS_INJECTION in space MS_DATA which have a parent sample which - * the specified user is allow to read. + * the specified user is allowed to read. */ @Transactional(readOnly = true) @RolesAllowed(RoleWithHierarchy.INSTANCE_OBSERVER) @@ -82,4 +83,23 @@ public interface IRawDataService extends IRpcService @RolesAllowed(RoleWithHierarchy.INSTANCE_OBSERVER) public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, long[] rawDataSampleIDs, String dataSetType); + + /** + * Returns all experiments of type <tt>MS_SEARCH</tt> which the specified user is allowed to + * read. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleWithHierarchy.INSTANCE_OBSERVER) + public List<Experiment> listSearchExperiments(String sessionToken, String userID); + + /** + * Processes the data sets of specified experiments of type <tt>MS_SEARCH</tt> by the DSS + * processing plug-in of specified key for the specified user. It will be checked if the + * experiments are of search experiments and if the user is allowed to read them. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleWithHierarchy.INSTANCE_OBSERVER) + public void processSearchData(String sessionToken, String userID, String dataSetProcessingKey, + long[] searchExperimentIDs); + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/dto/Experiment.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/dto/Experiment.java new file mode 100644 index 00000000000..a0d5e366092 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/dto/Experiment.java @@ -0,0 +1,105 @@ +/* + * 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.shared.api.v1.dto; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class Experiment implements Serializable +{ + private static final long serialVersionUID = 1L; + + private long id; + + private String spaceCode; + + private String projectCode; + + private String code; + + private Date registrationDate; + + private Map<PropertyKey, Serializable> properties; + + public final long getId() + { + return id; + } + + public final void setId(long id) + { + this.id = id; + } + + public final String getSpaceCode() + { + return spaceCode; + } + + public final void setSpaceCode(String spaceCode) + { + this.spaceCode = spaceCode; + } + + public final String getProjectCode() + { + return projectCode; + } + + public final void setProjectCode(String projectCode) + { + this.projectCode = projectCode; + } + + public final String getCode() + { + return code; + } + + public final void setCode(String code) + { + this.code = code; + } + + public final Date getRegistrationDate() + { + return registrationDate; + } + + public final void setRegistrationDate(Date registrationDate) + { + this.registrationDate = registrationDate; + } + + public final Map<PropertyKey, Serializable> getProperties() + { + return properties; + } + + public final void setProperties(Map<PropertyKey, Serializable> properties) + { + this.properties = properties; + } + + +} diff --git a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml index 0c7bfcc2844..5bec6ae66f6 100644 --- a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml +++ b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml @@ -41,31 +41,11 @@ </bean> <!-- - // Raw Data Server + // Proteomics Data Server --> - <!--bean id="phosphonetx-raw-data-service" class="org.springframework.aop.framework.ProxyFactoryBean"> - <property name="proxyInterfaces"> - <list> - <value>ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService</value> - </list> - </property> - <property name="target"> - <bean class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.api.v1.RawDataService"> - <constructor-arg ref="session-manager" /> - <constructor-arg ref="dao-factory" /> - <constructor-arg ref="phosphonetx-raw-data-service-internal" /> - </bean> - </property> - <property name="interceptorNames"> - <list> - <value>exception-translator</value> - </list> - </property> - </bean--> - - <bean id="phosphonetx-raw-data-service-internal" - class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal" + <bean id="proteomics-data-service-internal" + class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.ProteomicsDataServiceInternal" init-method="replaceAutoWiredSesseionManagerByConstructorSessionManager"> <constructor-arg> <bean class="ch.systemsx.cisd.authentication.DefaultSessionManager"> @@ -88,8 +68,8 @@ <constructor-arg ref="common-business-object-factory" /> </bean> - <bean id="phosphonetx-raw-data-service-web" - class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal"> + <bean id="proteomics-data-service-web" + class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.ProteomicsDataServiceInternal"> <constructor-arg ref="session-manager" /> <constructor-arg ref="dao-factory"/> <constructor-arg ref="common-business-object-factory" /> diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacadeTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacadeTest.java similarity index 90% rename from rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacadeTest.java rename to rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacadeTest.java index c396731b465..331053b5ece 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/RawDataApiFacadeTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/api/v1/ProteomicsDataApiFacadeTest.java @@ -34,7 +34,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Role; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SpaceWithProjectsAndRoleAssignments; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; @@ -43,22 +43,22 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjection * * @author Franz-Josef Elmer */ -public class RawDataApiFacadeTest extends AssertJUnit +public class ProteomicsDataApiFacadeTest extends AssertJUnit { private static final String SESSION_TOKEN = "Session-42"; private Mockery context; - private IRawDataService rawDataService; + private IProteomicsDataService proteomicsDataService; private IGeneralInformationService generalInfoService; - private IRawDataApiFacade facade; + private IProteomicsDataApiFacade facade; @BeforeMethod public void beforeMethod() { context = new Mockery(); - rawDataService = context.mock(IRawDataService.class); + proteomicsDataService = context.mock(IProteomicsDataService.class); generalInfoService = context.mock(IGeneralInformationService.class); - facade = new RawDataApiFacade(rawDataService, generalInfoService, SESSION_TOKEN); + facade = new ProteomicsDataApiFacade(proteomicsDataService, generalInfoService, SESSION_TOKEN); } @AfterMethod @@ -98,7 +98,7 @@ public class RawDataApiFacadeTest extends AssertJUnit context.checking(new Expectations() { { - one(rawDataService).listDataStoreServerProcessingPluginInfos(SESSION_TOKEN); + one(proteomicsDataService).listDataStoreServerProcessingPluginInfos(SESSION_TOKEN); will(returnValue(result)); } }); @@ -114,7 +114,7 @@ public class RawDataApiFacadeTest extends AssertJUnit context.checking(new Expectations() { { - one(rawDataService).listRawDataSamples(SESSION_TOKEN, "user1"); + one(proteomicsDataService).listRawDataSamples(SESSION_TOKEN, "user1"); will(returnValue(result)); } }); @@ -129,7 +129,7 @@ public class RawDataApiFacadeTest extends AssertJUnit context.checking(new Expectations() { { - one(rawDataService).processingRawData(SESSION_TOKEN, "user1", "key", + one(proteomicsDataService).processingRawData(SESSION_TOKEN, "user1", "key", new long[42], "type"); } }); diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProviderTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProviderTest.java index 3607d05d025..ff4a334e871 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProviderTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/RawDataSampleProviderTest.java @@ -39,7 +39,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericValueEntityPrope import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** @@ -50,7 +50,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; @Friend(toClasses=RawDataSampleProvider.class) public class RawDataSampleProviderTest extends AbstractServerTestCase { - private IRawDataServiceInternal service; + private IProteomicsDataServiceInternal service; private RawDataSampleProvider provider; @Override @@ -58,7 +58,7 @@ public class RawDataSampleProviderTest extends AbstractServerTestCase public final void setUp() { super.setUp(); - service = context.mock(IRawDataServiceInternal.class); + service = context.mock(IProteomicsDataServiceInternal.class); provider = new RawDataSampleProvider(service, SESSION_TOKEN); } 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/ProteomicsDataServiceInternalTest.java similarity index 94% rename from rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternalTest.java rename to rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/ProteomicsDataServiceInternalTest.java index b99cbae40b3..a34d1c2e83a 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/ProteomicsDataServiceInternalTest.java @@ -18,8 +18,8 @@ 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.RAW_DATA_SAMPLE_TYPE; -import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal.SPACE_CODE; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.ProteomicsDataServiceInternal.RAW_DATA_SAMPLE_TYPE; +import static ch.systemsx.cisd.openbis.plugin.phosphonetx.server.ProteomicsDataServiceInternal.SPACE_CODE; import java.util.ArrayList; import java.util.Arrays; @@ -49,18 +49,18 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; /** * @author Franz-Josef Elmer */ -@Friend(toClasses = RawDataServiceInternal.class) -public class RawDataServiceInternalTest extends AbstractServerTestCase +@Friend(toClasses = ProteomicsDataServiceInternal.class) +public class ProteomicsDataServiceInternalTest extends AbstractServerTestCase { private static final String COPY_PROCESSING_KEY = "copy-data-sets"; - private IRawDataServiceInternal service; + private IProteomicsDataServiceInternal service; private ICommonBusinessObjectFactory boFactory; @@ -70,7 +70,7 @@ public class RawDataServiceInternalTest extends AbstractServerTestCase { super.setUp(); boFactory = context.mock(ICommonBusinessObjectFactory.class); - service = new RawDataServiceInternal(sessionManager, daoFactory, boFactory); + service = new ProteomicsDataServiceInternal(sessionManager, daoFactory, boFactory); } @Test 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/ProteomicsDataServiceTest.java similarity index 95% rename from rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceTest.java rename to rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/ProteomicsDataServiceTest.java index c80fdc3802b..f5f07086470 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/ProteomicsDataServiceTest.java @@ -43,9 +43,9 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.api.v1.RawDataService; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; -import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.api.v1.ProteomicsDataService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IProteomicsDataServiceInternal; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IProteomicsDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.DataStoreServerProcessingPluginInfo; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.MsInjectionDataInfo; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.dto.PropertyKey; @@ -56,13 +56,13 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample; * * @author Franz-Josef Elmer */ -public class RawDataServiceTest extends AbstractServerTestCase +public class ProteomicsDataServiceTest extends AbstractServerTestCase { private static final String RAW_DATA = "RAW_DATA"; private static final String MZXML_DATA = "MZXML_DATA"; - private IRawDataServiceInternal internalService; - private IRawDataService service; + private IProteomicsDataServiceInternal internalService; + private IProteomicsDataService service; private SessionContextDTO session2; @Override @@ -70,8 +70,8 @@ public class RawDataServiceTest extends AbstractServerTestCase public final void setUp() { super.setUp(); - internalService = context.mock(IRawDataServiceInternal.class); - service = new RawDataService(sessionManager, daoFactory, internalService); + internalService = context.mock(IProteomicsDataServiceInternal.class); + service = new ProteomicsDataService(sessionManager, daoFactory, internalService); session2 = new SessionContextDTO(); session2.setSessionToken(SESSION_TOKEN + "2"); } -- GitLab