Added meta data to file properties dialog. Still unstyled
[pithos-web-client] / src / gr / grnet / pithos / web / client / Pithos.java
index 47f1ac8..ca7b076 100644 (file)
@@ -245,7 +245,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
     GroupTreeViewModel groupTreeViewModel;
     private GroupTreeView groupTreeView;
 
-    private TreeView selectedTree;
+    TreeView selectedTree;
     protected AccountResource account;
     
     Folder trash;
@@ -264,6 +264,8 @@ public class Pithos implements EntryPoint, ResizeHandler {
     
     private HTML numOfFiles;
     
+    private Image refreshButton;
+
     private Image toolsButton;
 
        @Override
@@ -311,6 +313,27 @@ public class Pithos implements EntryPoint, ResizeHandler {
         header.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER);
         header.setCellVerticalAlignment(messagePanel, HasVerticalAlignment.ALIGN_MIDDLE);
         
+        refreshButton = new Image(images.refresh());
+        refreshButton.addStyleName("pithos-toolsButton");
+        refreshButton.setWidth("32px");
+        refreshButton.setHeight("32px");
+        refreshButton.addClickHandler(new ClickHandler() {
+                       
+                       @Override
+                       public void onClick(@SuppressWarnings("unused") ClickEvent event) {
+                       boolean isFolderTreeSelected = selectedTree.equals(getFolderTreeView());
+                       boolean otherSharedTreeSelected = selectedTree.equals(getOtherSharedTreeView());
+                       Folder folder = getSelectedTree().getSelection();
+                       
+                       if (folder != null && (isFolderTreeSelected || otherSharedTreeSelected))
+                               updateFolder(folder, true, null);
+                       }
+               });
+        header.add(refreshButton);
+        header.setCellHorizontalAlignment(refreshButton, HasHorizontalAlignment.ALIGN_CENTER);
+        header.setCellVerticalAlignment(refreshButton, HasVerticalAlignment.ALIGN_MIDDLE);
+        header.setCellWidth(refreshButton, "40px");
+
         toolsButton = new Image(images.tools());
         toolsButton.addStyleName("pithos-toolsButton");
         toolsButton.addClickHandler(new ClickHandler() {
@@ -566,6 +589,10 @@ public class Pithos implements EntryPoint, ResizeHandler {
                 authenticateUser();
                 return false;
             }
+            if (auth.startsWith("\""))
+               auth = auth.substring(1);
+            if (auth.endsWith("\""))
+               auth = auth.substring(0, auth.length() - 1);
                        String[] authSplit = auth.split("\\" + conf.cookieSeparator(), 2);
                        if (authSplit.length != 2) {
                            authenticateUser();
@@ -983,9 +1010,10 @@ public class Pithos implements EntryPoint, ResizeHandler {
                                }
             };
             copyFile.setHeader("X-Auth-Token", getToken());
-            copyFile.setHeader("X-Copy-From", file.getUri());
+            copyFile.setHeader("X-Copy-From", URL.encodePathSegment(file.getUri()));
             if (!file.getOwner().equals(targetUsername))
-               copyFile.setHeader("X-Source-Account", file.getOwner());
+               copyFile.setHeader("X-Source-Account", URL.encodePathSegment(file.getOwner()));
+            copyFile.setHeader("Content-Type", file.getContentType());
             Scheduler.get().scheduleDeferred(copyFile);
         }
         else  if (callback != null) {
@@ -1174,7 +1202,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
 
        public void logoff() {
         Configuration conf = (Configuration) GWT.create(Configuration.class);
-               Cookies.removeCookie(conf.authCookie());
+               Cookies.removeCookie(conf.authCookie(), "/");
                Cookies.removeCookie(conf.authTokenCookie(), "/");
                for (String s: Cookies.getCookieNames())
                        if (s.startsWith(conf.shibSessionCookiePrefix()))