From b20206f6ec5743c0a8abdc122c583cff64ec3218 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Mon, 30 Jul 2012 07:32:50 +0000 Subject: [PATCH] Add getDataStoreBaseUrl() to AggregationServiceDescription to be able to put files for an aggregation service. SVN: 26270 --- .../query/server/api/v1/QueryApiServer.java | 15 ++++++++++----- .../query/shared/api/v1/IQueryApiServer.java | 6 +++--- .../v1/dto/AggregationServiceDescription.java | 19 ++++++++++++++++++- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryApiServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryApiServer.java index 518fedae0f6..3dd2987ed3b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryApiServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryApiServer.java @@ -195,7 +195,8 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I { checkSession(sessionToken); - List<AggregationServiceDescription> services = new ArrayList<AggregationServiceDescription>(); + List<AggregationServiceDescription> services = + new ArrayList<AggregationServiceDescription>(); List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores(); for (DataStorePE dataStore : dataStores) { @@ -211,6 +212,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I AggregationServiceDescription info = new AggregationServiceDescription(); info.setServiceKey(service.getKey()); info.setDataStoreCode(dataStore.getCode()); + info.setDataStoreBaseUrl(dataStore.getDownloadUrl()); services.add(info); } } @@ -219,13 +221,16 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I } @Override - public QueryTableModel createReportFromAggregationService(String sessionToken, String dataStoreCode, String serviceKey, Map<String, Object> parameters) + public QueryTableModel createReportFromAggregationService(String sessionToken, + String dataStoreCode, String serviceKey, Map<String, Object> parameters) { checkSession(sessionToken); DatastoreServiceDescription description = - DatastoreServiceDescription.reporting(serviceKey, "", new String[0], dataStoreCode, ReportingPluginType.AGGREGATION_TABLE_MODEL); - return translate(commonServer.createReportFromAggregationService(sessionToken, description, parameters)); + DatastoreServiceDescription.reporting(serviceKey, "", new String[0], dataStoreCode, + ReportingPluginType.AGGREGATION_TABLE_MODEL); + return translate(commonServer.createReportFromAggregationService(sessionToken, description, + parameters)); } @Override @@ -237,7 +242,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I @Override public int getMinorVersion() { - return 3; + return 4; } private QueryTableModel translate(TableModel result) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java index 643b243ccf9..397c80850c0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java @@ -28,7 +28,7 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.ReportDescription; /** - * Public API interface to query server (version 1.2). + * Public API interface to query server (version 1.4). * * @author Franz-Josef Elmer */ @@ -114,7 +114,7 @@ public interface IQueryApiServer extends IRpcService * @since 1.3 */ @Transactional(readOnly = true) - public QueryTableModel createReportFromAggregationService(String sessionToken, String dataStoreCode, - String serviceKey, Map<String, Object> parameters); + public QueryTableModel createReportFromAggregationService(String sessionToken, + String dataStoreCode, String serviceKey, Map<String, Object> parameters); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/AggregationServiceDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/AggregationServiceDescription.java index 0a1589fee6b..3081ba82603 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/AggregationServiceDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/AggregationServiceDescription.java @@ -32,18 +32,30 @@ public class AggregationServiceDescription implements Serializable private String dataStoreCode; + private String dataStoreBaseUrl; + private String serviceKey; private AggregationServiceType type; /** - * The code of the data store the provides this service. Non-null. + * The code of the data store that provides this service. Non-null. */ public String getDataStoreCode() { return dataStoreCode; } + /** + * Returns the base URL of the data store that provides this service. Non-null. + * + * @since 1.4 + */ + public String getDataStoreBaseUrl() + { + return dataStoreBaseUrl; + } + /** * The key that identifies this particular service. Non-null. */ @@ -67,6 +79,11 @@ public class AggregationServiceDescription implements Serializable this.dataStoreCode = dataStoreCode; } + public void setDataStoreBaseUrl(String dataStoreBaseUrl) + { + this.dataStoreBaseUrl = dataStoreBaseUrl; + } + public void setServiceKey(String key) { this.serviceKey = key; -- GitLab