Revision f55cf326 web_client/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java
b/web_client/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package gr.grnet.pithos.web.client.commands; |
36 | 36 |
|
37 |
import gr.grnet.pithos.web.client.GSS;
|
|
37 |
import gr.grnet.pithos.web.client.Pithos;
|
|
38 | 38 |
import gr.grnet.pithos.web.client.rest.MultiplePostCommand; |
39 | 39 |
import gr.grnet.pithos.web.client.rest.PostCommand; |
40 | 40 |
import gr.grnet.pithos.web.client.rest.RestException; |
... | ... | |
67 | 67 |
@Override |
68 | 68 |
public void execute() { |
69 | 69 |
containerPanel.hide(); |
70 |
Object selection = GSS.get().getCurrentSelection();
|
|
70 |
Object selection = Pithos.get().getCurrentSelection();
|
|
71 | 71 |
if (selection == null){ |
72 | 72 |
// Check to see if Trash Node is selected. |
73 | 73 |
List folderList = new ArrayList(); |
74 |
TrashResource trashItem = GSS.get().getTreeView().getTrash();
|
|
74 |
TrashResource trashItem = Pithos.get().getTreeView().getTrash();
|
|
75 | 75 |
for(int i=0 ; i < trashItem.getFolders().size() ; i++) |
76 | 76 |
folderList.add(trashItem.getFolders().get(i)); |
77 | 77 |
return; |
... | ... | |
84 | 84 |
@Override |
85 | 85 |
public void onComplete() { |
86 | 86 |
//TODO:CELLTREE |
87 |
//GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
|
|
87 |
//Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
|
|
88 | 88 |
|
89 |
GSS.get().showFileList(true);
|
|
89 |
Pithos.get().showFileList(true);
|
|
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
@Override |
... | ... | |
95 | 95 |
if(t instanceof RestException){ |
96 | 96 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
97 | 97 |
if(statusCode == 405) |
98 |
GSS.get().displayError("You don't have the necessary permissions");
|
|
98 |
Pithos.get().displayError("You don't have the necessary permissions");
|
|
99 | 99 |
else if(statusCode == 404) |
100 |
GSS.get().displayError("File does not exist");
|
|
100 |
Pithos.get().displayError("File does not exist");
|
|
101 | 101 |
else if(statusCode == 409) |
102 |
GSS.get().displayError("A file with the same name already exists");
|
|
102 |
Pithos.get().displayError("A file with the same name already exists");
|
|
103 | 103 |
else if(statusCode == 413) |
104 |
GSS.get().displayError("Your quota has been exceeded");
|
|
104 |
Pithos.get().displayError("Your quota has been exceeded");
|
|
105 | 105 |
else |
106 |
GSS.get().displayError("Unable to restore file:"+((RestException)t).getHttpStatusText());
|
|
106 |
Pithos.get().displayError("Unable to restore file:"+((RestException)t).getHttpStatusText());
|
|
107 | 107 |
} |
108 | 108 |
else |
109 |
GSS.get().displayError("System error restoring file:"+t.getMessage());
|
|
109 |
Pithos.get().displayError("System error restoring file:"+t.getMessage());
|
|
110 | 110 |
} |
111 | 111 |
}; |
112 | 112 |
DeferredCommand.addCommand(rt); |
... | ... | |
121 | 121 |
@Override |
122 | 122 |
public void onComplete() { |
123 | 123 |
//TODO:CELLTREE |
124 |
//GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
|
|
125 |
GSS.get().showFileList(true);
|
|
124 |
//Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
|
|
125 |
Pithos.get().showFileList(true);
|
|
126 | 126 |
} |
127 | 127 |
|
128 | 128 |
@Override |
... | ... | |
131 | 131 |
if(t instanceof RestException){ |
132 | 132 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
133 | 133 |
if(statusCode == 405) |
134 |
GSS.get().displayError("You don't have the necessary permissions");
|
|
134 |
Pithos.get().displayError("You don't have the necessary permissions");
|
|
135 | 135 |
else if(statusCode == 404) |
136 |
GSS.get().displayError("File does not exist");
|
|
136 |
Pithos.get().displayError("File does not exist");
|
|
137 | 137 |
else if(statusCode == 409) |
138 |
GSS.get().displayError("A file with the same name already exists");
|
|
138 |
Pithos.get().displayError("A file with the same name already exists");
|
|
139 | 139 |
else if(statusCode == 413) |
140 |
GSS.get().displayError("Your quota has been exceeded");
|
|
140 |
Pithos.get().displayError("Your quota has been exceeded");
|
|
141 | 141 |
else |
142 |
GSS.get().displayError("Unable to restore file::"+((RestException)t).getHttpStatusText());
|
|
142 |
Pithos.get().displayError("Unable to restore file::"+((RestException)t).getHttpStatusText());
|
|
143 | 143 |
} |
144 | 144 |
else |
145 |
GSS.get().displayError("System error restoring file:"+t.getMessage());
|
|
145 |
Pithos.get().displayError("System error restoring file:"+t.getMessage());
|
|
146 | 146 |
} |
147 | 147 |
}; |
148 | 148 |
DeferredCommand.addCommand(rt); |
... | ... | |
155 | 155 |
public void onComplete() { |
156 | 156 |
//TODO:CELLTREE |
157 | 157 |
/* |
158 |
GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getRootItem());
|
|
158 |
Pithos.get().getFolders().updateFolder((DnDTreeItem) Pithos.get().getFolders().getRootItem());
|
|
159 | 159 |
|
160 |
GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
|
|
160 |
Pithos.get().getFolders().update(Pithos.get().getFolders().getTrashItem());
|
|
161 | 161 |
*/ |
162 | 162 |
|
163 |
GSS.get().getTreeView().updateTrashNode();
|
|
164 |
GSS.get().getTreeView().updateRootNode();
|
|
163 |
Pithos.get().getTreeView().updateTrashNode();
|
|
164 |
Pithos.get().getTreeView().updateRootNode();
|
|
165 | 165 |
} |
166 | 166 |
|
167 | 167 |
@Override |
... | ... | |
170 | 170 |
if(t instanceof RestException){ |
171 | 171 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
172 | 172 |
if(statusCode == 405) |
173 |
GSS.get().displayError("You don't have the necessary permissions");
|
|
173 |
Pithos.get().displayError("You don't have the necessary permissions");
|
|
174 | 174 |
else if(statusCode == 404) |
175 |
GSS.get().displayError("Folder does not exist");
|
|
175 |
Pithos.get().displayError("Folder does not exist");
|
|
176 | 176 |
else if(statusCode == 409) |
177 |
GSS.get().displayError("A folder with the same name already exists");
|
|
177 |
Pithos.get().displayError("A folder with the same name already exists");
|
|
178 | 178 |
else if(statusCode == 413) |
179 |
GSS.get().displayError("Your quota has been exceeded");
|
|
179 |
Pithos.get().displayError("Your quota has been exceeded");
|
|
180 | 180 |
else |
181 |
GSS.get().displayError("Unable to restore folder::"+((RestException)t).getHttpStatusText());
|
|
181 |
Pithos.get().displayError("Unable to restore folder::"+((RestException)t).getHttpStatusText());
|
|
182 | 182 |
} |
183 | 183 |
else |
184 |
GSS.get().displayError("System error restoring folder:"+t.getMessage());
|
|
184 |
Pithos.get().displayError("System error restoring folder:"+t.getMessage());
|
|
185 | 185 |
} |
186 | 186 |
}; |
187 | 187 |
DeferredCommand.addCommand(rt); |
Also available in: Unified diff