- permList.updatePermissionsAccordingToInput();\r
- Set<PermissionHolder> perms = permList.getPermissions();\r
- JSONObject json = new JSONObject();\r
- if(!folder.getName().equals(folderName.getText()))\r
- json.put("name", new JSONString(folderName.getText()));\r
- //only update the read for all perm if the user is the owner\r
- if (readForAll.getValue() != folder.isReadForAll())\r
- if (folder.getOwner().equals(GSS.get().getCurrentUserResource().getUsername()))\r
- json.put("readForAll", JSONBoolean.getInstance(readForAll.getValue()));\r
- if (permList.hasChanges()) {\r
- JSONArray perma = new JSONArray();\r
- int i=0;\r
- for(PermissionHolder p : perms){\r
- JSONObject po = new JSONObject();\r
- if(p.getUser() != null)\r
- po.put("user", new JSONString(p.getUser()));\r
- if(p.getGroup() != null)\r
- po.put("group", new JSONString(p.getGroup()));\r
- po.put("read", JSONBoolean.getInstance(p.isRead()));\r
- po.put("write", JSONBoolean.getInstance(p.isWrite()));\r
- po.put("modifyACL", JSONBoolean.getInstance(p.isModifyACL()));\r
- perma.set(i,po);\r
- i++;\r
- }\r
- json.put("permissions", perma);\r
- GWT.log(json.toString(), null);\r
- }\r
- PostCommand ep = new PostCommand(folder.getUri()+"?update=", json.toString(), 200){\r
-\r
- @Override\r
- public void onComplete() {\r
- //TODO:CELLTREE\r
- \r
- if(getPostBody() != null && !"".equals(getPostBody().trim())){\r
- \r
- \r
- FolderResource fres = ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource();\r
- String initialPath = fres.getUri();\r
- String newPath = getPostBody().trim();\r
- fres.setUri(newPath);\r
- ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource().setUri(newPath);\r
- ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).setUri(newPath);\r
- GSS.get().getTreeView().updateNodeChildren(fres.getParentURI());\r
- if (permList.hasChanges()) {\r
- GSS.get().getTreeView().updateMySharedNode();\r
- }\r
- /*\r
- if(folderItem.getParentItem() != null && ((DnDTreeItem)folderItem.getParentItem()).getFolderResource() != null){\r
- ((DnDTreeItem)folderItem.getParentItem()).getFolderResource().removeSubfolderPath(initialPath);\r
- ((DnDTreeItem)folderItem.getParentItem()).getFolderResource().getSubfolderPaths().add(newPath);\r
- }*/\r
- }\r
- //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
- \r
- GSS.get().showFileList(true);\r
- }\r
-\r
- @Override\r
- public void onError(Throwable t) {\r
- GWT.log("", t);\r
- 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 or" +\r
- " a folder with same name already exists");\r
- else if(statusCode == 404)\r
- GSS.get().displayError("Resource not found, or user specified in sharing does not exist");\r
- else\r
- GSS.get().displayError("Unable to update folder: "+((RestException)t).getHttpStatusText());\r
- }\r
- else\r
- GSS.get().displayError("System error moifying file: "+t.getMessage());\r
- //TODO:CELLTREE\r
- //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
- }\r
- };\r
- DeferredCommand.addCommand(ep);\r
+// permList.updatePermissionsAccordingToInput();\r
+// Set<PermissionHolder> perms = permList.getPermissions();\r
+// JSONObject json = new JSONObject();\r
+// if(!folder.getName().equals(folderName.getText()))\r
+// json.put("name", new JSONString(folderName.getText()));\r
+// //only update the read for all perm if the user is the owner\r
+// if (readForAll.getValue() != folder.isReadForAll())\r
+// if (folder.getOwner().equals(GSS.get().getCurrentUserResource().getUsername()))\r
+// json.put("readForAll", JSONBoolean.getInstance(readForAll.getValue()));\r
+// if (permList.hasChanges()) {\r
+// JSONArray perma = new JSONArray();\r
+// int i=0;\r
+// for(PermissionHolder p : perms){\r
+// JSONObject po = new JSONObject();\r
+// if(p.getUser() != null)\r
+// po.put("user", new JSONString(p.getUser()));\r
+// if(p.getGroup() != null)\r
+// po.put("group", new JSONString(p.getGroup()));\r
+// po.put("read", JSONBoolean.getInstance(p.isRead()));\r
+// po.put("write", JSONBoolean.getInstance(p.isWrite()));\r
+// po.put("modifyACL", JSONBoolean.getInstance(p.isModifyACL()));\r
+// perma.set(i,po);\r
+// i++;\r
+// }\r
+// json.put("permissions", perma);\r
+// GWT.log(json.toString(), null);\r
+// }\r
+// PostCommand ep = new PostCommand(folder.getUri()+"?update=", json.toString(), 200){\r
+//\r
+// @Override\r
+// public void onComplete() {\r
+// //TODO:CELLTREE\r
+//\r
+// if(getPostBody() != null && !"".equals(getPostBody().trim())){\r
+//\r
+//\r
+// FolderResource fres = ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource();\r
+// String initialPath = fres.getUri();\r
+// String newPath = getPostBody().trim();\r
+// fres.setUri(newPath);\r
+// ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource().setUri(newPath);\r
+// ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).setUri(newPath);\r
+// GSS.get().getTreeView().updateNodeChildren(fres.getParentURI());\r
+// if (permList.hasChanges()) {\r
+// GSS.get().getTreeView().updateMySharedNode();\r
+// }\r
+// /*\r
+// if(folderItem.getParentItem() != null && ((DnDTreeItem)folderItem.getParentItem()).getFolderResource() != null){\r
+// ((DnDTreeItem)folderItem.getParentItem()).getFolderResource().removeSubfolderPath(initialPath);\r
+// ((DnDTreeItem)folderItem.getParentItem()).getFolderResource().getSubfolderPaths().add(newPath);\r
+// }*/\r
+// }\r
+// //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+//\r
+// GSS.get().showFileList(true);\r
+// }\r
+//\r
+// @Override\r
+// public void onError(Throwable t) {\r
+// GWT.log("", t);\r
+// 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 or" +\r
+// " a folder with same name already exists");\r
+// else if(statusCode == 404)\r
+// GSS.get().displayError("Resource not found, or user specified in sharing does not exist");\r
+// else\r
+// GSS.get().displayError("Unable to update folder: "+((RestException)t).getHttpStatusText());\r
+// }\r
+// else\r
+// GSS.get().displayError("System error moifying file: "+t.getMessage());\r
+// //TODO:CELLTREE\r
+// //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+// }\r
+// };\r
+// DeferredCommand.addCommand(ep);\r