From 6e6e4c0069e3bbb18acb8886bb184ff3f67ae00f Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Mon, 4 Mar 2013 11:07:20 +0000
Subject: [PATCH] SP-417, BIS-278: Add /openbis to download link.

SVN: 28504
---
 .../cisd/openbis/generic/shared/api/v1/Translator.java    | 2 +-
 .../openbis/generic/shared/api/v1/TranslatorTest.java     | 8 ++++----
 .../api/v1/GeneralInformationServiceJsonApiTest.java      | 8 ++++----
 .../systemtest/api/v1/GeneralInformationServiceTest.java  | 8 ++++----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java
index 497867c9e5e..7eec193a58a 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java
@@ -663,7 +663,7 @@ public class Translator
         regDetailsInitializer.setEmail(attachment.getRegistrator().getEmail());
         initializer.setRegistrationDetails(new EntityRegistrationDetails(regDetailsInitializer));
         URLMethodWithParameters url =
-                new URLMethodWithParameters("/openbis/"
+                new URLMethodWithParameters("/openbis/openbis/"
                         + AttachmentDownloadConstants.ATTACHMENT_DOWNLOAD_SERVLET_NAME);
         url.addParameter(GenericSharedConstants.SESSION_ID_PARAMETER, sessionToken);
         url.addParameter(AttachmentDownloadConstants.ATTACHMENT_HOLDER_PARAMETER,
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java
index c5a05cbfc77..98f41c3ecc3 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java
@@ -259,13 +259,13 @@ public class TranslatorTest extends AssertJUnit
                 + "registrationDate=Thu Jan 01 01:00:04 CET 1970, "
                 + "userFirstName=Albert, userLastName=Einstein, "
                 + "userEmail=ae@ae.ch, userId=ae, "
-                + "downloadLink=/openbis/attachment-download?sessionID=st-1&"
+                + "downloadLink=/openbis/openbis/attachment-download?sessionID=st-1&"
                 + "attachmentHolder=EXPERIMENT&id=1234&fileName=test.txt&version=2], "
                 + "Attachment [fileName=test.txt, version=1, title=Title, "
                 + "description=File:test.txt, version:1, "
                 + "registrationDate=Thu Jan 01 01:00:04 CET 1970, "
                 + "userFirstName=Albert, userLastName=Einstein, userEmail=ae@ae.ch, userId=ae, "
-                + "downloadLink=/openbis/attachment-download?sessionID=st-1&"
+                + "downloadLink=/openbis/openbis/attachment-download?sessionID=st-1&"
                 + "attachmentHolder=EXPERIMENT&id=1234&fileName=test.txt&version=1]]",
                 attachments.toString());
         assertEquals(2, attachments.size());
@@ -291,13 +291,13 @@ public class TranslatorTest extends AssertJUnit
                 + "registrationDate=Thu Jan 01 01:00:04 CET 1970, "
                 + "userFirstName=Albert, userLastName=Einstein, "
                 + "userEmail=ae@ae.ch, userId=ae, "
-                + "downloadLink=/openbis/attachment-download?sessionID=st-1&"
+                + "downloadLink=/openbis/openbis/attachment-download?sessionID=st-1&"
                 + "attachmentHolder=EXPERIMENT&id=1234&fileName=greetings.txt&version=2], "
                 + "Attachment [fileName=test.txt, version=3, title=Title, "
                 + "description=File:test.txt, version:3, "
                 + "registrationDate=Thu Jan 01 01:00:04 CET 1970, "
                 + "userFirstName=Albert, userLastName=Einstein, userEmail=ae@ae.ch, userId=ae, "
-                + "downloadLink=/openbis/attachment-download?sessionID=st-1&"
+                + "downloadLink=/openbis/openbis/attachment-download?sessionID=st-1&"
                 + "attachmentHolder=EXPERIMENT&id=1234&fileName=test.txt&version=3]]",
                 attachments.toString());
         assertEquals(2, attachments.size());
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java
index fb05bb00546..472d79df764 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java
@@ -820,7 +820,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase
             assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
             assertNotNull(a.getRegistrationDetails().getUserFirstName());
             assertNotNull(a.getRegistrationDetails().getUserLastName());
-            assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+            assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                     + "&attachmentHolder=EXPERIMENT&id=2&fileName=exampleExperiments.txt&version="
                     + version, a.getDownloadLink());
             --version;
@@ -852,7 +852,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=EXPERIMENT&id=2&fileName=exampleExperiments.txt&version=4",
                 a.getDownloadLink());
 
@@ -892,7 +892,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=SAMPLE&id=987&fileName=sampleHistory.txt&version=1",
                 a.getDownloadLink());
 
@@ -960,7 +960,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=PROJECT&id=3&fileName=projectDescription.txt&version=1",
                 a.getDownloadLink());
     }
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
index 4a1eaf90a46..a886056c5dd 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
@@ -1702,7 +1702,7 @@ public class GeneralInformationServiceTest extends SystemTestCase
             assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
             assertNotNull(a.getRegistrationDetails().getUserFirstName());
             assertNotNull(a.getRegistrationDetails().getUserLastName());
-            assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+            assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                     + "&attachmentHolder=EXPERIMENT&id=2&fileName=exampleExperiments.txt&version="
                     + version, a.getDownloadLink());
             --version;
@@ -1734,7 +1734,7 @@ public class GeneralInformationServiceTest extends SystemTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=EXPERIMENT&id=2&fileName=exampleExperiments.txt&version=4",
                 a.getDownloadLink());
 
@@ -1777,7 +1777,7 @@ public class GeneralInformationServiceTest extends SystemTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=SAMPLE&id=987&fileName=sampleHistory.txt&version=1",
                 a.getDownloadLink());
 
@@ -1845,7 +1845,7 @@ public class GeneralInformationServiceTest extends SystemTestCase
         assertEquals("franz-josef.elmer@systemsx.ch", a.getRegistrationDetails().getUserEmail());
         assertNotNull(a.getRegistrationDetails().getUserFirstName());
         assertNotNull(a.getRegistrationDetails().getUserLastName());
-        assertEquals("/openbis/attachment-download?sessionID=" + sessionToken
+        assertEquals("/openbis/openbis/attachment-download?sessionID=" + sessionToken
                 + "&attachmentHolder=PROJECT&id=3&fileName=projectDescription.txt&version=1",
                 a.getDownloadLink());
 
-- 
GitLab