diff --git a/openbis/build/build.xml b/openbis/build/build.xml index 28c3090319045805cd1a833facb98d00c31e8f03..530dd4b657aef782f013110bbea9a35767d49138 100644 --- a/openbis/build/build.xml +++ b/openbis/build/build.xml @@ -235,6 +235,8 @@ <packageset dir="../openbis/${sources}"> <include name="ch/systemsx/cisd/openbis/plugin/query/client/api/v1/**" /> <include name="ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/**" /> + <include name="ch/systemsx/cisd/openbis/generic/shared/api/v1/**" /> + <include name="ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/**" /> </packageset> </javadoc> <zip destfile="${query.api.doc.zip}"> @@ -243,7 +245,7 @@ <delete dir="${dist}/${query.api}" /> <zip destfile="${query.api.src.zip}"> <zipfileset dir="../openbis/${sources}" includes="ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/**" /> - <zipfileset dir="../openbis/${sources}" includes="ch/systemsx/cisd/openbis/plugin/query/client/api/v1/*.java" /> + <zipfileset dir="../openbis/${sources}" includes="ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/**" /> </zip> </target> @@ -569,6 +571,7 @@ <include name="ch/systemsx/cisd/common/spring/HttpInvokerUtils.class" /> <include name="ch/systemsx/cisd/common/api/**/*.class" /> <exclude name="ch/systemsx/cisd/common/api/server/**/*.class" /> + <include name="ch/systemsx/cisd/openbis/generic/shared/api/**/*.class" /> <include name="ch/systemsx/cisd/openbis/plugin/query/**/api/**/*.class" /> <exclude name="ch/systemsx/cisd/openbis/**/server/api/**/*.class" /> <include name="ch/systemsx/cisd/openbis/BuildAndEnvironmentInfo.class" /> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java index 17c5b712a26df967c061a913823bd1de0c61f67c..38983c1c333fc1f1195ba9a2238c8ecfccfe5285 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java @@ -17,6 +17,7 @@ package ch.systemsx.cisd.openbis.plugin.query.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.query.shared.api.v1.IQueryApiServer; /** @@ -26,21 +27,25 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer; */ public class FacadeFactory { - private static final ServiceFinder SERVICE_FINDER = - new ServiceFinder("openbis", IQueryApiServer.QUERY_PLUGIN_SERVER_URL); + private static final ServiceFinder QUERY_SERVICE_FINDER = new ServiceFinder("openbis", + IQueryApiServer.QUERY_PLUGIN_SERVER_URL); + + private static final ServiceFinder GENERAL_INFORMATION_SERVICE_FINDER = new ServiceFinder( + "openbis", IGeneralInformationService.SERVICE_URL); /** * Creates a facade for specified server URL, user Id, and password. */ public static IQueryApiFacade create(String serverURL, String userID, String password) { - IQueryApiServer service = createService(serverURL); + IQueryApiServer service = createQueryService(serverURL); String sessionToken = service.tryToAuthenticateAtQueryServer(userID, password); if (sessionToken == null) { throw new IllegalArgumentException("User " + userID + " couldn't be authenticated"); } - return new QueryApiFacade(service, sessionToken); + // Login at one service is enough + return new QueryApiFacade(service, createGeneralInfoService(serverURL), sessionToken); } /** @@ -48,11 +53,18 @@ public class FacadeFactory */ public static IQueryApiFacade create(String serverURL, String sessionToken) { - return new QueryApiFacade(createService(serverURL), sessionToken); + return new QueryApiFacade(createQueryService(serverURL), + createGeneralInfoService(serverURL), sessionToken); } - - private static IQueryApiServer createService(String serverURL) + + private static IQueryApiServer createQueryService(String serverURL) + { + return QUERY_SERVICE_FINDER.createService(IQueryApiServer.class, serverURL); + } + + private static IGeneralInformationService createGeneralInfoService(String serverURL) { - return SERVICE_FINDER.createService(IQueryApiServer.class, serverURL); + return GENERAL_INFORMATION_SERVICE_FINDER.createService(IGeneralInformationService.class, + serverURL); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java index f8c1287d16d6930caab832410cb4d518eee0cd27..84d4afa457f59bfba00030ca3006afbb8de4ce9f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.query.client.api.v1; import java.util.List; import java.util.Map; +import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryDescription; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.ReportDescription; @@ -57,6 +58,11 @@ public interface IQueryApiFacade public QueryTableModel createReportFromDataSets(ReportDescription reportDescription, List<String> dataSetCodes); + /** + * Returns a remote access to the {@link IGeneralInformationService}. + */ + public IGeneralInformationService getGeneralInformationService(); + /** * Logs current user out. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/QueryApiFacade.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/QueryApiFacade.java index a82723e8bd13d067afbc45cf745e434ef218c8a6..a8e1b94359ec0ad3a9fcae4d463ca6cf79895fd7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/QueryApiFacade.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/QueryApiFacade.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.query.client.api.v1; import java.util.List; import java.util.Map; +import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryDescription; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel; @@ -31,11 +32,15 @@ class QueryApiFacade implements IQueryApiFacade { private final IQueryApiServer service; + private final IGeneralInformationService generalInformationService; + private final String sessionToken; - QueryApiFacade(IQueryApiServer service, String sessionToken) + QueryApiFacade(IQueryApiServer service, IGeneralInformationService generalInformationService, + String sessionToken) { this.service = service; + this.generalInformationService = generalInformationService; this.sessionToken = sessionToken; } @@ -49,6 +54,11 @@ class QueryApiFacade implements IQueryApiFacade service.logout(sessionToken); } + public IGeneralInformationService getGeneralInformationService() + { + return generalInformationService; + } + public List<QueryDescription> listQueries() { return service.listQueries(sessionToken);