Merge branch 'master' of https://code.grnet.gr/git/pithos
authorAntony Chazapis <chazapis@gmail.com>
Tue, 19 Jul 2011 20:43:17 +0000 (23:43 +0300)
committerAntony Chazapis <chazapis@gmail.com>
Tue, 19 Jul 2011 20:43:17 +0000 (23:43 +0300)
65 files changed:
web_client/build.xml
web_client/src/gr/grnet/pithos/web/Pithos.gwt.xml [moved from web_client/src/gr/grnet/pithos/web/GSS.gwt.xml with 97% similarity]
web_client/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java
web_client/src/gr/grnet/pithos/web/client/CellTreeView.java
web_client/src/gr/grnet/pithos/web/client/CellTreeViewModel.java
web_client/src/gr/grnet/pithos/web/client/Configuration.java
web_client/src/gr/grnet/pithos/web/client/CredentialsDialog.java
web_client/src/gr/grnet/pithos/web/client/DeleteFileDialog.java
web_client/src/gr/grnet/pithos/web/client/DeleteFolderDialog.java
web_client/src/gr/grnet/pithos/web/client/DnDFolderPopupMenu.java
web_client/src/gr/grnet/pithos/web/client/EditMenu.java
web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java
web_client/src/gr/grnet/pithos/web/client/FileList.java
web_client/src/gr/grnet/pithos/web/client/FileMenu.java
web_client/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java
web_client/src/gr/grnet/pithos/web/client/FileUploadDialog.java
web_client/src/gr/grnet/pithos/web/client/FileUploadGearsDialog.java
web_client/src/gr/grnet/pithos/web/client/FileUploadGearsIEDialog.java
web_client/src/gr/grnet/pithos/web/client/FilesPropertiesDialog.java
web_client/src/gr/grnet/pithos/web/client/FolderContextMenu.java
web_client/src/gr/grnet/pithos/web/client/FolderPropertiesDialog.java
web_client/src/gr/grnet/pithos/web/client/PermissionsAddDialog.java
web_client/src/gr/grnet/pithos/web/client/PermissionsList.java
web_client/src/gr/grnet/pithos/web/client/Pithos.java [moved from web_client/src/gr/grnet/pithos/web/client/GSS.java with 90% similarity]
web_client/src/gr/grnet/pithos/web/client/QuitDialog.java
web_client/src/gr/grnet/pithos/web/client/SessionExpiredDialog.java
web_client/src/gr/grnet/pithos/web/client/StatusPanel.java
web_client/src/gr/grnet/pithos/web/client/TopPanel.java
web_client/src/gr/grnet/pithos/web/client/UserDetailsPanel.java
web_client/src/gr/grnet/pithos/web/client/VersionsList.java
web_client/src/gr/grnet/pithos/web/client/commands/CopyCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/CutCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/DeleteCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/EmptyTrashCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/GetUserCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/NewFolderCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/PasteCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/RefreshCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/ResreshOthersSharesCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/ToTrashCommand.java
web_client/src/gr/grnet/pithos/web/client/commands/UploadFileCommand.java
web_client/src/gr/grnet/pithos/web/client/foldertree/Folder.java
web_client/src/gr/grnet/pithos/web/client/foldertree/FolderTreeView.java
web_client/src/gr/grnet/pithos/web/client/foldertree/FolderTreeViewModel.java
web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTable.css [deleted file]
web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTreeBasic.css [deleted file]
web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeClosedItem.gif [deleted file]
web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeLoadingBasic.gif [deleted file]
web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeOpenItem.gif [deleted file]
web_client/src/gr/grnet/pithos/web/client/rest/DeleteCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/GetCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/HeadCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/MultipleDeleteCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/MultipleGetCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/MultipleHeadCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/MultiplePostCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/PostCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/RestCommand.java
web_client/src/gr/grnet/pithos/web/client/rest/resource/FolderResource.java
web_client/src/gr/grnet/pithos/web/client/tagtree/Tag.java [new file with mode: 0644]
web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeView.java [new file with mode: 0644]
web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java [new file with mode: 0644]
web_client/src/gr/grnet/pithos/web/public/pithos.html [moved from web_client/src/gr/grnet/pithos/web/public/GSS.html with 96% similarity]

index 73234a9..0baf973 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="gss" default="gwt-compile" basedir=".">
-       <description>The GSS project build file</description>
+<project name="pithos" default="gwt-compile" basedir=".">
+       <description>The Pithos web client project build file</description>
 
        <property file="build.properties"/>
     <property name="deps.dir" value="dependencies"/>
@@ -24,8 +24,7 @@
     <property name="gwtquery-droppable-plugin.filename" value="droppable-plugin-1.0.2.jar"/>
     <property name="gwtquery-droppable-plugin.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery-droppable-plugin.filename}?r=c8bca56a1c4ab780ac0d0cc72a2b40b60d7ca4f7"/>
 
-    <property name="root.context" value="gss" />
-    <property name="gwt.module.class" value="GSS" />
+    <property name="gwt.module.class" value="Pithos" />
     <property name="gwt.root.package" value="gr.grnet.pithos.web" />
     <property name="gwt.root.path" value="gr/grnet/pithos/web" />
     <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
             <arg value="${gwt.www.dir}/${gwt.module}"/>
             <arg value="-noserver"/>
             <arg value="-startupUrl"/>
-            <arg value="http://127.0.0.1:8080/client/GSS.html"/>
+            <arg value="http://127.0.0.1:8080/client/pithos.html"/>
             <arg value="${gwt.module}"/>
         </java>
     </target>
@@ -41,7 +41,7 @@
        <inherits name="com.google.gwt.json.JSON"/>
        <inherits name="gwtquery.plugins.droppable.Droppable"/>
 
-    <entry-point class='gr.grnet.pithos.web.client.GSS' />
+    <entry-point class='gr.grnet.pithos.web.client.Pithos' />
        <stylesheet src='gss.css' />
 
        <!-- Rebind the file upload dialog if Gears is installed -->
index e5ab8a4..33671ef 100644 (file)
@@ -83,7 +83,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
        public AbstractPropertiesDialog() {\r
 \r
                // Enable IE selection for the dialog (must disable it upon closing it)\r
-               GSS.enableIESelection();\r
+               Pithos.enableIESelection();\r
 \r
                setAnimationEnabled(true);\r
 \r
@@ -94,7 +94,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
         * @param userId\r
         */\r
        protected void updateTags() {\r
-               GetCommand<TagsResource> tc = new GetCommand<TagsResource>(TagsResource.class, GSS.get().getCurrentUserResource().getTagsPath(),null) {\r
+               GetCommand<TagsResource> tc = new GetCommand<TagsResource>(TagsResource.class, Pithos.get().getCurrentUserResource().getTagsPath(),null) {\r
 \r
                        @Override\r
                        public void onComplete() {\r
@@ -130,7 +130,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
                        @Override\r
                        public void onError(Throwable t) {\r
                                GWT.log("", t);\r
-                               GSS.get().displayError("Unable to fetch user tags");\r
+                               Pithos.get().displayError("Unable to fetch user tags");\r
                        }\r
                };\r
                DeferredCommand.addCommand(tc);\r
@@ -173,7 +173,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
         * (we disable the prevention on creation of the dialog)\r
         */\r
        public void closeDialog() {\r
-               GSS.preventIESelection();\r
+               Pithos.preventIESelection();\r
                hide();\r
        }\r
 }\r
index ea5362f..3cfd28d 100644 (file)
@@ -193,11 +193,11 @@ public class CellTreeView extends Composite{
             public void onSelectionChange(com.google.gwt.view.client.SelectionChangeEvent event) {
                NodeInfo<RestResource> nodeInfo = (NodeInfo<RestResource>) getModel().getNodeInfo(selectionModel.getSelectedObject());
                if(nodeInfo==null || nodeInfo.getValueUpdater()==null){
-                       GSS.get().showFileList(getSelection());
+                       Pithos.get().showFileList(getSelection());
                }
                else
                        nodeInfo.getValueUpdater().update(selectionModel.getSelectedObject());
-               GSS.get().setCurrentSelection(selectionModel.getSelectedObject());
+               Pithos.get().setCurrentSelection(selectionModel.getSelectedObject());
                
                
             }
@@ -341,7 +341,7 @@ public class CellTreeView extends Composite{
        }
        private boolean init=false;
        public boolean fetchRootFolders() {
-               UserResource userResource = GSS.get().getCurrentUserResource();
+               UserResource userResource = Pithos.get().getCurrentUserResource();
                if (userResource == null)
                        return !DONE;
                if(!init){
@@ -359,12 +359,12 @@ public class CellTreeView extends Composite{
                                @Override
                                public void onError(Throwable t) {
                                        GWT.log("Error fetching root folder", t);
-                                       GSS.get().displayError("Unable to fetch root folder");
+                                       Pithos.get().displayError("Unable to fetch root folder");
                                }
        
                        };
                        DeferredCommand.addCommand(gf);
-                       DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath(), null) {
+                       DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, Pithos.get().getCurrentUserResource().getTrashPath(), null) {
                                @Override
                                public void onComplete() {
                                        trash = getResult();
@@ -376,12 +376,12 @@ public class CellTreeView extends Composite{
                                                int statusCode = ((RestException)t).getHttpStatusCode();
                                                // On IE status code 1223 may be returned instead of 204.
                                                if(statusCode == 204 || statusCode == 1223){
-                                                       trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
+                                                       trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
                                        }
                                        else{
                                                GWT.log("", t);
-                                               GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
-                                               trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
+                                               Pithos.get().displayError("Unable to fetch trash folder:"+t.getMessage());
+                                               trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
                                        }
                                }
                        }
@@ -396,7 +396,7 @@ public class CellTreeView extends Composite{
                                @Override
                                public void onError(Throwable t) {
                                        GWT.log("Error fetching Shared Root folder", t);
-                                       GSS.get().displayError("Unable to fetch Shared Root folder");
+                                       Pithos.get().displayError("Unable to fetch Shared Root folder");
                                }
                        };
                        DeferredCommand.addCommand(gs);
@@ -411,7 +411,7 @@ public class CellTreeView extends Composite{
                                @Override
                                public void onError(Throwable t) {
                                        GWT.log("Error fetching Others Root folder", t);
-                                       GSS.get().displayError("Unable to fetch Others Root folder");
+                                       Pithos.get().displayError("Unable to fetch Others Root folder");
                                }
                        };
                        DeferredCommand.addCommand(go);
@@ -430,7 +430,7 @@ public class CellTreeView extends Composite{
        
        
        public void updateTrashNode(){
-               DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath(), null) {
+               DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, Pithos.get().getCurrentUserResource().getTrashPath(), null) {
                        @Override
                        public void onComplete() {
                                trash = getResult();
@@ -446,14 +446,14 @@ public class CellTreeView extends Composite{
                                        int statusCode = ((RestException)t).getHttpStatusCode();
                                        // On IE status code 1223 may be returned instead of 204.
                                        if(statusCode == 204 || statusCode == 1223){
-                                               trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
+                                               trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
                                                model.getRootNodes().getList().set(1, trash);
                                                //model.getRootNodes().refresh();
                                }
                                else{
                                        GWT.log("", t);
-                                       GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
-                                       trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
+                                       Pithos.get().displayError("Unable to fetch trash folder:"+t.getMessage());
+                                       trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
                                        model.getRootNodes().getList().set(1, trash);
                                        //model.getRootNodes().refresh();
                                }
@@ -463,7 +463,7 @@ public class CellTreeView extends Composite{
        }
        
        public void updateRootNode(){
-               final String path = GSS.get().getCurrentUserResource().getFilesPath();
+               final String path = Pithos.get().getCurrentUserResource().getFilesPath();
                GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, path, null) {
 
                        @Override
@@ -478,7 +478,7 @@ public class CellTreeView extends Composite{
                        @Override
                        public void onError(Throwable t) {
                                GWT.log("Error fetching root folder", t);
-                               GSS.get().displayError("Unable to fetch root folder");
+                               Pithos.get().displayError("Unable to fetch root folder");
                        }
 
                };
@@ -486,7 +486,7 @@ public class CellTreeView extends Composite{
        }
        
        public void updateMySharedNode(){
-               GetCommand<SharedResource> gs = new GetCommand<SharedResource>(SharedResource.class, GSS.get().getCurrentUserResource().getSharedPath(), null) {
+               GetCommand<SharedResource> gs = new GetCommand<SharedResource>(SharedResource.class, Pithos.get().getCurrentUserResource().getSharedPath(), null) {
 
                        @Override
                        public void onComplete() {
@@ -497,7 +497,7 @@ public class CellTreeView extends Composite{
                        @Override
                        public void onError(Throwable t) {
                                GWT.log("Error fetching Shared Root folder", t);
-                               GSS.get().displayError("Unable to fetch Shared Root folder");
+                               Pithos.get().displayError("Unable to fetch Shared Root folder");
                        }
                };
                DeferredCommand.addCommand(gs);
@@ -505,7 +505,7 @@ public class CellTreeView extends Composite{
        
        public void updateOtherNode(){
                GetCommand<OthersResource> go = new GetCommand<OthersResource>(OthersResource.class,
-                                       GSS.get().getCurrentUserResource().getOthersPath(), null) {
+                                       Pithos.get().getCurrentUserResource().getOthersPath(), null) {
 
                        @Override
                        public void onComplete() {
@@ -516,7 +516,7 @@ public class CellTreeView extends Composite{
                        @Override
                        public void onError(Throwable t) {
                                GWT.log("Error fetching Others Root folder", t);
-                               GSS.get().displayError("Unable to fetch Others Root folder");
+                               Pithos.get().displayError("Unable to fetch Others Root folder");
                        }
                };
                DeferredCommand.addCommand(go);
@@ -528,8 +528,8 @@ public class CellTreeView extends Composite{
        }
        
        public void clearSelection(){
-               if(GSS.get().getCurrentSelection().equals(getSelection()))
-                       GSS.get().setCurrentSelection(null);
+               if(Pithos.get().getCurrentSelection().equals(getSelection()))
+                       Pithos.get().setCurrentSelection(null);
                selectionModel.setSelected(getSelection(), false);
        }
        
@@ -623,7 +623,7 @@ public class CellTreeView extends Composite{
        public void refreshCurrentNode(boolean clearSelection){
                NodeInfo<RestResource> nodeInfo = (NodeInfo<RestResource>) getModel().getNodeInfo(selectionModel.getSelectedObject());
        if(nodeInfo==null || nodeInfo.getValueUpdater()==null){
-               GSS.get().showFileList(getSelection(),clearSelection);
+               Pithos.get().showFileList(getSelection(),clearSelection);
        }
        else{
                if(!clearSelection)
index 2b1532d..05a33c2 100644 (file)
@@ -65,7 +65,6 @@ import gwtquery.plugins.droppable.client.events.DragAndDropContext;
 import gwtquery.plugins.droppable.client.gwt.DragAndDropNodeInfo;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -218,8 +217,8 @@ public class CellTreeViewModel implements TreeViewModel{
                public void onBrowserEvent(Cell.Context context, com.google.gwt.dom.client.Element parent, RestResource value, com.google.gwt.dom.client.NativeEvent event, com.google.gwt.cell.client.ValueUpdater<RestResource> valueUpdater) {
                        if(event.getType().equals("contextmenu")){
                                selectionModel.setSelected(value, true);
-                               GSS.get().setCurrentSelection(value);
-                               GSS.get().getTreeView().showPopup(event.getClientX(), event.getClientY());
+                               Pithos.get().setCurrentSelection(value);
+                               Pithos.get().getTreeView().showPopup(event.getClientX(), event.getClientY());
                        }
                };
                
@@ -266,7 +265,7 @@ public class CellTreeViewModel implements TreeViewModel{
                // Second level.
                        ListDataProvider<RestResource> trashProvider = new ListDataProvider<RestResource>();
                        List<RestResource> r = new ArrayList<RestResource>();
-                       for(FolderResource f : GSS.get().getTreeView().getTrash().getFolders()){
+                       for(FolderResource f : Pithos.get().getTreeView().getTrash().getFolders()){
                                r.add(new TrashFolderResource(f));
                        }
                        trashProvider.setList(r);
@@ -334,7 +333,7 @@ public class CellTreeViewModel implements TreeViewModel{
                        public void f(final DragAndDropContext context) {
                                if(context.getDroppableData()!=null && context.getDroppableData() instanceof RestResource){
                                        
-                                       GSS.get().getTreeView().getUtils().openNodeContainingResource((RestResource) context.getDroppableData(), new RefreshHandler() {
+                                       Pithos.get().getTreeView().getUtils().openNodeContainingResource((RestResource) context.getDroppableData(), new RefreshHandler() {
                                                
                                                @Override
                                                public void onRefresh() {
@@ -423,23 +422,23 @@ public class CellTreeViewModel implements TreeViewModel{
                                                FolderResource rootResource = getResult();
                                                //((MyFolderResource)value).getResource().setFiles(rootResource.getFiles());
                                                ((MyFolderResource)value).setResource(rootResource);
-                                               if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+                                               if(Pithos.get().getTreeView().getSelection().getUri().equals(value.getUri()))
                                                        selectionModel.setSelected(value, true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                                
                                        }
        
                                        @Override
                                        public void onError(Throwable t) {
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
        
                                };
                                DeferredCommand.addCommand(gf);
                        }
                        else if(value instanceof TrashResource){
-                               DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath(), null) {
+                               DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, Pithos.get().getCurrentUserResource().getTrashPath(), null) {
                                        @Override
                                        public void onComplete() {
                                                //trash = getResult();
@@ -447,11 +446,11 @@ public class CellTreeViewModel implements TreeViewModel{
                                                ((TrashResource)value).setFiles(getResult().getFiles());
                                                for(RestResource r : getRootNodes().getList()){
                                                        if(r instanceof TrashResource)
-                                                               getRootNodes().getList().set(getRootNodes().getList().indexOf(r),GSS.get().getTreeView().getTrash());
+                                                               getRootNodes().getList().set(getRootNodes().getList().indexOf(r), Pithos.get().getTreeView().getTrash());
                                                }
-                                               GSS.get().getTreeView().updateNodeChildren(GSS.get().getTreeView().getTrash());
-                                               //GSS.get().showFileList(true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().getTreeView().updateNodeChildren(Pithos.get().getTreeView().getTrash());
+                                               //Pithos.get().showFileList(true);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                        }
 
                                        @Override
@@ -465,8 +464,8 @@ public class CellTreeViewModel implements TreeViewModel{
                                                }
                                                else{
                                                        GWT.log("", t);
-                                                       GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
-                                                       //GSS.get().getTreeView().getTrash() = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
+                                                       Pithos.get().displayError("Unable to fetch trash folder:"+t.getMessage());
+                                                       //Pithos.get().getTreeView().getTrash() = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
                                                }
                                        }
                                }
@@ -480,16 +479,16 @@ public class CellTreeViewModel implements TreeViewModel{
                                                FolderResource rootResource = getResult();
                                                //((MyFolderResource)value).getResource().setFiles(rootResource.getFiles());
                                                ((OthersFolderResource)value).setResource(rootResource);
-                                               if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+                                               if(Pithos.get().getTreeView().getSelection().getUri().equals(value.getUri()))
                                                        selectionModel.setSelected(value, true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                                
                                        }
        
                                        @Override
                                        public void onError(Throwable t) {
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
        
                                };
@@ -503,16 +502,16 @@ public class CellTreeViewModel implements TreeViewModel{
                                                FolderResource rootResource = getResult();
                                                //((MyFolderResource)value).getResource().setFiles(rootResource.getFiles());
                                                ((SharedFolderResource)value).setResource(rootResource);
-                                               if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+                                               if(Pithos.get().getTreeView().getSelection().getUri().equals(value.getUri()))
                                                        selectionModel.setSelected(value, true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                                
                                        }
        
                                        @Override
                                        public void onError(Throwable t) {
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
        
                                };
@@ -527,16 +526,16 @@ public class CellTreeViewModel implements TreeViewModel{
                                                ((SharedResource)value).setFolders(getResult().getFolders());
                                                ((SharedResource)value).setFiles(getResult().getFiles());
                                                
-                                               if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+                                               if(Pithos.get().getTreeView().getSelection().getUri().equals(value.getUri()))
                                                        selectionModel.setSelected(value, true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                                
                                        }
        
                                        @Override
                                        public void onError(Throwable t) {
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
        
                                };
@@ -551,16 +550,16 @@ public class CellTreeViewModel implements TreeViewModel{
                                                ((OtherUserResource)value).setFolders(getResult().getFolders());
                                                ((OtherUserResource)value).setFiles(getResult().getFiles());
                                                
-                                               if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+                                               if(Pithos.get().getTreeView().getSelection().getUri().equals(value.getUri()))
                                                        selectionModel.setSelected(value, true);
-                                               GSS.get().onResourceUpdate(value,clearSelection);
+                                               Pithos.get().onResourceUpdate(value,clearSelection);
                                                
                                        }
        
                                        @Override
                                        public void onError(Throwable t) {
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
        
                                };
@@ -674,7 +673,7 @@ public class CellTreeViewModel implements TreeViewModel{
 
                                                        @Override
                                                        public void onError(Throwable t) {
-                                                               GSS.get().displayError("Unable to fetch subfolders");
+                                                               Pithos.get().displayError("Unable to fetch subfolders");
                                                                GWT.log("Unable to fetch subfolders", t);
                                                        }
 
@@ -692,7 +691,7 @@ public class CellTreeViewModel implements TreeViewModel{
                                        public void onError(Throwable t) {
                                                
                                                GWT.log("Error fetching root folder", t);
-                                               GSS.get().displayError("Unable to fetch root folder");
+                                               Pithos.get().displayError("Unable to fetch root folder");
                                        }
 
                                };
@@ -761,7 +760,7 @@ public class CellTreeViewModel implements TreeViewModel{
                                   @Override
                                   public void onError(Throwable t) {
                                           GWT.log("Error fetching Others Root folder", t);
-                                          GSS.get().displayError("Unable to fetch Others Root folder");
+                                          Pithos.get().displayError("Unable to fetch Others Root folder");
                                   }
 
                                   @Override
@@ -775,7 +774,7 @@ public class CellTreeViewModel implements TreeViewModel{
                                  @Override
                                  public void onError(Throwable t) {
                                          GWT.log("Error fetching Others Root folder", t);
-                                         GSS.get().displayError("Unable to fetch Others Root folder");
+                                         Pithos.get().displayError("Unable to fetch Others Root folder");
                                  }
                          };
                          DeferredCommand.addCommand(go);
index dab1453..d193e12 100644 (file)
@@ -46,7 +46,7 @@ public interface Configuration extends Constants {
        /**
         * @return the name of the service
         */
-       @DefaultStringValue("GSS")
+       @DefaultStringValue("pithos")
        String serviceName();
 
        /**
index 136fa0e..fa29cb2 100644 (file)
@@ -34,7 +34,6 @@
  */
 package gr.grnet.pithos.web.client;
 
-import com.google.gwt.user.client.Window;
 import gr.grnet.pithos.web.client.rest.PostCommand;
 import gr.grnet.pithos.web.client.rest.RestException;
 
@@ -96,7 +95,7 @@ public class CredentialsDialog extends DialogBox {
                        Button ok = new Button("Yes", new ClickHandler() {
                                @Override
                                public void onClick(ClickEvent event) {
-                                       resetPassword(GSS.get().getCurrentUserResource().getUri());
+                                       resetPassword(Pithos.get().getCurrentUserResource().getUri());
                                        hide();
                                }
                        });
@@ -161,7 +160,7 @@ public class CredentialsDialog extends DialogBox {
                        Button confirm = new Button("Proceed", new ClickHandler() {
                                @Override
                                public void onClick(ClickEvent event) {
-                                       GSS.get().authenticateUser();
+                                       Pithos.get().authenticateUser();
                                        hide();
                                }
                        });
@@ -180,7 +179,7 @@ public class CredentialsDialog extends DialogBox {
                                // either enter or escape is pressed.
                                switch (evt.getKeyCode()) {
                                        case KeyCodes.KEY_ENTER:
-                                               GSS.get().authenticateUser();
+                                               Pithos.get().authenticateUser();
                                                hide();
                                                break;
                                        case KeyCodes.KEY_ESCAPE:
@@ -212,16 +211,16 @@ public class CredentialsDialog extends DialogBox {
                table.setText(0, 0, "Username");
                table.setText(1, 0, "Token");
                TextBox username = new TextBox();
-               final GSS app = GSS.get();
+               final Pithos app = Pithos.get();
                username.setText(app.getCurrentUserResource().getUsername());
                username.setReadOnly(true);
                username.setWidth(WIDTH_FIELD);
                username.addClickHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
-                               GSS.enableIESelection();
+                               Pithos.enableIESelection();
                                ((TextBox) event.getSource()).selectAll();
-                               GSS.preventIESelection();
+                               Pithos.preventIESelection();
                        }
 
                });
@@ -234,9 +233,9 @@ public class CredentialsDialog extends DialogBox {
                tokenBox.addClickHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
-                               GSS.enableIESelection();
+                               Pithos.enableIESelection();
                                ((TextBox) event.getSource()).selectAll();
-                               GSS.preventIESelection();
+                               Pithos.preventIESelection();
                        }
 
                });
@@ -298,7 +297,7 @@ public class CredentialsDialog extends DialogBox {
        private void resetPassword(String userUri) {
 
                if (userUri == null || userUri.length() == 0) {
-                       GSS.get().displayError("Empty user Uri!");
+                       Pithos.get().displayError("Empty user Uri!");
                        return;
                }
                GWT.log("resetPassword(" + userUri + ")", null);
@@ -316,16 +315,16 @@ public class CredentialsDialog extends DialogBox {
                                if(t instanceof RestException){
                                        int statusCode = ((RestException)t).getHttpStatusCode();
                                        if(statusCode == 405)
-                                               GSS.get().displayError("You don't have the necessary" +
+                                               Pithos.get().displayError("You don't have the necessary" +
                                                                " permissions");
                                        else if(statusCode == 404)
-                                               GSS.get().displayError("Resource does not exist");
+                                               Pithos.get().displayError("Resource does not exist");
                                        else
-                                               GSS.get().displayError("Unable to reset password:" +
+                                               Pithos.get().displayError("Unable to reset password:" +
                                                                        ((RestException)t).getHttpStatusText());
                                }
                                else
-                                       GSS.get().displayError("System error resetting password:" +
+                                       Pithos.get().displayError("System error resetting password:" +
                                                                t.getMessage());
                        }
                };
index 48087e3..0a37e8f 100644 (file)
@@ -38,13 +38,9 @@ import com.google.gwt.core.client.Scheduler;
 import gr.grnet.pithos.web.client.MessagePanel.Images;\r
 import gr.grnet.pithos.web.client.foldertree.File;\r
 import gr.grnet.pithos.web.client.foldertree.Resource;\r
-import gr.grnet.pithos.web.client.rest.DeleteCommand;\r
 import gr.grnet.pithos.web.client.rest.DeleteRequest;\r
-import gr.grnet.pithos.web.client.rest.MultipleDeleteCommand;\r
 import gr.grnet.pithos.web.client.rest.RestException;\r
-import gr.grnet.pithos.web.client.rest.resource.FileResource;\r
 \r
-import java.util.ArrayList;\r
 import java.util.Iterator;\r
 import java.util.List;\r
 \r
@@ -53,7 +49,6 @@ import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.event.dom.client.ClickEvent;\r
 import com.google.gwt.event.dom.client.ClickHandler;\r
 import com.google.gwt.event.dom.client.KeyCodes;\r
-import com.google.gwt.user.client.DeferredCommand;\r
 import com.google.gwt.user.client.Event.NativePreviewEvent;\r
 import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
 import com.google.gwt.user.client.ui.Button;\r
@@ -134,7 +129,7 @@ public class DeleteFileDialog extends DialogBox {
     private void deleteFile(final Iterator<File> iter) {\r
         if (iter.hasNext()) {\r
             File f = iter.next();\r
-            String path = GSS.get().getApiPath() + GSS.get().getUsername() + f.getUri();\r
+            String path = Pithos.get().getApiPath() + Pithos.get().getUsername() + f.getUri();\r
             DeleteRequest deleteFile = new DeleteRequest(path) {\r
                 @Override\r
                 public void onSuccess(Resource result) {\r
@@ -145,17 +140,17 @@ public class DeleteFileDialog extends DialogBox {
                 public void onError(Throwable t) {\r
                     GWT.log("", t);\r
                     if (t instanceof RestException) {\r
-                        GSS.get().displayError("Unable to delete file: " + ((RestException) t).getHttpStatusText());\r
+                        Pithos.get().displayError("Unable to delete file: " + ((RestException) t).getHttpStatusText());\r
                     }\r
                     else\r
-                        GSS.get().displayError("System error unable to delete file: "+t.getMessage());\r
+                        Pithos.get().displayError("System error unable to delete file: "+t.getMessage());\r
                 }\r
             };\r
-            deleteFile.setHeader("X-Auth-Token", GSS.get().getToken());\r
+            deleteFile.setHeader("X-Auth-Token", Pithos.get().getToken());\r
             Scheduler.get().scheduleDeferred(deleteFile);\r
         }\r
         else {\r
-            GSS.get().updateFolder(files.get(0).getParent());\r
+            Pithos.get().updateFolder(files.get(0).getParent());\r
         }\r
     }\r
 \r
index 2cdb475..c4a80aa 100644 (file)
  */\r
 package gr.grnet.pithos.web.client;\r
 \r
-import com.google.gwt.core.client.Scheduler;\r
 import com.google.gwt.event.dom.client.KeyDownEvent;\r
-import com.google.gwt.http.client.Request;\r
-import com.google.gwt.http.client.RequestBuilder;\r
-import com.google.gwt.http.client.RequestCallback;\r
-import com.google.gwt.http.client.RequestException;\r
-import com.google.gwt.http.client.Response;\r
-import com.google.gwt.json.client.JSONArray;\r
-import com.google.gwt.json.client.JSONObject;\r
-import com.google.gwt.json.client.JSONParser;\r
-import com.google.gwt.json.client.JSONString;\r
-import com.google.gwt.json.client.JSONValue;\r
-import com.google.gwt.user.client.Event;\r
 import gr.grnet.pithos.web.client.MessagePanel.Images;\r
-import gr.grnet.pithos.web.client.foldertree.File;\r
 import gr.grnet.pithos.web.client.foldertree.Folder;\r
-import gr.grnet.pithos.web.client.foldertree.Resource;\r
-import gr.grnet.pithos.web.client.rest.DeleteCommand;\r
-import gr.grnet.pithos.web.client.rest.DeleteRequest;\r
-import gr.grnet.pithos.web.client.rest.GetRequest;\r
-import gr.grnet.pithos.web.client.rest.RestException;\r
-import gr.grnet.pithos.web.client.rest.RestRequestCallback;\r
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;\r
-import gr.grnet.pithos.web.client.rest.resource.RestResource;\r
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;\r
-import gr.grnet.pithos.web.client.rest.resource.TrashFolderResource;\r
 \r
-import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.dom.client.NativeEvent;\r
 import com.google.gwt.event.dom.client.ClickEvent;\r
 import com.google.gwt.event.dom.client.ClickHandler;\r
 import com.google.gwt.event.dom.client.KeyCodes;\r
-import com.google.gwt.user.client.DeferredCommand;\r
 import com.google.gwt.user.client.Event.NativePreviewEvent;\r
 import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
 import com.google.gwt.user.client.ui.Button;\r
@@ -75,22 +50,20 @@ import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
 import com.google.gwt.user.client.ui.HorizontalPanel;\r
 import com.google.gwt.user.client.ui.VerticalPanel;\r
-import java.util.Iterator;\r
-import java.util.List;\r
 \r
 /**\r
  * The 'delete folder' dialog box.\r
  */\r
 public class DeleteFolderDialog extends DialogBox {\r
 \r
-    private GSS app;\r
+    private Pithos app;\r
     private Folder folder;\r
     \r
        /**\r
         * The widget's constructor.\r
         * @param images the supplied images\r
         */\r
-       public DeleteFolderDialog(GSS _app, Images images, Folder _folder) {\r
+       public DeleteFolderDialog(Pithos _app, Images images, Folder _folder) {\r
         this.app = _app;\r
         this.folder = _folder;\r
                // Set the dialog's caption.\r
index 617283f..055cbcc 100644 (file)
@@ -39,7 +39,6 @@ import gr.grnet.pithos.web.client.foldertree.Folder;
 import gr.grnet.pithos.web.client.rest.MultiplePostCommand;
 import gr.grnet.pithos.web.client.rest.PostCommand;
 import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.FolderResource;
 import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
 
@@ -47,7 +46,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.http.client.URL;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -71,7 +69,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
         };
 
         final MenuBar contextMenu = new MenuBar(true);
-        final CellTreeView folders = GSS.get().getTreeView();
+        final CellTreeView folders = Pithos.get().getTreeView();
 
         contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Move</span>", true, new Command() {
 
@@ -81,7 +79,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
                     moveFolder(target, (Folder) toCopy);
                 }
                 else if (toCopy instanceof List) {
-                    List<File> files = GSS.get().getFileList().getSelectedFiles();
+                    List<File> files = Pithos.get().getFileList().getSelectedFiles();
                     moveFiles(target, files);
                 }
                 hide();
@@ -95,7 +93,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
                 if (toCopy instanceof Folder)
                     copyFolder(target, (Folder) toCopy);
                 else if (toCopy instanceof List) {
-                    List<File> files = GSS.get().getFileList().getSelectedFiles();
+                    List<File> files = Pithos.get().getFileList().getSelectedFiles();
                     copyFiles(target, files);
                 }
                 hide();
@@ -111,7 +109,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
                     trashFolder(((RestResourceWrapper) toCopy).getResource());
                 }
                 else if (toCopy instanceof List) {
-                    List<File> files = GSS.get().getFileList().getSelectedFiles();
+                    List<File> files = Pithos.get().getFileList().getSelectedFiles();
                     trashFiles(files);
                 }
                 hide();
@@ -130,8 +128,8 @@ public class DnDFolderPopupMenu extends PopupPanel {
 //
 //            @Override
 //            public void onComplete() {
-//                GSS.get().getTreeView().updateNodeChildren(new RestResourceWrapper(target));
-//                GSS.get().getStatusPanel().updateStats();
+//                Pithos.get().getTreeView().updateNodeChildren(new RestResourceWrapper(target));
+//                Pithos.get().getStatusPanel().updateStats();
 //            }
 //
 //            @Override
@@ -140,17 +138,17 @@ public class DnDFolderPopupMenu extends PopupPanel {
 //                if (t instanceof RestException) {
 //                    int statusCode = ((RestException) t).getHttpStatusCode();
 //                    if (statusCode == 405)
-//                        GSS.get().displayError("You don't have the necessary permissions");
+//                        Pithos.get().displayError("You don't have the necessary permissions");
 //
 //                    else if (statusCode == 409)
-//                        GSS.get().displayError("A folder with the same name already exists");
+//                        Pithos.get().displayError("A folder with the same name already exists");
 //                    else if (statusCode == 413)
-//                        GSS.get().displayError("Your quota has been exceeded");
+//                        Pithos.get().displayError("Your quota has been exceeded");
 //                    else
-//                        GSS.get().displayError("Unable to copy folder:" + ((RestException) t).getHttpStatusText());
+//                        Pithos.get().displayError("Unable to copy folder:" + ((RestException) t).getHttpStatusText());
 //                }
 //                else
-//                    GSS.get().displayError("System error copying folder:" + t.getMessage());
+//                    Pithos.get().displayError("System error copying folder:" + t.getMessage());
 //            }
 //        };
 //        DeferredCommand.addCommand(cf);
@@ -166,9 +164,9 @@ public class DnDFolderPopupMenu extends PopupPanel {
 //            @Override
 //            public void onComplete() {
 //                GWT.log("[MOVE]" + target.getUri() + "   " + toCopy.getParentURI());
-//                GSS.get().getTreeView().updateNodeChildren(new RestResourceWrapper(target));
-//                GSS.get().getTreeView().updateNodeChildrenForRemove(toCopy.getParentURI());
-//                GSS.get().getStatusPanel().updateStats();
+//                Pithos.get().getTreeView().updateNodeChildren(new RestResourceWrapper(target));
+//                Pithos.get().getTreeView().updateNodeChildrenForRemove(toCopy.getParentURI());
+//                Pithos.get().getStatusPanel().updateStats();
 //            }
 //
 //            @Override
@@ -177,17 +175,17 @@ public class DnDFolderPopupMenu extends PopupPanel {
 //                if (t instanceof RestException) {
 //                    int statusCode = ((RestException) t).getHttpStatusCode();
 //                    if (statusCode == 405)
-//                        GSS.get().displayError("You don't have the necessary permissions");
+//                        Pithos.get().displayError("You don't have the necessary permissions");
 //
 //                    else if (statusCode == 409)
-//                        GSS.get().displayError("A folder with the same name already exists");
+//                        Pithos.get().displayError("A folder with the same name already exists");
 //                    else if (statusCode == 413)
-//                        GSS.get().displayError("Your quota has been exceeded");
+//                        Pithos.get().displayError("Your quota has been exceeded");
 //                    else
-//                        GSS.get().displayError("Unable to copy folder:" + ((RestException) t).getHttpStatusText());
+//                        Pithos.get().displayError("Unable to copy folder:" + ((RestException) t).getHttpStatusText());
 //                }
 //                else
-//                    GSS.get().displayError("System error copying folder:" + t.getMessage());
+//                    Pithos.get().displayError("System error copying folder:" + t.getMessage());
 //            }
 //        };
 //        DeferredCommand.addCommand(cf);
@@ -222,13 +220,13 @@ public class DnDFolderPopupMenu extends PopupPanel {
 
             @Override
             public void onComplete() {
-                GSS.get().getTreeView().updateNodeChildrenForRemove(folder.getParentURI());
-                GSS.get().getTreeView().updateTrashNode();
+                Pithos.get().getTreeView().updateNodeChildrenForRemove(folder.getParentURI());
+                Pithos.get().getTreeView().updateTrashNode();
                 /*for(TreeItem item : items)
-                        GSS.get().getFolders().updateFolder((DnDTreeItem) item);
-                GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+                        Pithos.get().getFolders().updateFolder((DnDTreeItem) item);
+                Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
 
-                GSS.get().showFileList(true);
+                Pithos.get().showFileList(true);
                 */
             }
 
@@ -238,14 +236,14 @@ public class DnDFolderPopupMenu extends PopupPanel {
                 if (t instanceof RestException) {
                     int statusCode = ((RestException) t).getHttpStatusCode();
                     if (statusCode == 405)
-                        GSS.get().displayError("You don't have the necessary permissions");
+                        Pithos.get().displayError("You don't have the necessary permissions");
                     else if (statusCode == 404)
-                        GSS.get().displayError("Folder does not exist");
+                        Pithos.get().displayError("Folder does not exist");
                     else
-                        GSS.get().displayError("Unable to trash folder:" + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to trash folder:" + ((RestException) t).getHttpStatusText());
                 }
                 else
-                    GSS.get().displayError("System error trashing folder:" + t.getMessage());
+                    Pithos.get().displayError("System error trashing folder:" + t.getMessage());
             }
         };
         DeferredCommand.addCommand(tot);
@@ -259,7 +257,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
 
             @Override
             public void onComplete() {
-                GSS.get().showFileList(true);
+                Pithos.get().showFileList(true);
             }
 
             @Override
@@ -268,14 +266,14 @@ public class DnDFolderPopupMenu extends PopupPanel {
                 if (t instanceof RestException) {
                     int statusCode = ((RestException) t).getHttpStatusCode();
                     if (statusCode == 405)
-                        GSS.get().displayError("You don't have the necessary permissions");
+                        Pithos.get().displayError("You don't have the necessary permissions");
                     else if (statusCode == 404)
-                        GSS.get().displayError("File does not exist");
+                        Pithos.get().displayError("File does not exist");
                     else
-                        GSS.get().displayError("Unable to trash file:" + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to trash file:" + ((RestException) t).getHttpStatusText());
                 }
                 else
-                    GSS.get().displayError("System error trashing file:" + t.getMessage());
+                    Pithos.get().displayError("System error trashing file:" + t.getMessage());
             }
         };
         DeferredCommand.addCommand(tot);
@@ -283,8 +281,8 @@ public class DnDFolderPopupMenu extends PopupPanel {
 
     private void executeCopyOrMoveFiles(final int index, final List<String> paths) {
         if (index >= paths.size()) {
-            GSS.get().showFileList(true);
-            GSS.get().getStatusPanel().updateStats();
+            Pithos.get().showFileList(true);
+            Pithos.get().getStatusPanel().updateStats();
             return;
         }
         PostCommand cf = new PostCommand(paths.get(index), "", 200) {
@@ -300,18 +298,18 @@ public class DnDFolderPopupMenu extends PopupPanel {
                 if (t instanceof RestException) {
                     int statusCode = ((RestException) t).getHttpStatusCode();
                     if (statusCode == 405)
-                        GSS.get().displayError("You don't have the necessary permissions");
+                        Pithos.get().displayError("You don't have the necessary permissions");
                     else if (statusCode == 404)
-                        GSS.get().displayError("File not found");
+                        Pithos.get().displayError("File not found");
                     else if (statusCode == 409)
-                        GSS.get().displayError("A file with the same name already exists");
+                        Pithos.get().displayError("A file with the same name already exists");
                     else if (statusCode == 413)
-                        GSS.get().displayError("Your quota has been exceeded");
+                        Pithos.get().displayError("Your quota has been exceeded");
                     else
-                        GSS.get().displayError("Unable to copy file:" + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to copy file:" + ((RestException) t).getHttpStatusText());
                 }
                 else
-                    GSS.get().displayError("System error copying file:" + t.getMessage());
+                    Pithos.get().displayError("System error copying file:" + t.getMessage());
             }
         };
         DeferredCommand.addCommand(cf);
index 3b238d2..751fafe 100644 (file)
@@ -41,22 +41,15 @@ import gr.grnet.pithos.web.client.commands.PasteCommand;
 import gr.grnet.pithos.web.client.commands.ToTrashCommand;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-
-import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
 
 import java.util.List;
 
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.MenuBar;
 import com.google.gwt.user.client.ui.MenuItem;
-import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
  * The 'Edit' menu implementation.
@@ -134,7 +127,7 @@ public class EditMenu extends MenuBar {
         *
         * @param newImages the image bundle passed on by the parent object
         */
-       public EditMenu(final GSS _app, final Images newImages) {
+       public EditMenu(final Pithos _app, final Images newImages) {
                super(true);
                setAnimationEnabled(true);
                images = newImages;
index 84337f9..dfc2060 100644 (file)
@@ -39,27 +39,16 @@ import gr.grnet.pithos.web.client.commands.CutCommand;
 import gr.grnet.pithos.web.client.commands.DeleteCommand;
 import gr.grnet.pithos.web.client.commands.PasteCommand;
 import gr.grnet.pithos.web.client.commands.PropertiesCommand;
-import gr.grnet.pithos.web.client.commands.RefreshCommand;
-import gr.grnet.pithos.web.client.commands.RestoreTrashCommand;
 import gr.grnet.pithos.web.client.commands.ToTrashCommand;
 import gr.grnet.pithos.web.client.commands.UploadFileCommand;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
-import gr.grnet.pithos.web.client.rest.resource.TrashFolderResource;
 
 import java.util.List;
 
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.ContextMenuEvent;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.MenuBar;
 import com.google.gwt.user.client.ui.MenuItem;
@@ -132,13 +121,13 @@ public class FileContextMenu extends PopupPanel {
                // The popup's constructor's argument is a boolean specifying that it
                // auto-close itself when the user clicks outside of it.
                super(true);
-               GSS gss = GSS.get();
+               Pithos gss = Pithos.get();
                setAnimationEnabled(true);
                images = newImages;
         MenuBar contextMenu = new MenuBar(true);
 
-        if (GSS.get().getClipboard().hasFiles()) {
-            pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(GSS.get(), this, selectedFolder));
+        if (Pithos.get().getClipboard().hasFiles()) {
+            pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(Pithos.get(), this, selectedFolder));
             contextMenu.addItem(pasteItem);
         }
 
@@ -155,13 +144,13 @@ public class FileContextMenu extends PopupPanel {
 //                     MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(images.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, null, images));
 //                     contextMenu.addItem(delete);
 //             } else {
-                       cutItem = new MenuItem("<span id='fileContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(GSS.get(), this, selectedFiles));
+                       cutItem = new MenuItem("<span id='fileContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(Pithos.get(), this, selectedFiles));
             contextMenu.addItem(cutItem);
 
-                       copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(GSS.get(), this, selectedFiles));
+                       copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(Pithos.get(), this, selectedFiles));
             contextMenu.addItem(copyItem);
 
-                       trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(GSS.get(), this, selectedFiles));
+                       trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(Pithos.get(), this, selectedFiles));
             contextMenu.addItem(trashItem);
 
                        deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, selectedFiles, images));
@@ -170,15 +159,16 @@ public class FileContextMenu extends PopupPanel {
 //                     sharingItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, images, 1));
 //            contextMenu.addItem(sharingItem);
 
-            contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(GSS.get(), this, selectedFiles, images, 0)));
+            contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(Pithos.get(), this, selectedFiles, images, 0)));
 
-                       contextMenu.addItem(new MenuItem("<span><a class='hidden-link' href='" + GSS.get().getApiPath() + GSS.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + GSS.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, (Command) null));
+            if (!selectedFiles.isEmpty())
+                           contextMenu.addItem(new MenuItem("<span><a class='hidden-link' href='" + Pithos.get().getApiPath() + Pithos.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + Pithos.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, (Command) null));
 
                        MenuItem unSelect = new MenuItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + "&nbsp;Unselect</span>", true, new Command() {
                 @Override
                 public void execute() {
                     hide();
-                    GSS.get().getFileList().clearSelectedRows();
+                    Pithos.get().getFileList().clearSelectedRows();
                 }
             });
                        contextMenu.addItem(unSelect);
index 87e5b0a..fd2f876 100644 (file)
@@ -278,7 +278,7 @@ public class FileList extends Composite {
                        }
                };
 
-               celltable = new DragAndDropCellTable<File>(GSS.VISIBLE_FILE_COUNT, resources, keyProvider);
+               celltable = new DragAndDropCellTable<File>(Pithos.VISIBLE_FILE_COUNT, resources, keyProvider);
         celltable.setWidth("100%");
         celltable.setStyleName("pithos-List");
 
@@ -447,11 +447,14 @@ public class FileList extends Composite {
         vp.addHandler(new ContextMenuHandler() {
             @Override
             public void onContextMenu(ContextMenuEvent event) {
-                FileContextMenu contextMenu = new FileContextMenu(images, treeView.getSelection(), getSelectedFiles(), false);
-                int x = event.getNativeEvent().getClientX();
-                int y = event.getNativeEvent().getClientY();
-                contextMenu.setPopupPosition(x, y);
-                contextMenu.show();
+                Folder selectedFolder = treeView.getSelection();
+                if (!selectedFolder.isTrash()) {
+                    FileContextMenu contextMenu = new FileContextMenu(images, selectedFolder, getSelectedFiles(), false);
+                    int x = event.getNativeEvent().getClientX();
+                    int y = event.getNativeEvent().getClientY();
+                    contextMenu.setPopupPosition(x, y);
+                    contextMenu.show();
+                }
             }
         }, ContextMenuEvent.getType());
                initWidget(vp);
@@ -462,15 +465,15 @@ public class FileList extends Composite {
              @Override 
              public void onSelectionChange(SelectionChangeEvent event) {
                 if(getSelectedFiles().size() == 1)
-                        GSS.get().setCurrentSelection(getSelectedFiles().get(0));
+                        Pithos.get().setCurrentSelection(getSelectedFiles().get(0));
                 else
-                        GSS.get().setCurrentSelection(getSelectedFiles());
+                        Pithos.get().setCurrentSelection(getSelectedFiles());
              }
          };
          selectionModel.addSelectionChangeHandler(selectionHandler);
          
                celltable.setSelectionModel(selectionModel, GSSSelectionEventManager.<File> createDefaultManager());
-               celltable.setPageSize(GSS.VISIBLE_FILE_COUNT);
+               celltable.setPageSize(Pithos.VISIBLE_FILE_COUNT);
                
                sinkEvents(Event.ONCONTEXTMENU);
 //             sinkEvents(Event.ONMOUSEUP);
@@ -478,7 +481,7 @@ public class FileList extends Composite {
 //             sinkEvents(Event.ONCLICK);
 //             sinkEvents(Event.ONKEYDOWN);
 //             sinkEvents(Event.ONDBLCLICK);
-               GSS.preventIESelection();
+               Pithos.preventIESelection();
        }
 
        public List<File> getSelectedFiles() {
@@ -538,7 +541,7 @@ public class FileList extends Composite {
 //                     event.preventDefault();
 //             } else if (DOM.eventGetType(event) == Event.ONDBLCLICK)
 //                     if (getSelectedFiles().size() == 1) {
-//                             GSS app = GSS.get();
+//                             Pithos app = Pithos.get();
 //                             File file = getSelectedFiles().get(0);
 //                             Window.open(file.getUri(), "_blank", "");
 //                             event.preventDefault();
@@ -552,7 +555,7 @@ public class FileList extends Composite {
         */
        void update(boolean sort) {
                int count = folderFileCount;
-               int max = startIndex + GSS.VISIBLE_FILE_COUNT;
+               int max = startIndex + Pithos.VISIBLE_FILE_COUNT;
                if (max > count)
                        max = count;
                folderTotalSize = 0;
@@ -562,7 +565,7 @@ public class FileList extends Composite {
                }
                if (folderFileCount == 0) {
                        showingStats = "no files";
-               } else if (folderFileCount < GSS.VISIBLE_FILE_COUNT) {
+               } else if (folderFileCount < Pithos.VISIBLE_FILE_COUNT) {
                        if (folderFileCount == 1)
                                showingStats = "1 file";
                        else
@@ -619,7 +622,7 @@ public class FileList extends Composite {
         * Update status panel with currently showing file stats.
         */
        public void updateCurrentlyShowingStats() {
-               GSS.get().getStatusPanel().updateCurrentlyShowing(showingStats);
+               Pithos.get().getStatusPanel().updateCurrentlyShowing(showingStats);
        }
        
        /**
@@ -649,7 +652,7 @@ public class FileList extends Composite {
                }
            }
 
-        if(files.size() > GSS.VISIBLE_FILE_COUNT){
+        if(files.size() > Pithos.VISIBLE_FILE_COUNT){
             pagerBottom.setVisible(true);
             pagerTop.setVisible(true);
         }
@@ -778,7 +781,7 @@ public class FileList extends Composite {
         * Shows the files in the cellTable 
      */
        private void showCellTable(){
-               if(files.size()>GSS.VISIBLE_FILE_COUNT){
+               if(files.size()> Pithos.VISIBLE_FILE_COUNT){
                        pagerBottom.setVisible(true);
                        pagerTop.setVisible(true);
                }
@@ -793,4 +796,14 @@ public class FileList extends Composite {
                //celltable.redraw();
                celltable.redrawHeaders();              
        }
+
+    public void showTrash() {
+        uploadButtonBottom.setVisible(false);
+        uploadButtonTop.setVisible(false);
+    }
+
+    public void showFiles() {
+        uploadButtonBottom.setVisible(true);
+        uploadButtonTop.setVisible(true);
+    }
 }
index 4b9c1dd..eefd992 100644 (file)
  */
 package gr.grnet.pithos.web.client;
 
-import gr.grnet.pithos.web.client.commands.EmptyTrashCommand;
 import gr.grnet.pithos.web.client.commands.NewFolderCommand;
 import gr.grnet.pithos.web.client.commands.PropertiesCommand;
-import gr.grnet.pithos.web.client.commands.RefreshCommand;
 import gr.grnet.pithos.web.client.commands.UploadFileCommand;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
 
 import java.util.List;
 
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
@@ -100,7 +95,7 @@ public class FileMenu extends MenuBar {
         *
         * @param _images the image bundle passed on by the parent object
         */
-       public FileMenu(GSS _app, final Images _images) {
+       public FileMenu(Pithos _app, final Images _images) {
         super(true);
                setAnimationEnabled(true);
                images = _images;
@@ -115,7 +110,7 @@ public class FileMenu extends MenuBar {
             addItem(uploadItem);
         }
         if (selectedFiles.size() == 1) {
-            addItem(new MenuItem("<span><a class='hidden-link' href='" + GSS.get().getApiPath() + GSS.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + GSS.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(images.download()).getHTML() + " Download</a></span>", true, (Command) null));
+            addItem(new MenuItem("<span><a class='hidden-link' href='" + Pithos.get().getApiPath() + Pithos.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + Pithos.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(images.download()).getHTML() + " Download</a></span>", true, (Command) null));
         }
 
 //        MenuItem emptyTrashItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Empty Trash</span>", true, new EmptyTrashCommand(this));
@@ -132,7 +127,7 @@ public class FileMenu extends MenuBar {
 //                       .setVisible(propertiesVisible);
 //
         if (selectedFiles.size() > 0 || selectedFolder != null) {
-            MenuItem propertiesItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(GSS.get(), null, selectedFiles.size() > 0 ? selectedFiles : selectedFolder, images, 0));
+            MenuItem propertiesItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(Pithos.get(), null, selectedFiles.size() > 0 ? selectedFiles : selectedFolder, images, 0));
             addItem(propertiesItem);
         }
        }
index 6d63d6e..86e0d26 100644 (file)
@@ -38,32 +38,19 @@ import com.google.gwt.core.client.Scheduler;
 import gr.grnet.pithos.web.client.foldertree.File;\r
 import gr.grnet.pithos.web.client.foldertree.Resource;\r
 import gr.grnet.pithos.web.client.rest.PostCommand;\r
-import gr.grnet.pithos.web.client.rest.PostRequest;\r
 import gr.grnet.pithos.web.client.rest.PutRequest;\r
 import gr.grnet.pithos.web.client.rest.RestException;\r
-import gr.grnet.pithos.web.client.rest.resource.FileResource;\r
-import gr.grnet.pithos.web.client.rest.resource.GroupResource;\r
-import gr.grnet.pithos.web.client.rest.resource.PermissionHolder;\r
-\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Set;\r
 \r
 import com.google.gwt.core.client.GWT;\r
-import com.google.gwt.event.dom.client.ChangeEvent;\r
-import com.google.gwt.event.dom.client.ChangeHandler;\r
 import com.google.gwt.event.dom.client.ClickEvent;\r
 import com.google.gwt.event.dom.client.ClickHandler;\r
 import com.google.gwt.i18n.client.DateTimeFormat;\r
-import com.google.gwt.json.client.JSONArray;\r
 import com.google.gwt.json.client.JSONBoolean;\r
 import com.google.gwt.json.client.JSONObject;\r
-import com.google.gwt.json.client.JSONString;\r
 import com.google.gwt.resources.client.ClientBundle;\r
 import com.google.gwt.resources.client.ImageResource;\r
 import com.google.gwt.user.client.Command;\r
 import com.google.gwt.user.client.DeferredCommand;\r
-import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
 import com.google.gwt.user.client.ui.Button;\r
 import com.google.gwt.user.client.ui.CheckBox;\r
 import com.google.gwt.user.client.ui.DecoratedTabPanel;\r
@@ -71,10 +58,8 @@ import com.google.gwt.user.client.ui.DisclosurePanel;
 import com.google.gwt.user.client.ui.FlexTable;\r
 import com.google.gwt.user.client.ui.FlowPanel;\r
 import com.google.gwt.user.client.ui.FocusPanel;\r
-import com.google.gwt.user.client.ui.HTML;\r
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
 import com.google.gwt.user.client.ui.HorizontalPanel;\r
-import com.google.gwt.user.client.ui.Label;\r
 import com.google.gwt.user.client.ui.TextBox;\r
 import com.google.gwt.user.client.ui.VerticalPanel;\r
 \r
@@ -120,12 +105,12 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
 \r
        private String userFullName;\r
 \r
-    private GSS app;\r
+    private Pithos app;\r
 \r
        /**\r
         * The widget's constructor.\r
         */\r
-       public FilePropertiesDialog(GSS _app, File _file) {\r
+       public FilePropertiesDialog(Pithos _app, File _file) {\r
         app = _app;\r
         file = _file;\r
 \r
@@ -326,9 +311,9 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
 //        path.addClickHandler(new ClickHandler() {\r
 //            @Override\r
 //            public void onClick(ClickEvent event) {\r
-//                GSS.enableIESelection();\r
+//                Pithos.enableIESelection();\r
 //                ((TextBox) event.getSource()).selectAll();\r
-//                GSS.preventIESelection();\r
+//                Pithos.preventIESelection();\r
 //            }\r
 //        });\r
 //        path.setText(file.getUri());\r
@@ -412,7 +397,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
 //                     json.put("versioned", JSONBoolean.getInstance(versioned.getValue()));\r
                //only update the read for all perm if the user is the owner\r
 //             if (readForAll.getValue() != file.isReadForAll())\r
-//                     if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername()))\r
+//                     if (file.getOwner().equals(Pithos.get().getCurrentUserResource().getUsername()))\r
 //                             json.put("readForAll", JSONBoolean.getInstance(readForAll.getValue()));\r
 //             int i = 0;\r
 //             if (permList.hasChanges()) {\r
@@ -489,17 +474,17 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
                                if (t instanceof RestException) {\r
                                        int statusCode = ((RestException) t).getHttpStatusCode();\r
                                        if (statusCode == 405)\r
-                                               GSS.get().displayError("You don't have the necessary permissions");\r
+                                               Pithos.get().displayError("You don't have the necessary permissions");\r
                                        else if (statusCode == 404)\r
-                                               GSS.get().displayError("User in permissions does not exist");\r
+                                               Pithos.get().displayError("User in permissions does not exist");\r
                                        else if (statusCode == 409)\r
-                                               GSS.get().displayError("A folder with the same name already exists");\r
+                                               Pithos.get().displayError("A folder with the same name already exists");\r
                                        else if (statusCode == 413)\r
-                                               GSS.get().displayError("Your quota has been exceeded");\r
+                                               Pithos.get().displayError("Your quota has been exceeded");\r
                                        else\r
-                                               GSS.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
+                                               Pithos.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
                                } else\r
-                                       GSS.get().displayError("System error moifying file:" + t.getMessage());\r
+                                       Pithos.get().displayError("System error moifying file:" + t.getMessage());\r
                        }\r
                };\r
                DeferredCommand.addCommand(cf);\r
@@ -513,7 +498,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
 \r
                        @Override\r
                        public void onComplete() {\r
-                               GSS.get().getTreeView().refreshCurrentNode(false);\r
+                               Pithos.get().getTreeView().refreshCurrentNode(false);\r
                        }\r
 \r
                        @Override\r
@@ -522,17 +507,17 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog {
                                if (t instanceof RestException) {\r
                                        int statusCode = ((RestException) t).getHttpStatusCode();\r
                                        if (statusCode == 405)\r
-                                               GSS.get().displayError("You don't have the necessary permissions");\r
+                                               Pithos.get().displayError("You don't have the necessary permissions");\r
                                        else if (statusCode == 404)\r
-                                               GSS.get().displayError("User in permissions does not exist");\r
+                                               Pithos.get().displayError("User in permissions does not exist");\r
                                        else if (statusCode == 409)\r
-                                               GSS.get().displayError("A folder with the same name already exists");\r
+                                               Pithos.get().displayError("A folder with the same name already exists");\r
                                        else if (statusCode == 413)\r
-                                               GSS.get().displayError("Your quota has been exceeded");\r
+                                               Pithos.get().displayError("Your quota has been exceeded");\r
                                        else\r
-                                               GSS.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
+                                               Pithos.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
                                } else\r
-                                       GSS.get().displayError("System error moifying file:" + t.getMessage());\r
+                                       Pithos.get().displayError("System error moifying file:" + t.getMessage());\r
                        }\r
                };\r
                DeferredCommand.addCommand(cf);\r
index 15e82c4..89b7e02 100644 (file)
  */
 package gr.grnet.pithos.web.client;
 
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.http.client.Response;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.foldertree.Resource;
-import gr.grnet.pithos.web.client.rest.GetCommand;
-import gr.grnet.pithos.web.client.rest.PostCommand;
-import gr.grnet.pithos.web.client.rest.PutRequest;
-import gr.grnet.pithos.web.client.rest.RestCommand;
-import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
-import gr.grnet.pithos.web.client.rest.resource.UploadStatusResource;
-
-import java.util.ArrayList;
-import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.http.client.URL;
-import com.google.gwt.json.client.JSONObject;
-import com.google.gwt.json.client.JSONString;
-import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.DialogBox;
 import com.google.gwt.user.client.ui.FileUpload;
@@ -78,7 +58,6 @@ import com.google.gwt.user.client.ui.Hidden;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.VerticalPanel;
-import javax.xml.transform.Templates;
 
 /**
  * The 'File upload' dialog box implementation.
@@ -102,7 +81,7 @@ public class FileUploadDialog extends DialogBox {
 
        protected Folder folder;
 
-    protected GSS app;
+    protected Pithos app;
 
        /**
         * The widget's constructor.
@@ -293,7 +272,7 @@ public class FileUploadDialog extends DialogBox {
                return null;
        }
 
-    public void setApp(GSS app) {
+    public void setApp(Pithos app) {
         this.app = app;
     }
 
index eab9121..a9804ea 100644 (file)
@@ -38,7 +38,6 @@ import gr.grnet.pithos.web.client.foldertree.Folder;
 import gr.grnet.pithos.web.client.rest.PostCommand;
 import gr.grnet.pithos.web.client.rest.RestCommand;
 import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -109,7 +108,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
        /**
         * The widget's constructor.
         */
-       public FileUploadGearsDialog(GSS _app, Folder _folder) {
+       public FileUploadGearsDialog(Pithos _app, Folder _folder) {
         this.folder = _folder;
         this.app = _app;
                // Set the dialog's caption.
@@ -121,7 +120,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
                info.addStyleName("pithos-uploadNote");
                panel.add(info);
                // Add an informative label with the folder name.
-               Object selection = GSS.get().getTreeView().getSelection();
+               Object selection = Pithos.get().getTreeView().getSelection();
 
                browse = new Button("Browse...");
 
@@ -161,7 +160,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
                        public void onClick(ClickEvent event) {
                                canContinue = false;                            
                                cancelUpload();                         
-                               GSS.get().showFileList(true);
+                               Pithos.get().showFileList(true);
                        }
                });
                buttons.add(cancel);
@@ -212,7 +211,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
 
        @Override
        public void prepareAndSubmit() {
-               GSS app = GSS.get();
+               Pithos app = Pithos.get();
                if (selectedFiles.size() == 0) {
                        app.displayError("You must select a file!");
                        hide();
@@ -310,7 +309,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
 
                                @Override
                                public void onError(Throwable t) {
-                                       GSS app = GSS.get();
+                                       Pithos app = Pithos.get();
                                        GWT.log("", t);
                                        if (t instanceof RestException) {
                                                int statusCode = ((RestException) t).getHttpStatusCode();
@@ -348,7 +347,7 @@ public class FileUploadGearsDialog extends FileUploadDialog {
         * Perform the HTTP request to upload the specified file.
         */
        protected void doSend(final List<File> filesRemaining) {
-               final GSS app = GSS.get();
+               final Pithos app = Pithos.get();
                HttpRequest request = factory.createHttpRequest();
                requests.add(request);
                String method = "PUT";
@@ -365,7 +364,6 @@ public class FileUploadGearsDialog extends FileUploadDialog {
                String date = RestCommand.getDate();
                String sig = RestCommand.calculateSig(method, date, resource, RestCommand.base64decode(token));
                request.open(method, path);
-               request.setRequestHeader("X-GSS-Date", date);
                request.setRequestHeader("Authorization", app.getCurrentUserResource().getUsername() + " " + sig);
                request.setRequestHeader("Accept", "application/json; charset=utf-8");
                request.setCallback(new RequestCallback() {
@@ -422,9 +420,9 @@ public class FileUploadGearsDialog extends FileUploadDialog {
         */
        protected void finish() {
                hide();
-               //GSS.get().showFileList(true);
-               GSS.get().getTreeView().updateNode(GSS.get().getTreeView().getSelection());//showFileList(true);
-               GSS.get().getStatusPanel().updateStats();
+               //Pithos.get().showFileList(true);
+               Pithos.get().getTreeView().updateNode(Pithos.get().getTreeView().getSelection());//showFileList(true);
+               Pithos.get().getStatusPanel().updateStats();
        }
 
        /**
index 222e501..33251bf 100644 (file)
@@ -55,7 +55,7 @@ public class FileUploadGearsIEDialog extends FileUploadGearsDialog {
         */     
        @Override
        protected void doSend(final List<File> filesRemaining) {
-               final GSS app = GSS.get();
+               final Pithos app = Pithos.get();
                HttpRequest request = factory.createHttpRequest();
                requests.add(request);
                String method = "POST";
@@ -72,7 +72,6 @@ public class FileUploadGearsIEDialog extends FileUploadGearsDialog {
                String date = RestCommand.getDate();
                String sig = RestCommand.calculateSig(method, date, resource, RestCommand.base64decode(token));
                request.open(method, path);
-               request.setRequestHeader("X-GSS-Date", date);
                request.setRequestHeader("Authorization", app.getCurrentUserResource().getUsername() + " " + sig);
                request.setRequestHeader("Accept", "application/json; charset=utf-8");
                request.setCallback(new RequestCallback() {
index 80954f6..77dce20 100644 (file)
  */\r
 package gr.grnet.pithos.web.client;\r
 \r
-import gr.grnet.pithos.web.client.components.TristateCheckBox;\r
 import gr.grnet.pithos.web.client.foldertree.File;\r
 import gr.grnet.pithos.web.client.foldertree.Folder;\r
-import gr.grnet.pithos.web.client.rest.MultiplePostCommand;\r
-import gr.grnet.pithos.web.client.rest.RestException;\r
-import gr.grnet.pithos.web.client.rest.resource.FileResource;\r
 \r
-import java.util.ArrayList;\r
-import java.util.Iterator;\r
 import java.util.List;\r
 \r
-import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.event.dom.client.ClickEvent;\r
 import com.google.gwt.event.dom.client.ClickHandler;\r
-import com.google.gwt.event.dom.client.FocusEvent;\r
-import com.google.gwt.event.dom.client.FocusHandler;\r
-import com.google.gwt.json.client.JSONArray;\r
-import com.google.gwt.json.client.JSONBoolean;\r
-import com.google.gwt.json.client.JSONObject;\r
-import com.google.gwt.json.client.JSONString;\r
-import com.google.gwt.user.client.Command;\r
-import com.google.gwt.user.client.DeferredCommand;\r
 import com.google.gwt.user.client.ui.Button;\r
 import com.google.gwt.user.client.ui.DecoratedTabPanel;\r
 import com.google.gwt.user.client.ui.DisclosurePanel;\r
@@ -64,7 +49,6 @@ import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.FocusPanel;\r
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
 import com.google.gwt.user.client.ui.HorizontalPanel;\r
-import com.google.gwt.user.client.ui.Label;\r
 import com.google.gwt.user.client.ui.VerticalPanel;\r
 \r
 /**\r
@@ -85,7 +69,7 @@ public class FilesPropertiesDialog extends AbstractPropertiesDialog {
         *\r
         * @param _files\r
         */\r
-       public FilesPropertiesDialog(GSS _app, final List<File> _files) {\r
+       public FilesPropertiesDialog(Pithos _app, final List<File> _files) {\r
                super();\r
 \r
                files = _files;\r
@@ -270,7 +254,7 @@ public class FilesPropertiesDialog extends AbstractPropertiesDialog {
 //\r
 //                     @Override\r
 //                     public void onComplete() {\r
-//                             GSS.get().getTreeView().refreshCurrentNode(false);\r
+//                             Pithos.get().getTreeView().refreshCurrentNode(false);\r
 //                     }\r
 //\r
 //                     @Override\r
@@ -279,18 +263,18 @@ public class FilesPropertiesDialog extends AbstractPropertiesDialog {
 //                             if(t instanceof RestException){\r
 //                                     int statusCode = ((RestException)t).getHttpStatusCode();\r
 //                                     if(statusCode == 405)\r
-//                                             GSS.get().displayError("You don't have the necessary permissions");\r
+//                                             Pithos.get().displayError("You don't have the necessary permissions");\r
 //                                     else if(statusCode == 404)\r
-//                                             GSS.get().displayError("File does not exist");\r
+//                                             Pithos.get().displayError("File does not exist");\r
 //                                     else if(statusCode == 409)\r
-//                                             GSS.get().displayError("A file with the same name already exists");\r
+//                                             Pithos.get().displayError("A file with the same name already exists");\r
 //                                     else if(statusCode == 413)\r
-//                                             GSS.get().displayError("Your quota has been exceeded");\r
+//                                             Pithos.get().displayError("Your quota has been exceeded");\r
 //                                     else\r
-//                                             GSS.get().displayError("Unable to modify file::"+((RestException)t).getHttpStatusText());\r
+//                                             Pithos.get().displayError("Unable to modify file::"+((RestException)t).getHttpStatusText());\r
 //                             }\r
 //                             else\r
-//                                     GSS.get().displayError("System error modifying file:"+t.getMessage());\r
+//                                     Pithos.get().displayError("System error modifying file:"+t.getMessage());\r
 //                     }\r
 //             };\r
 //             DeferredCommand.addCommand(rt);\r
index 5de0b04..8582519 100644 (file)
@@ -37,25 +37,11 @@ package gr.grnet.pithos.web.client;
 import gr.grnet.pithos.web.client.commands.CopyCommand;
 import gr.grnet.pithos.web.client.commands.CutCommand;
 import gr.grnet.pithos.web.client.commands.DeleteCommand;
-import gr.grnet.pithos.web.client.commands.EmptyTrashCommand;
 import gr.grnet.pithos.web.client.commands.NewFolderCommand;
 import gr.grnet.pithos.web.client.commands.PasteCommand;
 import gr.grnet.pithos.web.client.commands.PropertiesCommand;
-import gr.grnet.pithos.web.client.commands.RefreshCommand;
-import gr.grnet.pithos.web.client.commands.RestoreTrashCommand;
 import gr.grnet.pithos.web.client.commands.ToTrashCommand;
-import gr.grnet.pithos.web.client.commands.UploadFileCommand;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.foldertree.FolderTreeView;
-import gr.grnet.pithos.web.client.rest.resource.MyFolderResource;
-import gr.grnet.pithos.web.client.rest.resource.OtherUserResource;
-import gr.grnet.pithos.web.client.rest.resource.OthersFolderResource;
-import gr.grnet.pithos.web.client.rest.resource.OthersResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResource;
-import gr.grnet.pithos.web.client.rest.resource.SharedFolderResource;
-import gr.grnet.pithos.web.client.rest.resource.SharedResource;
-import gr.grnet.pithos.web.client.rest.resource.TrashFolderResource;
-import gr.grnet.pithos.web.client.rest.resource.TrashResource;
 
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -99,20 +85,20 @@ public class FolderContextMenu extends PopupPanel {
         contextMenu.addItem(newFolder);
 
         if (!folder.isContainer()) {
-            MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(GSS.get(), this, folder));
+            MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(Pithos.get(), this, folder));
             contextMenu.addItem(cut);
         }
 
-        MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(GSS.get(), this, folder));
+        MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(Pithos.get(), this, folder));
         contextMenu.addItem(copy);
 
-        if (!GSS.get().getClipboard().isEmpty()) {
-            pasteItem = new MenuItem("<span id = 'folderContextMenu.paste'>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(GSS.get(), this, folder));
+        if (!Pithos.get().getClipboard().isEmpty()) {
+            pasteItem = new MenuItem("<span id = 'folderContextMenu.paste'>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(Pithos.get(), this, folder));
             contextMenu.addItem(pasteItem);
         }
 
         if (!folder.isContainer()) {
-            MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(GSS.get(), this, folder));
+            MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(Pithos.get(), this, folder));
             contextMenu.addItem(moveToTrash);
 
             MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, folder, newImages));
@@ -125,7 +111,7 @@ public class FolderContextMenu extends PopupPanel {
 //        MenuItem sharing = new MenuItem("<span id = 'folderContextMenu.sharing'>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
 //        contextMenu.addItem(sharing);
 
-        MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(GSS.get(), this, folder, newImages, 0));
+        MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(Pithos.get(), this, folder, newImages, 0));
         contextMenu.addItem(properties);
 
                add(contextMenu);
index 8ca475b..fa3e3b2 100644 (file)
@@ -37,23 +37,18 @@ package gr.grnet.pithos.web.client;
 import com.google.gwt.core.client.Scheduler;\r
 import com.google.gwt.event.dom.client.KeyDownEvent;\r
 import com.google.gwt.user.client.Command;\r
-import com.google.gwt.user.client.Event;\r
 import gr.grnet.pithos.web.client.foldertree.File;\r
 import gr.grnet.pithos.web.client.foldertree.Folder;\r
 import gr.grnet.pithos.web.client.foldertree.Resource;\r
-import gr.grnet.pithos.web.client.rest.PostCommand;\r
 import gr.grnet.pithos.web.client.rest.PutRequest;\r
 import gr.grnet.pithos.web.client.rest.RestException;\r
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;\r
 \r
 import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.dom.client.NativeEvent;\r
 import com.google.gwt.event.dom.client.ClickEvent;\r
 import com.google.gwt.event.dom.client.ClickHandler;\r
 import com.google.gwt.event.dom.client.KeyCodes;\r
-import com.google.gwt.http.client.URL;\r
 import com.google.gwt.i18n.client.DateTimeFormat;\r
-import com.google.gwt.user.client.DeferredCommand;\r
 import com.google.gwt.user.client.Event.NativePreviewEvent;\r
 import com.google.gwt.user.client.ui.Button;\r
 import com.google.gwt.user.client.ui.CheckBox;\r
@@ -62,7 +57,6 @@ import com.google.gwt.user.client.ui.DialogBox;
 import com.google.gwt.user.client.ui.FlexTable;\r
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
 import com.google.gwt.user.client.ui.HorizontalPanel;\r
-import com.google.gwt.user.client.ui.Label;\r
 import com.google.gwt.user.client.ui.TabPanel;\r
 import com.google.gwt.user.client.ui.TextBox;\r
 import com.google.gwt.user.client.ui.VerticalPanel;\r
@@ -73,7 +67,7 @@ import java.util.Iterator;
  */\r
 public class FolderPropertiesDialog extends DialogBox {\r
 \r
-    private GSS app;\r
+    private Pithos app;\r
 \r
        private CheckBox readForAll;\r
 \r
@@ -95,7 +89,7 @@ public class FolderPropertiesDialog extends DialogBox {
        /**\r
         * The widget's constructor.\r
         */\r
-       public FolderPropertiesDialog(GSS app, boolean _create,  Folder selected) {\r
+       public FolderPropertiesDialog(Pithos app, boolean _create,  Folder selected) {\r
         this.app = app;\r
                setAnimationEnabled(true);\r
 \r
index c7d7a4b..83e75ba 100644 (file)
@@ -200,7 +200,7 @@ public class PermissionsAddDialog extends DialogBox {
                        selectedUser = suggestBox.getText();
                        for(PermissionHolder p : permList.permissions)
                                if (selectedUser.equals(p.getUser())){
-                                       GSS.get().displayError("User already has access to the resource");
+                                       Pithos.get().displayError("User already has access to the resource");
                                        return;
                                }
                        perm.setUser(selectedUser);
@@ -214,7 +214,7 @@ public class PermissionsAddDialog extends DialogBox {
                                return;
                        for(PermissionHolder p : permList.permissions)
                                if (selected.getName().equals(p.getGroup())){
-                                       GSS.get().displayError("Group already has access to the resource");
+                                       Pithos.get().displayError("Group already has access to the resource");
                                        return;
                                }
                        perm.setGroup(selected.getName());
@@ -261,7 +261,7 @@ public class PermissionsAddDialog extends DialogBox {
         * Update the list of suggestions.
         */
        protected void updateSuggestions() {
-               final GSS app = GSS.get();
+               final Pithos app = Pithos.get();
                String query = selectedUser.substring(0, selectedUser.length()-1);
                GWT.log("Searching for " + query, null);
 
index 56eca5c..739809f 100644 (file)
@@ -155,7 +155,7 @@ public class PermissionsList extends Composite {
        
        /**
         * Examines whether or not the user's full name exists in the 
-        * userFullNameMap in the GSS.java for every element of the input list.
+        * userFullNameMap in the Pithos.java for every element of the input list.
         * If the user's full name does not exist in the map then a request is being made
         * for the specific username.  
         * 
@@ -173,7 +173,7 @@ public class PermissionsList extends Composite {
                                aPermissions.remove(dto);                               
                                handleFullNames(aPermissions);                          
                        }
-               }else if(GSS.get().findUserFullName(dto.getUser()) != null){
+               }else if(Pithos.get().findUserFullName(dto.getUser()) != null){
                        if(aPermissions.size() >= 1){
                                aPermissions.remove(dto);                               
                                handleFullNames(aPermissions);                          
@@ -209,7 +209,7 @@ public class PermissionsList extends Composite {
                                        permTable.setHTML(i, 0, "<span id=permissionList.Owner>" + AbstractImagePrototype.create(images.permUser()).getHTML() + "&nbsp;Owner</span>");
                                        removeButton.setVisible(false);
                                }else{
-                                       permTable.setHTML(i, 0, "<span id=permissionList."+GSS.get().findUserFullName(dto.getUser())+">"+ AbstractImagePrototype.create(images.permUser()).getHTML() + "&nbsp;"+ GSS.get().findUserFullName(dto.getUser()) + "</span>");
+                                       permTable.setHTML(i, 0, "<span id=permissionList."+ Pithos.get().findUserFullName(dto.getUser())+">"+ AbstractImagePrototype.create(images.permUser()).getHTML() + "&nbsp;"+ Pithos.get().findUserFullName(dto.getUser()) + "</span>");
                                }
                        }else if(dto.getGroup() != null){
                                permTable.setHTML(i, 0, "<span id=permissionList."+dto.getGroup()+">" + AbstractImagePrototype.create(images.permGroup()).getHTML() + "&nbsp;"+ dto.getGroup() + "</span>");
@@ -257,7 +257,7 @@ public class PermissionsList extends Composite {
 
        private void findFullNameAndUpdate(final Set<PermissionHolder> aPermissions){                           
                final PermissionHolder dto = aPermissions.iterator().next();
-               String path = GSS.get().getApiPath() + "users/" + dto.getUser(); 
+               String path = Pithos.get().getApiPath() + "users/" + dto.getUser();
 
                GetCommand<UserSearchResource> gg = new GetCommand<UserSearchResource>(UserSearchResource.class, path, false,null) {
                        @Override
@@ -266,7 +266,7 @@ public class PermissionsList extends Composite {
                                for (UserResource user : result.getUsers()){
                                        String username = user.getUsername();
                                        String userFullName = user.getName();
-                                       GSS.get().putUserToMap(username, userFullName);
+                                       Pithos.get().putUserToMap(username, userFullName);
                                        if(aPermissions.size() >= 1){
                                                aPermissions.remove(dto);                                               
                                                if(aPermissions.isEmpty()){
@@ -279,7 +279,7 @@ public class PermissionsList extends Composite {
                        }
                        @Override
                        public void onError(Throwable t) {                              
-                               GSS.get().displayError("Unable to fetch user's full name from the given username " + dto.getUser());
+                               Pithos.get().displayError("Unable to fetch user's full name from the given username " + dto.getUser());
                                if(aPermissions.size() >= 1){
                                        aPermissions.remove(dto);
                                        if(aPermissions.isEmpty()){
@@ -48,6 +48,7 @@ import com.google.gwt.json.client.JSONString;
 import com.google.gwt.json.client.JSONValue;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.view.client.SelectionChangeEvent;
+import com.google.gwt.view.client.SelectionChangeEvent.Handler;
 import com.google.gwt.view.client.SingleSelectionModel;
 import gr.grnet.pithos.web.client.commands.GetUserCommand;
 import gr.grnet.pithos.web.client.foldertree.AccountResource;
@@ -68,6 +69,9 @@ import gr.grnet.pithos.web.client.rest.resource.SharedResource;
 import gr.grnet.pithos.web.client.rest.resource.TrashResource;
 import gr.grnet.pithos.web.client.rest.resource.UserResource;
 
+import gr.grnet.pithos.web.client.tagtree.Tag;
+import gr.grnet.pithos.web.client.tagtree.TagTreeView;
+import gr.grnet.pithos.web.client.tagtree.TagTreeViewModel;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
@@ -101,7 +105,7 @@ import java.util.Set;
 /**
  * Entry point classes define <code>onModuleLoad()</code>.
  */
-public class GSS implements EntryPoint, ResizeHandler {
+public class Pithos implements EntryPoint, ResizeHandler {
 
        /**
         * A constant that denotes the completion of an IncrementalCommand.
@@ -132,6 +136,14 @@ public class GSS implements EntryPoint, ResizeHandler {
         folderTreeView.updateFolder(f);
     }
 
+    public void updateTag(Tag t) {
+        tagTreeView.updateTag(t);
+    }
+
+    public void updateTags() {
+        tagTreeViewModel.initialize(account);
+    }
+
     /**
         * An aggregate image bundle that pulls together all the images for this
         * application into a single bundle.
@@ -149,19 +161,19 @@ public class GSS implements EntryPoint, ResizeHandler {
        }
 
        /**
-        * The single GSS instance.
+        * The single Pithos instance.
         */
-       private static GSS singleton;
+       private static Pithos singleton;
 
        /**
-        * Gets the singleton GSS instance.
+        * Gets the singleton Pithos instance.
         *
-        * @return the GSS object
+        * @return the Pithos object
         */
-       public static GSS get() {
-               if (GSS.singleton == null)
-                       GSS.singleton = new GSS();
-               return GSS.singleton;
+       public static Pithos get() {
+               if (Pithos.singleton == null)
+                       Pithos.singleton = new Pithos();
+               return Pithos.singleton;
        }
 
        /**
@@ -179,7 +191,7 @@ public class GSS implements EntryPoint, ResizeHandler {
        /**
         * The panel that contains the various system messages.
         */
-       private MessagePanel messagePanel = new MessagePanel(GSS.images);
+       private MessagePanel messagePanel = new MessagePanel(Pithos.images);
 
        /**
         * The bottom panel that contains the status bar.
@@ -246,19 +258,23 @@ public class GSS implements EntryPoint, ResizeHandler {
     private FolderTreeViewModel folderTreeViewModel;
     private FolderTreeView folderTreeView;
 
+    private SingleSelectionModel<Tag> tagTreeSelectionModel;
+    private TagTreeViewModel tagTreeViewModel;
+    private TagTreeView tagTreeView;
+
     private AccountResource account;
 
        @Override
        public void onModuleLoad() {
                // Initialize the singleton before calling the constructors of the
-               // various widgets that might call GSS.get().
+               // various widgets that might call Pithos.get().
                singleton = this;
                if (parseUserCredentials())
             initialize();
        }
 
     private void initialize() {
-        topPanel = new TopPanel(GSS.images);
+        topPanel = new TopPanel(Pithos.images);
         topPanel.setWidth("100%");
 
         messagePanel.setWidth("100%");
@@ -301,8 +317,22 @@ public class GSS implements EntryPoint, ResizeHandler {
         fileList = new FileList(images, folderTreeView);
         inner.add(fileList, createHeaderHTML(AbstractImagePrototype.create(images.folders()), "Files"), true);
 
+        tagTreeSelectionModel = new SingleSelectionModel<Tag>();
+        tagTreeSelectionModel.addSelectionChangeHandler(new Handler() {
+            @Override
+            public void onSelectionChange(SelectionChangeEvent event) {
+                Tag t = tagTreeSelectionModel.getSelectedObject();
+                updateTag(t);
+            }
+        });
+        tagTreeViewModel = new TagTreeViewModel(tagTreeSelectionModel);
+        tagTreeView = new TagTreeView(tagTreeViewModel);
+
+        VerticalPanel trees = new VerticalPanel();
+        trees.add(folderTreeView);
+        trees.add(tagTreeView);
         // Add the left and right panels to the split panel.
-        splitPanel.setLeftWidget(folderTreeView);
+        splitPanel.setLeftWidget(trees);
         splitPanel.setRightWidget(inner);
         splitPanel.setSplitPosition("25%");
         splitPanel.setSize("100%", "100%");
@@ -315,7 +345,7 @@ public class GSS implements EntryPoint, ResizeHandler {
         outer.add(topPanel);
         outer.add(messagePanel);
         outer.add(splitPanel);
-        statusPanel = new StatusPanel(GSS.images);
+        statusPanel = new StatusPanel(Pithos.images);
         outer.add(statusPanel);
         outer.setWidth("100%");
         outer.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER);
@@ -351,6 +381,11 @@ public class GSS implements EntryPoint, ResizeHandler {
 
     public void showFiles(Folder f) {
         inner.selectTab(0);
+        if (f.isTrash()) {
+            fileList.showTrash();
+        }
+        else
+            fileList.showFiles();
         Set<File> files = f.getFiles();
         Iterator<File> iter = files.iterator();
         fetchFile(iter, files);
@@ -370,9 +405,9 @@ public class GSS implements EntryPoint, ResizeHandler {
                 public void onError(Throwable t) {
                     GWT.log("Error getting file", t);
                     if (t instanceof RestException)
-                        GSS.get().displayError("Error getting file: " + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Error getting file: " + ((RestException) t).getHttpStatusText());
                     else
-                        GSS.get().displayError("System error fetching file: " + t.getMessage());
+                        Pithos.get().displayError("System error fetching file: " + t.getMessage());
                 }
             };
             getFile.setHeader("X-Auth-Token", "0000");
@@ -415,7 +450,7 @@ public class GSS implements EntryPoint, ResizeHandler {
 
 //        Window.Location.assign(GWT.getModuleBaseURL() + conf.loginUrl() + "?next=" + Window.Location.getHref());
         Cookies.setCookie(conf.authCookie(), "test" + conf.cookieSeparator() + "0000");
-        Window.Location.assign(GWT.getModuleBaseURL() + "GSS.html");
+        Window.Location.assign(GWT.getModuleBaseURL() + "Pithos.html");
        }
 
     private void fetchAccount() {
@@ -434,9 +469,9 @@ public class GSS implements EntryPoint, ResizeHandler {
             public void onError(Throwable t) {
                 GWT.log("Error getting account", t);
                 if (t instanceof RestException)
-                    GSS.get().displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
+                    Pithos.get().displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
                 else
-                    GSS.get().displayError("System error fetching user data: " + t.getMessage());
+                    Pithos.get().displayError("System error fetching user data: " + t.getMessage());
             }
         };
         getAccount.setHeader("X-Auth-Token", token);
@@ -781,16 +816,16 @@ public class GSS implements EntryPoint, ResizeHandler {
        }
        public String getUserFullName(String _userName) {
                
-        if (GSS.get().findUserFullName(_userName) == null)
+        if (Pithos.get().findUserFullName(_userName) == null)
                 //if there is no userFullName found then the map fills with the given _userName,
                 //so userFullName = _userName
-                GSS.get().putUserToMap(_userName, _userName);
-        else if(GSS.get().findUserFullName(_userName).indexOf('@') != -1){
+                Pithos.get().putUserToMap(_userName, _userName);
+        else if(Pithos.get().findUserFullName(_userName).indexOf('@') != -1){
                 //if the userFullName = _userName the GetUserCommand updates the userFullName in the map
                 GetUserCommand guc = new GetUserCommand(_userName);
                 guc.execute();
         }
-        return GSS.get().findUserFullName(_userName);
+        return Pithos.get().findUserFullName(_userName);
        }
        /**
         * Retrieve the treeView.
@@ -830,7 +865,7 @@ public class GSS implements EntryPoint, ResizeHandler {
 
                 @Override
                 public void onError(Request request, Throwable exception) {
-                    GSS.get().displayError("System error unable to delete folder: " + exception.getMessage());
+                    Pithos.get().displayError("System error unable to delete folder: " + exception.getMessage());
                 }
             });
         }
@@ -853,7 +888,7 @@ public class GSS implements EntryPoint, ResizeHandler {
                     @Override
                     public void onError(Throwable t) {
                         GWT.log("", t);
-                        GSS.get().displayError("System error unable to delete folder: " + t.getMessage());
+                        Pithos.get().displayError("System error unable to delete folder: " + t.getMessage());
                     }
                 };
                 delete.setHeader("X-Auth-Token", getToken());
@@ -885,7 +920,7 @@ public class GSS implements EntryPoint, ResizeHandler {
 
                         @Override
                         public void onError(Request request, Throwable exception) {
-                            GSS.get().displayError("System error unable to delete folder: " + exception.getMessage());
+                            Pithos.get().displayError("System error unable to delete folder: " + exception.getMessage());
                         }
                     });
                 }
@@ -909,7 +944,7 @@ public class GSS implements EntryPoint, ResizeHandler {
                         displayError("Unable to delete folder: "+((RestException) t).getHttpStatusText());
                     }
                     else
-                        GSS.get().displayError("System error unable to delete folder: " + t.getMessage());
+                        Pithos.get().displayError("System error unable to delete folder: " + t.getMessage());
                 }
             };
             deleteFolder.setHeader("X-Auth-Token", getToken());
@@ -935,10 +970,10 @@ public class GSS implements EntryPoint, ResizeHandler {
                 public void onError(Throwable t) {
                     GWT.log("", t);
                     if (t instanceof RestException) {
-                        GSS.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
                     }
                     else
-                        GSS.get().displayError("System error unable to copy file: "+t.getMessage());
+                        Pithos.get().displayError("System error unable to copy file: "+t.getMessage());
                 }
             };
             copyFile.setHeader("X-Auth-Token", getToken());
index ed6ce2f..8f64da2 100644 (file)
@@ -73,7 +73,7 @@ public class QuitDialog extends DialogBox {
                        @Override\r
                        public void onClick(ClickEvent event) {\r
                                hide();\r
-                               GSS.get().logout();\r
+                               Pithos.get().logout();\r
                        }\r
                });\r
                buttons.add(quit);\r
@@ -105,7 +105,7 @@ public class QuitDialog extends DialogBox {
                        switch (evt.getKeyCode()) {\r
                                case KeyCodes.KEY_ENTER:\r
                                        hide();\r
-                                       GSS.get().logout();\r
+                                       Pithos.get().logout();\r
                                        break;\r
                                case KeyCodes.KEY_ESCAPE:\r
                                        hide();\r
index cd038cd..e0b0d1f 100644 (file)
@@ -66,7 +66,7 @@ public class SessionExpiredDialog extends DialogBox {
                Button confirm = new Button("Proceed", new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
-                               GSS.get().authenticateUser();
+                               Pithos.get().authenticateUser();
                                hide();
                        }
                });
@@ -86,7 +86,7 @@ public class SessionExpiredDialog extends DialogBox {
                        // enter or escape is pressed.
                        switch (evt.getKeyCode()) {
                                case KeyCodes.KEY_ENTER:
-                                       GSS.get().authenticateUser();
+                                       Pithos.get().authenticateUser();
                                        hide();
                                        break;
                                case KeyCodes.KEY_ESCAPE:
index 049633f..59cf8e8 100644 (file)
 package gr.grnet.pithos.web.client;
 
 import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import gr.grnet.pithos.web.client.foldertree.AccountResource;
-import gr.grnet.pithos.web.client.rest.GetCommand;
 import gr.grnet.pithos.web.client.rest.GetRequest;
 import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.resource.QuotaHolder;
-import gr.grnet.pithos.web.client.rest.resource.UserResource;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
@@ -170,7 +166,7 @@ public class StatusPanel extends Composite {
         */
     //TODO: This should not be done here
        public void updateStats() {
-               final GSS app = GSS.get();
+               final Pithos app = Pithos.get();
         String path = app.getApiPath() + app.getUsername();
         GetRequest<AccountResource> getAccount = new GetRequest<AccountResource>(AccountResource.class, path) {
             @Override
index 8e9c05a..b27b033 100644 (file)
  */
 package gr.grnet.pithos.web.client;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
@@ -128,7 +126,7 @@ public class TopPanel extends Composite {
                                        AbstractImagePrototype.create(images.folder()).getHTML() + "</td><td>File</td></tr></table>", true, new MenuBar(true)){
                        @Override
                        public MenuBar getSubMenu() {
-                               return new FileMenu(GSS.get(), images);
+                               return new FileMenu(Pithos.get(), images);
                        }
                };
 
@@ -136,7 +134,7 @@ public class TopPanel extends Composite {
                                        AbstractImagePrototype.create(images.edit()).getHTML() + "</td><td>Edit</td></tr></table>", true, new MenuBar(true)){
                        @Override
                        public MenuBar getSubMenu() {
-                               return new EditMenu(GSS.get(), images);
+                               return new EditMenu(Pithos.get(), images);
                        }
                };
 
index d1ae69c..86ed573 100644 (file)
@@ -36,8 +36,6 @@ package gr.grnet.pithos.web.client;
 
 import gr.grnet.pithos.web.client.rest.resource.UserResource;
 
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.IncrementalCommand;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;
@@ -82,11 +80,11 @@ public class UserDetailsPanel extends Composite {
         * @return true if the work has been carried out successfully
         */
        protected boolean displayUserInfo() {
-               UserResource user = GSS.get().getCurrentUserResource();
+               UserResource user = Pithos.get().getCurrentUserResource();
                if (user == null)
                        return !DONE;
                userInfoLabel.setHTML("<b>" + user.getName() + " \u0387 " + user.getUsername() + "</b>");
-               GSS.get().putUserToMap(user.getUsername(), user.getName());
+               Pithos.get().putUserToMap(user.getUsername(), user.getName());
                return DONE;
        }
 
index a124ed8..89bee2d 100644 (file)
@@ -137,14 +137,14 @@ public class VersionsList extends Composite {
                        });
 
                        permTable.setHTML(i, 0, "<span>" + dto.getVersion() + "</span>");
-                       permTable.setHTML(i, 1, "<span>" + formatDate(dto.getCreationDate()) + " by " + GSS.get().findUserFullName(dto.getCreatedBy()) + "</span>");
-                       permTable.setHTML(i, 2, "<span>" + formatDate(dto.getModificationDate()) + " by " + GSS.get().findUserFullName(dto.getModifiedBy()) + "</span>");
+                       permTable.setHTML(i, 1, "<span>" + formatDate(dto.getCreationDate()) + " by " + Pithos.get().findUserFullName(dto.getCreatedBy()) + "</span>");
+                       permTable.setHTML(i, 2, "<span>" + formatDate(dto.getModificationDate()) + " by " + Pithos.get().findUserFullName(dto.getModifiedBy()) + "</span>");
                        permTable.setHTML(i, 3, "<span>" + dto.getFileSizeAsString() + "</span>");
                        HTML downloadHtml = new HTML("<a class='hidden-link info' href='#'><span>"+AbstractImagePrototype.create(images.download()).getHTML()+"</span><div>View this Version</div></a>");
                        downloadHtml.addClickHandler(new ClickHandler() {
                                @Override
                                public void onClick(ClickEvent event) {
-                                       GSS app = GSS.get();
+                                       Pithos app = Pithos.get();
                                        String dateString = RestCommand.getDate();
                                        String resource = dto.getUri().substring(app.getApiPath().length()-1, dto.getUri().length());
                                        String sig = app.getCurrentUserResource().getUsername()+" "+RestCommand.calculateSig("GET", dateString, resource, RestCommand.base64decode(app.getToken()));
@@ -173,7 +173,7 @@ public class VersionsList extends Composite {
                        public void onComplete() {
                                toRemove = version;
                                updateTable();
-                               GSS.get().getTreeView().refreshCurrentNode(false);
+                               Pithos.get().getTreeView().refreshCurrentNode(false);
                        }
 
                        @Override
@@ -182,14 +182,14 @@ public class VersionsList extends Composite {
                                if(t instanceof RestException){
                                        int statusCode = ((RestException)t).getHttpStatusCode();
                                        if(statusCode == 405)
-                                               GSS.get().displayError("You don't have the necessary permissions");
+                                               Pithos.get().displayError("You don't have the necessary permissions");
                                        else if(statusCode == 404)
-                                               GSS.get().displayError("Versions does not exist");
+                                               Pithos.get().displayError("Versions does not exist");
                                        else
-                                               GSS.get().displayError("Unable to remove version:"+((RestException)t).getHttpStatusText());
+                                               Pithos.get().displayError("Unable to remove version:"+((RestException)t).getHttpStatusText());
                                }
                                else
-                                       GSS.get().displayError("System error removing version:"+t.getMessage());
+                                       Pithos.get().displayError("System error removing version:"+t.getMessage());
                        }
                };
                DeferredCommand.addCommand(df);
@@ -197,23 +197,23 @@ public class VersionsList extends Composite {
        }
 
        void restoreVersion(final FileResource version) {
-               FileResource selectedFile = (FileResource) GSS.get().getCurrentSelection();
+               FileResource selectedFile = (FileResource) Pithos.get().getCurrentSelection();
                PostCommand ep = new PostCommand(selectedFile.getUri()+"?restoreVersion="+version.getVersion(),"",200){
 
 
                        @Override
                        public void onComplete() {
                                container.hide();
-                GSS.get().getTreeView().refreshCurrentNode(false);
+                Pithos.get().getTreeView().refreshCurrentNode(false);
                        }
 
                        @Override
                        public void onError(Throwable t) {
                                GWT.log("", t);
                                if(t instanceof RestException)
-                                       GSS.get().displayError("Unable to restore version:"+((RestException)t).getHttpStatusText());
+                                       Pithos.get().displayError("Unable to restore version:"+((RestException)t).getHttpStatusText());
                                else
-                                       GSS.get().displayError("System error restoring version:"+t.getMessage());
+                                       Pithos.get().displayError("System error restoring version:"+t.getMessage());
                        }
 
                };
@@ -239,7 +239,7 @@ public class VersionsList extends Composite {
        
        /**
         * Examines whether or not the user's full name exists in the 
-        * userFullNameMap in the GSS.java for every element of the input list.
+        * userFullNameMap in the Pithos.java for every element of the input list.
         * If the user's full name does not exist in the map then a request is being made
         * for the specific username.  
         * 
@@ -251,7 +251,7 @@ public class VersionsList extends Composite {
                        return;
                }
                
-               if(GSS.get().findUserFullName(input.get(0).getOwner()) == null){
+               if(Pithos.get().findUserFullName(input.get(0).getOwner()) == null){
                        findFullNameAndUpdate(input);           
                        return;
                }
@@ -275,7 +275,7 @@ public class VersionsList extends Composite {
 
        private void findFullNameAndUpdate(final List<FileResource> input){                             
                final String aUserName = input.get(0).getOwner();
-               String path = GSS.get().getApiPath() + "users/" + aUserName; 
+               String path = Pithos.get().getApiPath() + "users/" + aUserName;
 
                GetCommand<UserSearchResource> gg = new GetCommand<UserSearchResource>(UserSearchResource.class, path, false,null) {
                        @Override
@@ -284,7 +284,7 @@ public class VersionsList extends Composite {
                                for (UserResource user : result.getUsers()){
                                        String username = user.getUsername();
                                        String userFullName = user.getName();
-                                       GSS.get().putUserToMap(username, userFullName);
+                                       Pithos.get().putUserToMap(username, userFullName);
                                        if(input.size() >= 1){
                                                input.remove(input.get(0));                                             
                                                if(input.isEmpty()){
@@ -297,7 +297,7 @@ public class VersionsList extends Composite {
                        }
                        @Override
                        public void onError(Throwable t) {                              
-                               GSS.get().displayError("Unable to fetch user's full name from the given username " + aUserName);
+                               Pithos.get().displayError("Unable to fetch user's full name from the given username " + aUserName);
                                if(input.size() >= 1){
                                        input.remove(input.get(0));
                                        handleFullNames(input);                                 
index 0681547..9bc3e37 100644 (file)
@@ -35,7 +35,7 @@
 package gr.grnet.pithos.web.client.commands;
 
 import gr.grnet.pithos.web.client.Clipboard;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
 
@@ -45,15 +45,15 @@ import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
 /**
  *
- * Command for copying a file, folder or user to GSS Clipboard
+ * Command for copying a file, folder or user to Pithos Clipboard
  *
  */
 public class CopyCommand implements Command{
-    private GSS app;
+    private Pithos app;
        private PopupPanel containerPanel;
     private Object resource;
 
-       public CopyCommand(GSS _app, PopupPanel _containerPanel, Object _resource){
+       public CopyCommand(Pithos _app, PopupPanel _containerPanel, Object _resource){
         app = _app;
                containerPanel = _containerPanel;
         resource = _resource;
index 0e71aca..41b85ee 100644 (file)
@@ -35,7 +35,7 @@
 package gr.grnet.pithos.web.client.commands;
 
 import gr.grnet.pithos.web.client.Clipboard;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 
 import gr.grnet.pithos.web.client.foldertree.Folder;
@@ -45,17 +45,17 @@ import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
- * Command for cutting a file, folder or user to GSS Clipboard
+ * Command for cutting a file, folder or user to Pithos Clipboard
  *
  */
 public class CutCommand implements Command {
-    private GSS app;
+    private Pithos app;
 
        private PopupPanel containerPanel;
 
     private Object resource;
 
-       public CutCommand(GSS _app, PopupPanel _containerPanel, Object _resource){
+       public CutCommand(Pithos _app, PopupPanel _containerPanel, Object _resource){
         app = _app;
                containerPanel = _containerPanel;
         resource = _resource;
index c96ec11..22478f5 100644 (file)
@@ -37,17 +37,12 @@ package gr.grnet.pithos.web.client.commands;
 import gr.grnet.pithos.web.client.DeleteFileDialog;
 import gr.grnet.pithos.web.client.DeleteFolderDialog;
 import gr.grnet.pithos.web.client.EditMenu.Images;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.foldertree.Resource;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
 
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
 
@@ -78,7 +73,7 @@ public class DeleteCommand implements Command{
                containerPanel.hide();
 
         if (resource instanceof Folder) {
-            DeleteFolderDialog dlg = new DeleteFolderDialog(GSS.get(), newImages, (Folder) resource);
+            DeleteFolderDialog dlg = new DeleteFolderDialog(Pithos.get(), newImages, (Folder) resource);
             dlg.center();
         } else if (resource instanceof List) {
             DeleteFileDialog dlg = new DeleteFileDialog(newImages, (List<File>) resource);
index 9fa8fca..ed0fed1 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.commands;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.DeleteCommand;
 import gr.grnet.pithos.web.client.rest.RestException;
 
@@ -57,12 +57,12 @@ public class EmptyTrashCommand implements Command{
        @Override
        public void execute() {
                containerPanel.hide();
-               DeleteCommand df = new DeleteCommand(GSS.get().getTreeView().getTrash().getUri()){
+               DeleteCommand df = new DeleteCommand(Pithos.get().getTreeView().getTrash().getUri()){
 
                        @Override
                        public void onComplete() {
-                               GSS.get().getTreeView().updateTrashNode();
-                               GSS.get().showFileList(true);
+                               Pithos.get().getTreeView().updateTrashNode();
+                               Pithos.get().showFileList(true);
                        }
 
                        @Override
@@ -71,14 +71,14 @@ public class EmptyTrashCommand implements Command{
                                if(t instanceof RestException){
                                        int statusCode = ((RestException)t).getHttpStatusCode();
                                        if(statusCode == 405)
-                                               GSS.get().displayError("You don't have the necessary permissions");
+                                               Pithos.get().displayError("You don't have the necessary permissions");
                                        else if(statusCode == 404)
-                                               GSS.get().displayError("Resource does not exist");
+                                               Pithos.get().displayError("Resource does not exist");
                                        else
-                                               GSS.get().displayError("Unable to empty trash:"+((RestException)t).getHttpStatusText());
+                                               Pithos.get().displayError("Unable to empty trash:"+((RestException)t).getHttpStatusText());
                                }
                                else
-                                       GSS.get().displayError("System error emptying trash:"+t.getMessage());
+                                       Pithos.get().displayError("System error emptying trash:"+t.getMessage());
                        }
                };
                DeferredCommand.addCommand(df);
index 50be063..97882c5 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.commands;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.GetCommand;
 import gr.grnet.pithos.web.client.rest.resource.UserResource;
 import gr.grnet.pithos.web.client.rest.resource.UserSearchResource;
@@ -46,7 +46,7 @@ import com.google.gwt.user.client.DeferredCommand;
 
 /**
  * This command manages usernames and the corresponding user's Full Name
- * along with the HashMap collection in the GSS.java class
+ * along with the HashMap collection in the Pithos.java class
  *
  *
  */
@@ -63,7 +63,7 @@ public class GetUserCommand implements Command{
 
        @Override
        public void execute() {
-               String path = GSS.get().getApiPath() + "users/" + userName; 
+               String path = Pithos.get().getApiPath() + "users/" + userName;
                GetCommand<UserSearchResource> gg = new GetCommand<UserSearchResource>(UserSearchResource.class,
                                        path, false ,null) {
                        @Override
@@ -72,13 +72,13 @@ public class GetUserCommand implements Command{
                                for (UserResource user : result.getUsers()){
                                        String username = user.getUsername();
                                        String _userFullName = user.getName();
-                                       GSS.get().putUserToMap(username, _userFullName);
+                                       Pithos.get().putUserToMap(username, _userFullName);
                                }
                        }
                        @Override
                        public void onError(Throwable t) {
                                GWT.log("", t);
-                               GSS.get().displayError("Unable to fetch user's full name from the given username " + userName);
+                               Pithos.get().displayError("Unable to fetch user's full name from the given username " + userName);
                        }
                };
                DeferredCommand.addCommand(gg);
index b5c71cb..3235379 100644 (file)
  */
 package gr.grnet.pithos.web.client.commands;
 
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
 import gr.grnet.pithos.web.client.FileMenu.Images;
 import gr.grnet.pithos.web.client.FolderPropertiesDialog;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.foldertree.FolderTreeView;
-import gr.grnet.pithos.web.client.rest.GetCommand;
-import gr.grnet.pithos.web.client.rest.MultipleGetCommand;
 import gr.grnet.pithos.web.client.rest.resource.GroupResource;
-import gr.grnet.pithos.web.client.rest.resource.GroupsResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResource;
 
-import java.util.ArrayList;
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.IncrementalCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
@@ -87,7 +76,7 @@ public class NewFolderCommand implements Command{
 
        void displayNewFolderDialog() {
         if (folder != null) {
-            FolderPropertiesDialog dlg = new FolderPropertiesDialog(GSS.get(), true, folder);
+            FolderPropertiesDialog dlg = new FolderPropertiesDialog(Pithos.get(), true, folder);
             dlg.center();
         }
        }
index 2c2803c..fc7ee21 100644 (file)
@@ -36,7 +36,7 @@ package gr.grnet.pithos.web.client.commands;
 
 import com.google.gwt.core.client.Scheduler;
 import gr.grnet.pithos.web.client.Clipboard;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
 import gr.grnet.pithos.web.client.foldertree.Resource;
@@ -52,11 +52,11 @@ import com.google.gwt.user.client.ui.PopupPanel;
 
 public class PasteCommand implements Command {
 
-    private GSS app;
+    private Pithos app;
        private PopupPanel containerPanel;
     private Folder folder;
 
-       public PasteCommand(GSS _app, PopupPanel _containerPanel, Folder _folder) {
+       public PasteCommand(Pithos _app, PopupPanel _containerPanel, Folder _folder) {
         app = _app;
                containerPanel = _containerPanel;
         folder = _folder;
@@ -131,10 +131,10 @@ public class PasteCommand implements Command {
                 public void onError(Throwable t) {
                     GWT.log("", t);
                     if (t instanceof RestException) {
-                        GSS.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
                     }
                     else
-                        GSS.get().displayError("System error unable to copy file: "+t.getMessage());
+                        Pithos.get().displayError("System error unable to copy file: "+t.getMessage());
                 }
             };
             copyFile.setHeader("X-Auth-Token", app.getToken());
index 9849f61..f8fcddb 100644 (file)
@@ -38,31 +38,16 @@ import gr.grnet.pithos.web.client.FileMenu;
 import gr.grnet.pithos.web.client.FilePropertiesDialog;
 import gr.grnet.pithos.web.client.FilesPropertiesDialog;
 import gr.grnet.pithos.web.client.FolderPropertiesDialog;
-import gr.grnet.pithos.web.client.GSS;
-import gr.grnet.pithos.web.client.FileMenu.Images;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.rest.GetCommand;
-import gr.grnet.pithos.web.client.rest.HeadCommand;
-import gr.grnet.pithos.web.client.rest.MultipleGetCommand;
-import gr.grnet.pithos.web.client.rest.MultipleHeadCommand;
-import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.MultipleGetCommand.Cached;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;
 import gr.grnet.pithos.web.client.rest.resource.GroupResource;
-import gr.grnet.pithos.web.client.rest.resource.GroupsResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
 
-import java.util.ArrayList;
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.IncrementalCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
-import org.w3c.css.sac.ElementSelector;
 
 /**
  * The command that displays the appropriate Properties dialog, according to the
@@ -85,14 +70,14 @@ public class PropertiesCommand implements Command {
 
     private Object resource;
 
-    private GSS app;
+    private Pithos app;
 
        /**
         * @param _containerPanel
         * @param _newImages the images of all the possible delete dialogs
         * @param _tab the tab to switch to
         */
-       public PropertiesCommand(GSS _app, PopupPanel _containerPanel, Object _resource, final FileMenu.Images _newImages, int _tab) {
+       public PropertiesCommand(Pithos _app, PopupPanel _containerPanel, Object _resource, final FileMenu.Images _newImages, int _tab) {
                containerPanel = _containerPanel;
                newImages = _newImages;
                tabToShow = _tab;
index 5b91cae..1a969fd 100644 (file)
@@ -35,7 +35,7 @@
 package gr.grnet.pithos.web.client.commands;
 
 import gr.grnet.pithos.web.client.FileMenu;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
 
@@ -63,17 +63,17 @@ public class RefreshCommand implements Command {
        @Override
        public void execute() {
                containerPanel.hide();
-               if (GSS.get().getCurrentSelection() instanceof FileResource || GSS.get().getCurrentSelection() instanceof List)
-                       GSS.get().showFileList(true);
-               else if (GSS.get().getCurrentSelection() instanceof GroupUserResource)
+               if (Pithos.get().getCurrentSelection() instanceof FileResource || Pithos.get().getCurrentSelection() instanceof List)
+                       Pithos.get().showFileList(true);
+               else if (Pithos.get().getCurrentSelection() instanceof GroupUserResource)
                        return;
                else{
                        //TODO:CELLTREE
-                       //DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
+                       //DnDTreeItem selectedTreeItem = (DnDTreeItem) Pithos.get().getFolders().getCurrent();
                        //if(selectedTreeItem != null){
-                               //GSS.get().getFolders().updateFolder(selectedTreeItem);
-                       GSS.get().getTreeView().updateNode(GSS.get().getTreeView().getSelection());
-                               GSS.get().showFileList(true);
+                               //Pithos.get().getFolders().updateFolder(selectedTreeItem);
+                       Pithos.get().getTreeView().updateNode(Pithos.get().getTreeView().getSelection());
+                               Pithos.get().showFileList(true);
                        //}
                }
        }
index d1cbe2d..f708bd6 100644 (file)
@@ -49,7 +49,7 @@ public class ResreshOthersSharesCommand implements Command{
        public void execute() {
                containerPanel.hide();
                //TODO:CELLTREE
-               //GSS.get().getFolders().update( GSS.get().getFolders().getCurrent());
+               //Pithos.get().getFolders().update( Pithos.get().getFolders().getCurrent());
        }
 
 }
index d0a7c73..e4a971e 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.commands;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.MultiplePostCommand;
 import gr.grnet.pithos.web.client.rest.PostCommand;
 import gr.grnet.pithos.web.client.rest.RestException;
@@ -67,11 +67,11 @@ public class RestoreTrashCommand implements Command{
        @Override
        public void execute() {
                containerPanel.hide();
-               Object selection = GSS.get().getCurrentSelection();
+               Object selection = Pithos.get().getCurrentSelection();
                if (selection == null){
                        // Check to see if Trash Node is selected.
                        List folderList = new ArrayList();
-                       TrashResource trashItem = GSS.get().getTreeView().getTrash();
+                       TrashResource trashItem = Pithos.get().getTreeView().getTrash();
                        for(int i=0 ; i < trashItem.getFolders().size() ; i++)
                                folderList.add(trashItem.getFolders().get(i));
                        return;
@@ -84,9 +84,9 @@ public class RestoreTrashCommand implements Command{
                                @Override
                                public void onComplete() {
                                        //TODO:CELLTREE
-                                       //GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+                                       //Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
                                        
-                                       GSS.get().showFileList(true);
+                                       Pithos.get().showFileList(true);
                                }
 
                                @Override
@@ -95,18 +95,18 @@ public class RestoreTrashCommand implements Command{
                                        if(t instanceof RestException){
                                                int statusCode = ((RestException)t).getHttpStatusCode();
                                                if(statusCode == 405)
-                                                       GSS.get().displayError("You don't have the necessary permissions");
+                                                       Pithos.get().displayError("You don't have the necessary permissions");
                                                else if(statusCode == 404)
-                                                       GSS.get().displayError("File does not exist");
+                                                       Pithos.get().displayError("File does not exist");
                                                else if(statusCode == 409)
-                                                       GSS.get().displayError("A file with the same name already exists");
+                                                       Pithos.get().displayError("A file with the same name already exists");
                                                else if(statusCode == 413)
-                                                       GSS.get().displayError("Your quota has been exceeded");
+                                                       Pithos.get().displayError("Your quota has been exceeded");
                                                else
-                                                       GSS.get().displayError("Unable to restore file:"+((RestException)t).getHttpStatusText());
+                                                       Pithos.get().displayError("Unable to restore file:"+((RestException)t).getHttpStatusText());
                                        }
                                        else
-                                               GSS.get().displayError("System error restoring file:"+t.getMessage());
+                                               Pithos.get().displayError("System error restoring file:"+t.getMessage());
                                }
                        };
                        DeferredCommand.addCommand(rt);
@@ -121,8 +121,8 @@ public class RestoreTrashCommand implements Command{
                                @Override
                                public void onComplete() {
                                        //TODO:CELLTREE
-                                       //GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
-                                       GSS.get().showFileList(true);
+                                       //Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
+                                       Pithos.get().showFileList(true);
                                }
 
                                @Override
@@ -131,18 +131,18 @@ public class RestoreTrashCommand implements Command{
                                        if(t instanceof RestException){
                                                int statusCode = ((RestException)t).getHttpStatusCode();
                                                if(statusCode == 405)
-                                                       GSS.get().displayError("You don't have the necessary permissions");
+                                                       Pithos.get().displayError("You don't have the necessary permissions");
                                                else if(statusCode == 404)
-                                                       GSS.get().displayError("File does not exist");
+                                                       Pithos.get().displayError("File does not exist");
                                                else if(statusCode == 409)
-                                                       GSS.get().displayError("A file with the same name already exists");
+                                                       Pithos.get().displayError("A file with the same name already exists");
                                                else if(statusCode == 413)
-                                                       GSS.get().displayError("Your quota has been exceeded");
+                                                       Pithos.get().displayError("Your quota has been exceeded");
                                                else
-                                                       GSS.get().displayError("Unable to restore file::"+((RestException)t).getHttpStatusText());
+                                                       Pithos.get().displayError("Unable to restore file::"+((RestException)t).getHttpStatusText());
                                        }
                                        else
-                                               GSS.get().displayError("System error restoring file:"+t.getMessage());
+                                               Pithos.get().displayError("System error restoring file:"+t.getMessage());
                                }
                        };
                        DeferredCommand.addCommand(rt);
@@ -155,13 +155,13 @@ public class RestoreTrashCommand implements Command{
                                public void onComplete() {
                                        //TODO:CELLTREE
                                        /*
-                                       GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getRootItem());
+                                       Pithos.get().getFolders().updateFolder((DnDTreeItem) Pithos.get().getFolders().getRootItem());
 
-                                       GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+                                       Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
                                        */
                                        
-                                       GSS.get().getTreeView().updateTrashNode();
-                                       GSS.get().getTreeView().updateRootNode();
+                                       Pithos.get().getTreeView().updateTrashNode();
+                                       Pithos.get().getTreeView().updateRootNode();
                                }
 
                                @Override
@@ -170,18 +170,18 @@ public class RestoreTrashCommand implements Command{
                                        if(t instanceof RestException){
                                                int statusCode = ((RestException)t).getHttpStatusCode();
                                                if(statusCode == 405)
-                                                       GSS.get().displayError("You don't have the necessary permissions");
+                                                       Pithos.get().displayError("You don't have the necessary permissions");
                                                else if(statusCode == 404)
-                                                       GSS.get().displayError("Folder does not exist");
+                                                       Pithos.get().displayError("Folder does not exist");
                                                else if(statusCode == 409)
-                                                       GSS.get().displayError("A folder with the same name already exists");
+                                                       Pithos.get().displayError("A folder with the same name already exists");
                                                else if(statusCode == 413)
-                                                       GSS.get().displayError("Your quota has been exceeded");
+                                                       Pithos.get().displayError("Your quota has been exceeded");
                                                else
-                                                       GSS.get().displayError("Unable to restore folder::"+((RestException)t).getHttpStatusText());
+                                                       Pithos.get().displayError("Unable to restore folder::"+((RestException)t).getHttpStatusText());
                                        }
                                        else
-                                               GSS.get().displayError("System error restoring folder:"+t.getMessage());
+                                               Pithos.get().displayError("System error restoring folder:"+t.getMessage());
                                }
                        };
                        DeferredCommand.addCommand(rt);
index 32946d9..ded8da7 100644 (file)
 package gr.grnet.pithos.web.client.commands;
 
 import com.google.gwt.core.client.Scheduler;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
 import gr.grnet.pithos.web.client.foldertree.Resource;
-import gr.grnet.pithos.web.client.rest.MultiplePostCommand;
-import gr.grnet.pithos.web.client.rest.PostCommand;
 import gr.grnet.pithos.web.client.rest.PostRequest;
-import gr.grnet.pithos.web.client.rest.PutRequest;
 import gr.grnet.pithos.web.client.rest.RestException;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
@@ -66,10 +58,10 @@ import com.google.gwt.user.client.ui.PopupPanel;
  */
 public class ToTrashCommand implements Command{
        private PopupPanel containerPanel;
-    private GSS app;
+    private Pithos app;
     private Object resource;
 
-       public ToTrashCommand(GSS _app, PopupPanel _containerPanel, Object _resource){
+       public ToTrashCommand(Pithos _app, PopupPanel _containerPanel, Object _resource){
                containerPanel = _containerPanel;
         app = _app;
         resource = _resource;
@@ -149,10 +141,10 @@ public class ToTrashCommand implements Command{
                 public void onError(Throwable t) {
                     GWT.log("", t);
                     if (t instanceof RestException) {
-                        GSS.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
                     }
                     else
-                        GSS.get().displayError("System error unable to copy file: "+t.getMessage());
+                        Pithos.get().displayError("System error unable to copy file: "+t.getMessage());
                 }
             };
             trashFile.setHeader("X-Auth-Token", app.getToken());
index bb17f18..211ad7a 100644 (file)
 package gr.grnet.pithos.web.client.commands;
 
 import gr.grnet.pithos.web.client.FileUploadDialog;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.Folder;
-import gr.grnet.pithos.web.client.rest.GetCommand;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.FolderResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResource;
-import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper;
-
-import java.util.ArrayList;
-import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.IncrementalCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
@@ -82,7 +72,7 @@ public class UploadFileCommand implements Command {
         */
        private void displayNewFile() {
         FileUploadDialog dlg = GWT.create(FileUploadDialog.class);
-        dlg.setApp(GSS.get());
+        dlg.setApp(Pithos.get());
         dlg.setFolder(folder);
                dlg.center();
        }
index 5365f5e..b4afa04 100644 (file)
@@ -78,6 +78,13 @@ public class Folder extends Resource {
 
     private boolean inTrash = false;
 
+    /*
+     * Flag that indicates that this folder is the Trash
+     */
+    private boolean trash = false;
+
+    private Set<String> tags = new LinkedHashSet<String>();
+
     public Folder() {};
 
     public Folder(String name) {
@@ -133,6 +140,12 @@ public class Folder extends Resource {
         if (header != null && header.equals("true"))
             inTrash = true;
 
+        header = response.getHeader("X-Container-Object-Meta");
+        if (header != null) {
+            tags.add("tag1");
+            tags.add("tag2");
+        }
+
         subfolders.clear(); //This is necessary in case we update a pre-existing Folder so that stale subfolders won't show up
         files.clear();
         JSONValue json = JSONParser.parseStrict(response.getText());
@@ -237,4 +250,20 @@ public class Folder extends Resource {
     public boolean isContainer() {
         return parent == null;
     }
+
+    public boolean isTrash() {
+        return trash;
+    }
+
+    public void setTrash(boolean trash) {
+        this.trash = trash;
+    }
+
+    public void setContainer(String container) {
+        this.container = container;
+    }
+
+    public Set<String> getTags() {
+        return tags;
+    }
 }
index 099fa3e..600dfda 100644 (file)
@@ -52,18 +52,18 @@ public class FolderTreeView extends Composite {
     static interface BasicResources extends CellTree.Resources {
 
         @ImageOptions(flipRtl = true)
-        @Source("cellTreeClosedItem.gif")
+        @Source("gr/grnet/pithos/web/client/cellTreeClosedItem.gif")
         ImageResource cellTreeClosedItem();
 
         @ImageOptions(flipRtl = true)
-        @Source("cellTreeLoadingBasic.gif")
+        @Source("gr/grnet/pithos/web/client/cellTreeLoadingBasic.gif")
         ImageResource cellTreeLoading();
 
         @ImageOptions(flipRtl = true)
-        @Source("cellTreeOpenItem.gif")
+        @Source("gr/grnet/pithos/web/client/cellTreeOpenItem.gif")
         ImageResource cellTreeOpenItem();
 
-        @Source({"GssCellTreeBasic.css"})
+        @Source({"gr/grnet/pithos/web/client/GssCellTreeBasic.css"})
         CellTree.Style cellTreeStyle();
     }
 
index 5225cb0..d779151 100644 (file)
@@ -47,7 +47,7 @@ import com.google.gwt.view.client.ListDataProvider;
 import com.google.gwt.view.client.SingleSelectionModel;
 import com.google.gwt.view.client.TreeViewModel;
 import gr.grnet.pithos.web.client.FolderContextMenu;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.FolderTreeView.Templates;
 import gr.grnet.pithos.web.client.rest.GetRequest;
 import gr.grnet.pithos.web.client.rest.RestException;
@@ -62,7 +62,11 @@ public class FolderTreeViewModel implements TreeViewModel {
 
        @Override
         public void render(Context context, Folder folder, SafeHtmlBuilder safeHtmlBuilder) {
-            String html = AbstractImagePrototype.create(FolderTreeView.images.folderYellow()).getHTML();
+            String html;
+            if (folder.isTrash())
+                html = AbstractImagePrototype.create(FolderTreeView.images.emptyTrash()).getHTML();
+            else
+                html = AbstractImagePrototype.create(FolderTreeView.images.folderYellow()).getHTML();
             safeHtmlBuilder.appendHtmlConstant(html);
             safeHtmlBuilder.append(Templates.INSTANCE.nameSpan(folder.getName()));
         }
@@ -71,9 +75,11 @@ public class FolderTreeViewModel implements TreeViewModel {
         public void onBrowserEvent(Cell.Context context, com.google.gwt.dom.client.Element parent, Folder folder, com.google.gwt.dom.client.NativeEvent event, com.google.gwt.cell.client.ValueUpdater<Folder> valueUpdater) {
             if (event.getType().equals(ContextMenuEvent.getType().getName())) {
                 FolderTreeViewModel.this.selectionModel.setSelected(folder, true);
-                FolderContextMenu menu = new FolderContextMenu(FolderTreeView.images, folder);
-                menu.setPopupPosition(event.getClientX(), event.getClientY());
-                menu.show();
+                if (!folder.isTrash()) {
+                    FolderContextMenu menu = new FolderContextMenu(FolderTreeView.images, folder);
+                    menu.setPopupPosition(event.getClientX(), event.getClientY());
+                    menu.show();
+                }
             }
         }
     };
@@ -116,7 +122,7 @@ public class FolderTreeViewModel implements TreeViewModel {
     }
 
     private void fetchFolder(final Iterator<Folder> iter, final ListDataProvider<Folder> dataProvider, final Set<Folder> folders) {
-        final GSS app = GSS.get();
+        final Pithos app = Pithos.get();
         if (iter.hasNext()) {
             final Folder f = iter.next();
 
@@ -131,9 +137,9 @@ public class FolderTreeViewModel implements TreeViewModel {
                 public void onError(Throwable t) {
                     GWT.log("Error getting folder", t);
                     if (t instanceof RestException)
-                        GSS.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
+                        Pithos.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
                     else
-                        GSS.get().displayError("System error fetching folder: " + t.getMessage());
+                        Pithos.get().displayError("System error fetching folder: " + t.getMessage());
                 }
             };
             getFolder.setHeader("X-Auth-Token", app.getToken());
@@ -142,8 +148,14 @@ public class FolderTreeViewModel implements TreeViewModel {
         else {
             dataProvider.getList().clear();
             dataProvider.getList().addAll(folders);
-            if (dataProvider.equals(rootDataProvider))
+            if (dataProvider.equals(rootDataProvider)) {
                 selectionModel.setSelected(dataProvider.getList().get(0), true);
+                Folder f = new Folder("Trash");
+                f.setTrash(true);
+                f.setContainer("trash");
+                dataProvider.getList().add(f);
+                Pithos.get().updateTags();
+            }
         }
     }
 
@@ -161,7 +173,10 @@ public class FolderTreeViewModel implements TreeViewModel {
             dataProviderMap.put(folder, new ListDataProvider<Folder>());
         }
         final ListDataProvider<Folder> dataProvider = dataProviderMap.get(folder);
-        fetchFolder(folder, dataProvider);
+        if (!folder.isTrash())
+            fetchFolder(folder, dataProvider);
+        else
+            Pithos.get().showFiles(folder);
     }
 
     public void fetchFolder(final Folder f, final ListDataProvider<Folder> dataProvider) {
@@ -169,7 +184,7 @@ public class FolderTreeViewModel implements TreeViewModel {
         Scheduler.get().scheduleDeferred(new ScheduledCommand() {
             @Override
             public void execute() {
-                final GSS app = GSS.get();
+                final Pithos app = Pithos.get();
                 String path = app.getApiPath() + app.getUsername() + "/" + f.getContainer() + "?format=json&delimiter=/&prefix=" + f.getPrefix();
                 GetRequest<Folder> getFolder = new GetRequest<Folder>(Folder.class, path, f) {
                     @Override
@@ -183,9 +198,9 @@ public class FolderTreeViewModel implements TreeViewModel {
                     public void onError(Throwable t) {
                         GWT.log("Error getting folder", t);
                         if (t instanceof RestException)
-                            GSS.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
+                            Pithos.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
                         else
-                            GSS.get().displayError("System error fetching folder: " + t.getMessage());
+                            Pithos.get().displayError("System error fetching folder: " + t.getMessage());
                     }
                 };
                 getFolder.setHeader("X-Auth-Token", app.getToken());
diff --git a/web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTable.css b/web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTable.css
deleted file mode 100644 (file)
index 0496d77..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-/* Incremental changes from CellTable.css */ 
-.cellTableFooter {
-  padding: 3px 9px;
-}
-
-.cellTableHeader {
-  /*padding: 3px 9px;*/
-  border:none;
-       background-color: #E0EDFE;
-       font-weight: bold;
-       cursor: pointer;
-}
-
-.cellTableCell {
-  padding: 4px 9px;
-  border-width: 0;
-}
-
-.cellTableFirstColumn {
-  padding: 0px;
-}
-
-.cellTableLastColumn {
-  padding: 0px;
-}
-
-.cellTableFirstColumnFooter {
-  border: 0px;
-  padding: 0px;
-}
-
-.cellTableFirstColumnHeader {
-  border: 0px;
-  padding: 0px;
-}
-
-.cellTableLastColumnFooter {
-  border: 0px;
-  padding: 0px;
-}
-
-.cellTableLastColumnHeader {
-  border: 0px;
-  padding: 0px;
-}
-
-.cellTableEvenRow {
-  cursor: hand;
-  cursor: pointer;
-}
-
-.cellTableOddRow {
-  cursor: hand;
-  cursor: pointer;
-}
-
-.cellTableSelectedRow {
-  background: #628cd5;
-  color: white;
-  height: auto;
-  overflow: auto;
-}
-
- .cellTableHoveredRow {
-  
-  /*background-color: #E0EDFE;
-  color: white;
-  height: auto;
-  overflow: auto;*/
-}
\ No newline at end of file
diff --git a/web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTreeBasic.css b/web_client/src/gr/grnet/pithos/web/client/foldertree/GssCellTreeBasic.css
deleted file mode 100644 (file)
index b37b22e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-.cellTreeWidget {
-  
-}
-
-.cellTreeEmptyMessage {
-  padding-left: 16px;
-  font-style: italic;
-}
-
-.cellTreeItem {
-  padding-top: 4px;
-  padding-bottom: 4px;
-  cursor: hand;
-  cursor: pointer;
-  zoom: 1;
-}
-
-.cellTreeItemImage {
-  
-}
-
-.cellTreeItemImageValue {
-  zoom: 1;
-}
-
-.cellTreeItemValue {
-  padding-left: 3px;
-  padding-right: 3px;
-  outline: none;
-}
-
-.cellTreeOpenItem {
-  
-}
-
-.cellTreeTopItem {
-  
-}
-
-.cellTreeTopItemImage {
-  
-}
-
-.cellTreeTopItemImageValue {
-  
-}
-
-.cellTreeKeyboardSelectedItem {
-  background-color: #ffc;
-  outline: none;
-}
-
-.cellTreeSelectedItem {
-  background-color: #628cd5;
-  color: white;
-  height: auto;
-  overflow: visible;
-}
-
-.cellTreeShowMoreButton {
-  padding-left: 16px;
-  outline: none;
-}
\ No newline at end of file
diff --git a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeClosedItem.gif b/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeClosedItem.gif
deleted file mode 100644 (file)
index 9051e56..0000000
Binary files a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeClosedItem.gif and /dev/null differ
diff --git a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeLoadingBasic.gif b/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeLoadingBasic.gif
deleted file mode 100644 (file)
index c5fedc3..0000000
Binary files a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeLoadingBasic.gif and /dev/null differ
diff --git a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeOpenItem.gif b/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeOpenItem.gif
deleted file mode 100644 (file)
index 3d3691a..0000000
Binary files a/web_client/src/gr/grnet/pithos/web/client/foldertree/cellTreeOpenItem.gif and /dev/null differ
index e068f14..641ba10 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.InsufficientPermissionsException;
 
 import com.google.gwt.http.client.Request;
@@ -54,7 +54,7 @@ public abstract class DeleteCommand extends RestCommand{
        public DeleteCommand(String pathToDelete, boolean showLoading){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Deleting ",pathToDelete);
+                       Pithos.get().showLoadingIndicator("Deleting ",pathToDelete);
                final String path;
                if(pathToDelete.endsWith("/"))
                        path = pathToDelete;
@@ -101,7 +101,7 @@ public abstract class DeleteCommand extends RestCommand{
                boolean com = isComplete();
                if(com){
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        return false;
                }
                return true;
index e13679e..57ab365 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.FolderResource;
 import gr.grnet.pithos.web.client.rest.resource.GroupResource;
@@ -132,7 +132,7 @@ public abstract class GetCommand<T extends RestResource> extends RestCommand{
        public GetCommand(Class<T> theclass, String pathToGet, boolean showLoading, T theCached){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Getting ",pathToGet);
+                       Pithos.get().showLoadingIndicator("Getting ",pathToGet);
                this.aclass = theclass;
                if(pathToGet.indexOf("?") != -1)
                        path = pathToGet;
@@ -148,7 +148,7 @@ public abstract class GetCommand<T extends RestResource> extends RestCommand{
        public GetCommand(Class<T> theclass, String aUsername , String pathToGet, boolean showLoading, T theCached){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Getting ",pathToGet);
+                       Pithos.get().showLoadingIndicator("Getting ",pathToGet);
                this.aclass = theclass;
                path = fixPath(pathToGet);
                this.username = aUsername;
@@ -227,7 +227,7 @@ public abstract class GetCommand<T extends RestResource> extends RestCommand{
                                else {
                                        // Use cache data
                                        if(isShowLoadingIndicator())
-                                               GSS.get().hideLoadingIndicator();
+                                               Pithos.get().hideLoadingIndicator();
                                        if (resp.result instanceof Throwable) {
                                                // Error to be handled
                                                Throwable ex = (Throwable) resp.result;
@@ -251,7 +251,7 @@ public abstract class GetCommand<T extends RestResource> extends RestCommand{
                
                if(com){
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        if(getResult() != null) {
                                // Add to cache
                                cache.put(key, new ResponseData(System.currentTimeMillis(), getResult()));
@@ -274,7 +274,7 @@ public abstract class GetCommand<T extends RestResource> extends RestCommand{
                }
                else if(aclass.equals(FileResource.class)){
                        result1 = new FileResource(aPath);
-                       result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+                       result1.createFromJSON(response.getHeader("X-Pithos-Metadata"));
                }
                else if(aclass.equals(GroupsResource.class)){
                        result1 = new GroupsResource(aPath);
index d160182..6c16e31 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.ObjectNotFoundException;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.FolderResource;
@@ -69,7 +69,7 @@ public  abstract class HeadCommand<T extends RestResource> extends RestCommand{
                setShowLoadingIndicator(showLoading);
                this.aclass = theClass;
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Getting ",pathToGet);
+                       Pithos.get().showLoadingIndicator("Getting ",pathToGet);
 
                if(theClass.equals(FileResource.class))
                        path = pathToGet;
@@ -137,7 +137,7 @@ public  abstract class HeadCommand<T extends RestResource> extends RestCommand{
                boolean com = isComplete();
                if(com){
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        if(getResult() != null)
                                onComplete();
                        else
@@ -156,7 +156,7 @@ public  abstract class HeadCommand<T extends RestResource> extends RestCommand{
                }
                else if(aclass.equals(FileResource.class)){
                        result1 = new FileResource(aPath);
-                       result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+                       result1.createFromJSON(response.getHeader("X-Pithos-Metadata"));
                }
                else if(aclass.equals(GroupsResource.class)){
                        result1 = new GroupsResource(aPath);
index e91c325..50d527d 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.InsufficientPermissionsException;
 
 import java.util.ArrayList;
@@ -64,7 +64,7 @@ public abstract class MultipleDeleteCommand extends RestCommand {
        public MultipleDeleteCommand(String[] pathToDelete, boolean showLoading){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Deleting "+pathToDelete.length+" items",null);
+                       Pithos.get().showLoadingIndicator("Deleting "+pathToDelete.length+" items",null);
                paths = pathToDelete;
                for (final String pathg : pathToDelete) {
                        GWT.log("[DEL]"+pathg, null);
@@ -111,7 +111,7 @@ public abstract class MultipleDeleteCommand extends RestCommand {
                                        onError(p, errors.get(p));
                        onComplete();
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        return false;
                }
                return true;
index b427932..3a58695 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.FolderResource;
 import gr.grnet.pithos.web.client.rest.resource.GroupResource;
@@ -74,7 +74,7 @@ public abstract class MultipleGetCommand<T extends RestResource> extends RestCom
        public MultipleGetCommand(Class<T> aNewClass, String[] pathToGet, boolean showLoading, Cached[] theCached) {
                setShowLoadingIndicator(showLoading);
                if (isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
+                       Pithos.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
                aclass = aNewClass;
                paths = pathToGet;
                this.cached = theCached;
@@ -156,7 +156,7 @@ public abstract class MultipleGetCommand<T extends RestResource> extends RestCom
                boolean com = isComplete();
                if (com) {
                        if (isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        if (hasErrors())
                                for(String p : errors.keySet())
                                        onError(p, errors.get(p));
@@ -180,7 +180,7 @@ public abstract class MultipleGetCommand<T extends RestResource> extends RestCom
                }
                else if (aclass.equals(FileResource.class)){
                        result1 = new FileResource(path);
-                       result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+                       result1.createFromJSON(response.getHeader("X-Pithos-Metadata"));
                }
                else if (aclass.equals(GroupsResource.class)) {
                        result1 = new GroupsResource(path);
index a40b7a9..b065e06 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.MultipleGetCommand.Cached;
 import gr.grnet.pithos.web.client.rest.resource.FileResource;
 import gr.grnet.pithos.web.client.rest.resource.FolderResource;
@@ -71,7 +71,7 @@ public abstract class MultipleHeadCommand <T extends RestResource> extends RestC
        public MultipleHeadCommand(Class<T> theClass, String[] pathToGet, boolean showLoading, Cached[] theCached) {
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
+                       Pithos.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
                paths = pathToGet;
                this.aclass = theClass;
                this.cached = theCached;
@@ -142,7 +142,7 @@ public abstract class MultipleHeadCommand <T extends RestResource> extends RestC
                boolean com = isComplete();
                if (com) {
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        if(hasErrors())
                                for(String p : errors.keySet())
                                        onError(p, errors.get(p));
@@ -165,7 +165,7 @@ public abstract class MultipleHeadCommand <T extends RestResource> extends RestC
                        result1.createFromJSON(response.getText());
                } else if (aclass.equals(FileResource.class)) {
                        result1 = new FileResource(path);
-                       result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+                       result1.createFromJSON(response.getHeader("X-Pithos-Metadata"));
                } else if (aclass.equals(GroupsResource.class)) {
                        result1 = new GroupsResource(path);
                        result1.createFromJSON(response.getText());
index b9e1fb0..37a394c 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.InsufficientPermissionsException;
 
 import java.util.ArrayList;
@@ -73,7 +73,7 @@ public abstract class MultiplePostCommand extends RestCommand {
        public MultiplePostCommand(String[] pathToDelete, String data, final int okStatusCode, boolean showLoading){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Updating "+pathToDelete.length+" items", null);
+                       Pithos.get().showLoadingIndicator("Updating "+pathToDelete.length+" items", null);
                paths = pathToDelete;
                for (final String pathg : pathToDelete) {
                        GWT.log("[DEL]"+pathg, null);
@@ -120,7 +120,7 @@ public abstract class MultiplePostCommand extends RestCommand {
                                        onError(p, errors.get(p));
                        onComplete();
                        if(isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        return false;
                }
                return true;
index 08ff194..a09a841 100644 (file)
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 
 import com.google.gwt.http.client.Request;
 import com.google.gwt.http.client.RequestBuilder;
 import com.google.gwt.http.client.RequestCallback;
 import com.google.gwt.http.client.Response;
 
-
 public abstract class PostCommand extends RestCommand{
        boolean complete = false;
        String postBody=null;
@@ -53,7 +52,7 @@ public abstract class PostCommand extends RestCommand{
        public PostCommand(final String path, String data, final int okStatusCode, boolean showLoading) {
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
-                       GSS.get().showLoadingIndicator("Updating ",path);
+                       Pithos.get().showLoadingIndicator("Updating ",path);
 
                RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, path);
 
@@ -100,7 +99,7 @@ public abstract class PostCommand extends RestCommand{
                boolean com = isComplete();
                if (com) {
                        if (isShowLoadingIndicator())
-                               GSS.get().hideLoadingIndicator();
+                               Pithos.get().hideLoadingIndicator();
                        return false;
                }
                return true;
index 5de0adf..24b5988 100644 (file)
@@ -34,7 +34,7 @@
  */
 package gr.grnet.pithos.web.client.rest;
 
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.SessionExpiredDialog;
 
 import com.google.gwt.http.client.RequestBuilder;
@@ -45,9 +45,9 @@ public abstract class RestCommand implements IncrementalCommand {
 
        protected void handleHeaders(String username, RequestBuilder requestBuilder, String path) {
                String date = getDate();
-               requestBuilder.setHeader("X-GSS-Date", date);
+               requestBuilder.setHeader("X-Pithos-Date", date);
 
-               GSS app = GSS.get();
+               Pithos app = Pithos.get();
                String token = app.getToken();
                if (token == null)
                        token = "aa";
@@ -58,11 +58,11 @@ public abstract class RestCommand implements IncrementalCommand {
        }
 
        protected void handleHeaders(RequestBuilder requestBuilder, String path) {
-               if (GSS.get().getCurrentUserResource() != null) {
-                       String username = GSS.get().getCurrentUserResource().getUsername();
+               if (Pithos.get().getCurrentUserResource() != null) {
+                       String username = Pithos.get().getCurrentUserResource().getUsername();
                        handleHeaders(username, requestBuilder, path);
                } else
-                       GSS.get().displayError("no username");
+                       Pithos.get().displayError("no username");
        }
 
        public static native String getDate()/*-{
index c617966..34e42cb 100644 (file)
@@ -36,7 +36,7 @@
 package gr.grnet.pithos.web.client.rest.resource;
 
 import gr.grnet.pithos.web.client.DisplayHelper;
-import gr.grnet.pithos.web.client.GSS;
+import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.rest.MultipleGetCommand;
 import gr.grnet.pithos.web.client.rest.MultipleGetCommand.Cached;
 
@@ -600,7 +600,7 @@ public class FolderResource extends RestResource {
                else if(treeItem.getParentItem() == null){
                        //this is the case when the user uses the browser's forward arrow to navigate through other's
                        //shared folders and item.getParentItem is null only inside other's shared folder
-                       String apiPath = GSS.get().getApiPath();
+                       String apiPath = Pithos.get().getApiPath();
                        String newPath = getParentURI().substring(apiPath.lastIndexOf("/"));
                        constructedUri = constructedUri + "Files"+ newPath + getName();
                        return constructedUri;
diff --git a/web_client/src/gr/grnet/pithos/web/client/tagtree/Tag.java b/web_client/src/gr/grnet/pithos/web/client/tagtree/Tag.java
new file mode 100644 (file)
index 0000000..e596b51
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2011 GRNET S.A. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer.
+ *
+ *   2. Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and
+ * documentation are those of the authors and should not be
+ * interpreted as representing official policies, either expressed
+ * or implied, of GRNET S.A.
+ */
+
+package gr.grnet.pithos.web.client.tagtree;
+
+import com.google.gwt.http.client.Response;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import gr.grnet.pithos.web.client.foldertree.File;
+import gr.grnet.pithos.web.client.foldertree.Resource;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class Tag extends Resource {
+    /*
+     * The name of the tag.
+     */
+    private String name = null;
+
+    private Set<File> files = new LinkedHashSet<File>();
+
+    public Tag() {};
+
+    public Tag(String name) {
+        this.name = name;
+    }
+    
+    public String getName() {
+        return name;
+    }
+
+//    public void populate(Response response) {
+//        String header = response.getHeader("Last-Modified");
+//        if (header != null)
+//            lastModified = DateTimeFormat.getFormat(PredefinedFormat.RFC_2822).parse(header);
+//
+//        header = response.getHeader("X-Container-Bytes-Used");
+//        if (header != null)
+//            bytesUsed = Long.valueOf(header);
+//
+//        header = response.getHeader("X-Object-Meta-Trash");
+//        if (header != null && header.equals("true"))
+//            inTrash = true;
+//
+//        subfolders.clear(); //This is necessary in case we update a pre-existing Tag so that stale subfolders won't show up
+//        files.clear();
+//        JSONValue json = JSONParser.parseStrict(response.getText());
+//        JSONArray array = json.isArray();
+//        if (array != null) {
+//            for (int i=0; i<array.size(); i++) {
+//                JSONObject o = array.get(i).isObject();
+//                if (o != null) {
+//                    String contentType = unmarshallString(o, "content_type");
+//                    if (o.containsKey("subdir") || (contentType != null && (contentType.startsWith("application/directory") || contentType.startsWith("application/folder")))) {
+//                        Tag f = new Tag();
+//                        f.populate(this, o, container);
+//                        subfolders.add(f);
+//                    }
+//                    else if (!(o.containsKey("x_object_meta_trash") && o.get("x_object_meta_trash").isString().stringValue().equals("true"))) {
+//                        File file = new File();
+//                        file.populate(this, o, container);
+//                        files.add(file);
+//                    }
+//                }
+//            }
+//            //This step is necessary to remove the trashed folders. Trashed folders are added initially because we need to
+//            //avoid having in the list the virtual folders of the form {"subdir":"folder1"} which have no indication of thrash
+//            Iterator<Tag> iter = subfolders.iterator();
+//            while (iter.hasNext()) {
+//                Tag f = iter.next();
+//                if (f.isInTrash())
+//                    iter.remove();
+//            }
+//        }
+//    }
+//
+//    public void populate(Tag parent, JSONObject o, String aContainer) {
+//        this.parent = parent;
+//        String path = null;
+//        if (o.containsKey("subdir")) {
+//            path = unmarshallString(o, "subdir");
+//        }
+//        else {
+//            path = unmarshallString(o, "name");
+//            lastModified = unmarshallDate(o, "last_modified");
+//        }
+//        if (path.endsWith("/"))
+//            path = path.substring(0, path.length() - 1);
+//        if (path.contains("/"))
+//            name = path.substring(path.lastIndexOf("/") + 1, path.length()); //strip the prefix
+//        else
+//            name = path;
+//        if (aContainer != null) {
+//            container = aContainer;
+//            prefix = path;
+//        }
+//        else {
+//            container = name;
+//            prefix = "";
+//        }
+//        if (o.containsKey("x_object_meta_trash") && o.get("x_object_meta_trash").isString().stringValue().equals("true"))
+//            inTrash = true;
+//    }
+//
+//    public static Tag createFromResponse(Response response, Tag result) {
+//        Tag f = null;
+//        if (result == null)
+//            f = new Tag();
+//        else
+//            f = result;
+//
+//        f.populate(response);
+//        return f;
+//    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (other instanceof Tag) {
+            Tag o = (Tag) other;
+            return name.equals(o.getName());
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return name.hashCode();
+    }
+
+    public Set<File> getFiles() {
+        return files;
+    }
+}
diff --git a/web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeView.java b/web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeView.java
new file mode 100644 (file)
index 0000000..9148086
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2011 GRNET S.A. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer.
+ *
+ *   2. Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and
+ * documentation are those of the authors and should not be
+ * interpreted as representing official policies, either expressed
+ * or implied, of GRNET S.A.
+ */
+
+package gr.grnet.pithos.web.client.tagtree;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.ImageResource.ImageOptions;
+import com.google.gwt.safehtml.client.SafeHtmlTemplates;
+import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.user.cellview.client.CellTree;
+import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Tree;
+import gr.grnet.pithos.web.client.FolderContextMenu;
+
+public class TagTreeView extends Composite {
+
+    static interface BasicResources extends CellTree.Resources {
+
+        @ImageOptions(flipRtl = true)
+        @Source("gr/grnet/pithos/web/client/cellTreeClosedItem.gif")
+        ImageResource cellTreeClosedItem();
+
+        @ImageOptions(flipRtl = true)
+        @Source("gr/grnet/pithos/web/client/cellTreeLoadingBasic.gif")
+        ImageResource cellTreeLoading();
+
+        @ImageOptions(flipRtl = true)
+        @Source("gr/grnet/pithos/web/client/cellTreeOpenItem.gif")
+        ImageResource cellTreeOpenItem();
+
+        @Source({"gr/grnet/pithos/web/client/GssCellTreeBasic.css"})
+        CellTree.Style cellTreeStyle();
+    }
+
+    static interface Images extends ClientBundle,Tree.Resources, FolderContextMenu.Images {
+
+        @Source("gr/grnet/pithos/resources/folder_home.png")
+        ImageResource home();
+
+        @Source("gr/grnet/pithos/resources/info.png")
+        public ImageResource tag();
+    }
+
+    static Images images = GWT.create(Images.class);
+
+    static interface Templates extends SafeHtmlTemplates {
+        public Templates INSTANCE = GWT.create(Templates.class);
+
+        @Template("<span>{0}</span>")
+        public SafeHtml nameSpan(String name);
+      }
+
+    private TagTreeViewModel model;
+
+    public TagTreeView(TagTreeViewModel viewModel) {
+        this.model = viewModel;
+        /*
+         * Create the tree using the model. We use <code>null</code> as the default
+         * value of the root node. The default value will be passed to
+         * CustomTreeModel#getNodeInfo();
+         */
+        CellTree.Resources res = GWT.create(BasicResources.class);
+        CellTree tree = new CellTree(model, null, res);
+
+        tree.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
+
+        initWidget(tree);
+    }
+
+
+    public Tag getSelection() {
+       return model.getSelection();
+    }
+
+    public void updateTag(Tag tag) {
+        model.updateTag(tag);
+    }
+}
diff --git a/web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java b/web_client/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java
new file mode 100644 (file)
index 0000000..fddf6b3
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2011 GRNET S.A. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer.
+ *
+ *   2. Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and
+ * documentation are those of the authors and should not be
+ * interpreted as representing official policies, either expressed
+ * or implied, of GRNET S.A.
+ */
+
+package gr.grnet.pithos.web.client.tagtree;
+
+import com.google.gwt.cell.client.AbstractCell;
+import com.google.gwt.cell.client.Cell;
+import com.google.gwt.cell.client.TextCell;
+import com.google.gwt.event.dom.client.ContextMenuEvent;
+import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+import com.google.gwt.text.shared.SafeHtmlRenderer;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.view.client.ListDataProvider;
+import com.google.gwt.view.client.SingleSelectionModel;
+import com.google.gwt.view.client.TreeViewModel;
+import gr.grnet.pithos.web.client.Pithos;
+import gr.grnet.pithos.web.client.foldertree.AccountResource;
+import gr.grnet.pithos.web.client.foldertree.Folder;
+import gr.grnet.pithos.web.client.tagtree.TagTreeView.Templates;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+public class TagTreeViewModel implements TreeViewModel {
+
+    private Cell<Tag> tagCell = new AbstractCell<Tag>(ContextMenuEvent.getType().getName()) {
+
+       @Override
+        public void render(Context context, Tag tag, SafeHtmlBuilder safeHtmlBuilder) {
+            String html = AbstractImagePrototype.create(TagTreeView.images.tag()).getHTML();
+            safeHtmlBuilder.appendHtmlConstant(html);
+            safeHtmlBuilder.append(Templates.INSTANCE.nameSpan(tag.getName()));
+        }
+
+        @Override
+        public void onBrowserEvent(Context context, com.google.gwt.dom.client.Element parent, Tag tag, com.google.gwt.dom.client.NativeEvent event, com.google.gwt.cell.client.ValueUpdater<Tag> valueUpdater) {
+            if (event.getType().equals(com.google.gwt.event.dom.client.ContextMenuEvent.getType().getName())) {
+                TagTreeViewModel.this.selectionModel.setSelected(tag, true);
+            }
+        }
+    };
+
+    private ListDataProvider<String> rootDataProvider = new ListDataProvider<String>();
+    private ListDataProvider<Tag> tagDataProvider = new ListDataProvider<Tag>();
+
+    private SingleSelectionModel<Tag> selectionModel;
+
+    public TagTreeViewModel(SingleSelectionModel<Tag> selectionModel) {
+        this.selectionModel = selectionModel;
+    }
+
+    @Override
+    public <T> NodeInfo<?> getNodeInfo(T value) {
+        if (value == null) {
+//            rootDataProvider.getList().add("Tags");
+            return new DefaultNodeInfo<String>(rootDataProvider, new TextCell(new SafeHtmlRenderer<String>() {
+                @Override
+                public SafeHtml render(String object) {
+                    SafeHtmlBuilder builder = new SafeHtmlBuilder();
+                    render(object, builder);
+                    return builder.toSafeHtml();
+                }
+
+                @Override
+                public void render(String object, SafeHtmlBuilder builder) {
+                    String html = AbstractImagePrototype.create(TagTreeView.images.tag()).getHTML();
+                    builder.appendHtmlConstant(html);
+                    builder.append(Templates.INSTANCE.nameSpan(object));
+                }
+            }), new SingleSelectionModel<String>(), null);
+        }
+        else if (value instanceof String) {
+            //fetchAllTags();
+            return new DefaultNodeInfo<Tag>(tagDataProvider, tagCell, selectionModel, null);
+        }
+        else
+            return null;
+    }
+
+    @Override
+    public boolean isLeaf(Object o) {
+        if (o == null)
+            return false;
+        if (o instanceof String)
+            return tagDataProvider.getList().isEmpty();
+        else
+            return true;
+    }
+
+    private void fetchTags(final Iterator<Folder> iter) {
+        final Pithos app = Pithos.get();
+        if (iter.hasNext()) {
+            final Folder f = iter.next();
+
+            String path = app.getApiPath() + app.getUsername() + "/" + f.getUri() + "?format=json&delimiter=/&prefix=" + f.getPrefix();
+//            GetRequest<Tag> getFolder = new GetRequest<Tag>(Tag.class, path, f) {
+//                @Override
+//                public void onSuccess(Tag result) {
+//                    fetchFolder(iter, dataProvider, tags);
+//                }
+//
+//                @Override
+//                public void onError(Throwable t) {
+//                    GWT.log("Error getting folder", t);
+//                    if (t instanceof RestException)
+//                        Pithos.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
+//                    else
+//                        Pithos.get().displayError("System error fetching folder: " + t.getMessage());
+//                }
+//            };
+//            getFolder.setHeader("X-Auth-Token", app.getToken());
+//            Scheduler.get().scheduleDeferred(getFolder);
+        }
+    }
+//
+//    public void initialize(AccountResource account) {
+//        Iterator<Tag> iter = account.getContainers().iterator();
+//        fetchFolder(iter, rootDataProvider, account.getContainers());
+//    }
+//
+    public Tag getSelection() {
+        return selectionModel.getSelectedObject();
+    }
+
+    public void updateTag(Tag tag) {
+//        if (dataProviderMap.get(tag) == null) {
+//            dataProviderMap.put(tag, new ListDataProvider<Tag>());
+//        }
+//        final ListDataProvider<Tag> dataProvider = dataProviderMap.get(tag);
+//        if (!tag.isTrash())
+//            fetchFolder(tag, dataProvider);
+//        else
+//            Pithos.get().showFiles(tag);
+    }
+
+//    public void fetchFolder(final Tag f, final ListDataProvider<Tag> dataProvider) {
+//        dataProvider.flush();
+//        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+//            @Override
+//            public void execute() {
+//                final Pithos app = Pithos.get();
+//                String path = app.getApiPath() + app.getUsername() + "/" + f.getContainer() + "?format=json&delimiter=/&prefix=" + f.getPrefix();
+//                GetRequest<Tag> getFolder = new GetRequest<Tag>(Tag.class, path, f) {
+//                    @Override
+//                    public void onSuccess(Tag result) {
+//                        app.showFiles(result);
+//                        Iterator<Tag> iter = result.getSubfolders().iterator();
+//                        fetchFolder(iter, dataProvider, result.getSubfolders());
+//                    }
+//
+//                    @Override
+//                    public void onError(Throwable t) {
+//                        GWT.log("Error getting folder", t);
+//                        if (t instanceof RestException)
+//                            Pithos.get().displayError("Error getting folder: " + ((RestException) t).getHttpStatusText());
+//                        else
+//                            Pithos.get().displayError("System error fetching folder: " + t.getMessage());
+//                    }
+//                };
+//                getFolder.setHeader("X-Auth-Token", app.getToken());
+//                Scheduler.get().scheduleDeferred(getFolder);
+//            }
+//        });
+//    }
+
+    public void initialize(AccountResource account) {
+        List<Tag> tagList = tagDataProvider.getList();
+        for (Folder f : account.getContainers()) {
+            for (String t : f.getTags())
+                tagList.add(new Tag(t));
+        }
+        rootDataProvider.getList().add("Tags");
+    }
+}
@@ -37,7 +37,7 @@
        <head>
                <title>Pithos</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <script language='javascript' src='gr.grnet.pithos.web.GSS.nocache.js'></script>
+               <script language='javascript' src='gr.grnet.pithos.web.Pithos.nocache.js'></script>
                <script type="text/javascript">
                document.oncontextmenu = function() {
                        return false;