Initial separation of API and View URLs
authorChristos KK Loverdos <loverdos@gmail.com>
Mon, 10 Jun 2013 11:52:02 +0000 (14:52 +0300)
committerChristos KK Loverdos <loverdos@gmail.com>
Mon, 10 Jun 2013 11:52:02 +0000 (14:52 +0300)
Refs #3965

src/gr/grnet/pithos/web/client/FileList.java
src/gr/grnet/pithos/web/client/Pithos.java

index 4398321..2785186 100644 (file)
 
 package gr.grnet.pithos.web.client;
 
-import gr.grnet.pithos.web.client.foldertree.File;
-import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.foldertree.FolderTreeView;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
 import com.google.gwt.cell.client.Cell.Context;
 import com.google.gwt.cell.client.ImageResourceCell;
 import com.google.gwt.cell.client.SafeHtmlCell;
@@ -73,6 +62,11 @@ import com.google.gwt.view.client.ListDataProvider;
 import com.google.gwt.view.client.MultiSelectionModel;
 import com.google.gwt.view.client.ProvidesKey;
 import com.google.gwt.view.client.SelectionChangeEvent;
+import gr.grnet.pithos.web.client.foldertree.File;
+import gr.grnet.pithos.web.client.foldertree.Folder;
+import gr.grnet.pithos.web.client.foldertree.FolderTreeView;
+
+import java.util.*;
 
 /**
  * A composite that displays the list of files in a particular folder.
@@ -415,7 +409,7 @@ public class FileList extends Composite {
                if (DOM.eventGetType(event) == Event.ONDBLCLICK)
                        if (getSelectedFiles().size() == 1) {
                                File file = getSelectedFiles().get(0);
-                               Window.open(Pithos.getStorageAPIURL() + file.getOwnerID() + file.getUri(), "_blank", "");
+                               Window.open(Pithos.getStorageViewURL() + file.getOwnerID() + file.getUri(), "_blank", "");
                                event.preventDefault();
                                return;
                        }
index 3d575f9..57e6841 100644 (file)
@@ -130,6 +130,20 @@ public class Pithos implements EntryPoint, ResizeHandler {
 
         LOG("Computed STORAGE_API_URL = ", STORAGE_API_URL);
     }
+
+    public static final String STORAGE_VIEW_URL;
+    static {
+        final String viewURL = getFromOtherPropertiesOrNull("STORAGE_VIEW_URL");
+        if(viewURL != null) {
+            STORAGE_VIEW_URL = viewURL;
+        }
+        else {
+            STORAGE_VIEW_URL = STORAGE_API_URL;
+        }
+
+        LOG("Computed STORAGE_VIEW_URL = ", STORAGE_VIEW_URL);
+    }
+
     public static final String USER_CATALOGS_API_URL;
     static {
         if(OTHERPROPS_USER_CATALOGS_API_URL != null) {
@@ -1083,6 +1097,10 @@ public class Pithos implements EntryPoint, ResizeHandler {
         return STORAGE_API_URL;
     }
 
+    public static String getStorageViewURL() {
+        return STORAGE_VIEW_URL;
+    }
+
     public static String getUserCatalogsURL() {
         return USER_CATALOGS_API_URL;
     }