diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java index 19c752bbdd48320f933f571b757e3479d8a9f787..29f9a7f87e4e5eec0d8a201c79be78653776597e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java @@ -604,6 +604,7 @@ public class DatasetLister extends AbstractLister implements IDatasetLister { DataStore result = new DataStore(); setCode(result, codeRecord); + result.setHostUrl(codeRecord.download_url); String downloadUrl = DataStoreTranslator.translateDownloadUrl(codeRecord.download_url); result.setDownloadUrl(downloadUrl); return result; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataStore.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataStore.java index 160d96b814246abbe3908a9eb989f84d5ccd46d6..3e984cd1fffdccaf7dc160c5f58c668b774c00a3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataStore.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DataStore.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * @author Izabela Adamczyk */ @@ -26,6 +25,8 @@ public class DataStore extends Code<DataStore> private String downloadUrl; + private String hostUrl; + public String getDownloadUrl() { return downloadUrl; @@ -36,4 +37,14 @@ public class DataStore extends Code<DataStore> this.downloadUrl = downloadUrl; } + public String getHostUrl() + { + return hostUrl; + } + + public void setHostUrl(String hostUrl) + { + this.hostUrl = hostUrl; + } + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataStoreTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataStoreTranslator.java index b88b711e6bbd669fa942d2dec01b1600022a95c1..ec288227a1808cf30c87ca5436763b976d8ceb2b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataStoreTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DataStoreTranslator.java @@ -30,6 +30,7 @@ public class DataStoreTranslator { DataStore dataStore = new DataStore(); String downloadUrl = dataStorePE.getDownloadUrl(); + dataStore.setHostUrl(downloadUrl); downloadUrl = translateDownloadUrl(downloadUrl); dataStore.setDownloadUrl(downloadUrl); dataStore.setCode(dataStorePE.getCode()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java index b85932457ed5ef0e80b14e3a83d8e7cdfb752ea8..bd208f839494ca5cc071e6789f9a5a7c490c387d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java @@ -476,6 +476,7 @@ public final class CommonClientServiceTest extends AbstractClientServiceTest assertEquals(1, list.size()); ExternalData data = list.get(0); // assertEquals(code, data.getCode()); + assertEquals(DATA_STORE_BASE_URL, data.getDataStore().getHostUrl()); assertEquals(DATA_STORE_BASE_URL + "/" + DATA_STORE_SERVER_WEB_APPLICATION_NAME, data .getDataStore().getDownloadUrl()); assertEquals("PNG", data.getFileFormatType().getCode()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExternalDataTranslatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExternalDataTranslatorTest.java index 989b7a726ff53c493806883f197c474c859ed490..8e533905e05c33124c660bbfb43b3cc7af894864 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExternalDataTranslatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExternalDataTranslatorTest.java @@ -35,13 +35,13 @@ 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.FileFormatTypePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; import ch.systemsx.cisd.openbis.generic.shared.dto.InvalidationPE; import ch.systemsx.cisd.openbis.generic.shared.dto.LocatorTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; /** * @author Franz-Josef Elmer @@ -122,6 +122,7 @@ public class ExternalDataTranslatorTest extends AssertJUnit ExternalData externalData = ExternalDataTranslator.translate(externalDataPE, BASE_INDEX_URL); + assertEquals(DOWNLOAD_URL, externalData.getDataStore().getHostUrl()); assertEquals(DOWNLOAD_URL + "/" + DATA_STORE_SERVER_WEB_APPLICATION_NAME, externalData .getDataStore().getDownloadUrl()); assertEquals("code", externalData.getCode());