Revision 33ee8450 src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java
b/src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package gr.grnet.pithos.web.client.commands; |
36 | 36 |
|
37 |
import gr.grnet.pithos.web.client.Pithos; |
|
38 |
import gr.grnet.pithos.web.client.Resource; |
|
39 |
import gr.grnet.pithos.web.client.grouptree.Group; |
|
40 |
import gr.grnet.pithos.web.client.rest.PostRequest; |
|
41 |
import gr.grnet.pithos.web.client.rest.RestException; |
|
42 |
|
|
43 | 37 |
import com.google.gwt.core.client.GWT; |
44 | 38 |
import com.google.gwt.core.client.Scheduler; |
45 | 39 |
import com.google.gwt.http.client.Response; |
46 | 40 |
import com.google.gwt.http.client.URL; |
41 |
import com.google.gwt.safehtml.shared.SafeHtmlUtils; |
|
47 | 42 |
import com.google.gwt.user.client.Command; |
48 | 43 |
import com.google.gwt.user.client.Window; |
49 | 44 |
import com.google.gwt.user.client.ui.PopupPanel; |
45 |
import gr.grnet.pithos.web.client.Const; |
|
46 |
import gr.grnet.pithos.web.client.Pithos; |
|
47 |
import gr.grnet.pithos.web.client.Resource; |
|
48 |
import gr.grnet.pithos.web.client.grouptree.Group; |
|
49 |
import gr.grnet.pithos.web.client.rest.PostRequest; |
|
50 |
import gr.grnet.pithos.web.client.rest.RestException; |
|
50 | 51 |
|
51 | 52 |
|
52 | 53 |
/** |
... | ... | |
71 | 72 |
|
72 | 73 |
@Override |
73 | 74 |
public void execute() { |
74 |
if (containerPanel != null) |
|
75 |
containerPanel.hide(); |
|
76 |
if (Window.confirm("Are you sure you want to delete group " + group.getName())) { |
|
75 |
if (containerPanel != null) { |
|
76 |
containerPanel.hide(); |
|
77 |
} |
|
78 |
final String groupName = group.getName(); |
|
79 |
final String safeGroupName = SafeHtmlUtils.htmlEscape(groupName); |
|
80 |
if (Window.confirm("Are you sure you want to delete group " + safeGroupName)) { |
|
77 | 81 |
String path = "?update="; |
78 | 82 |
PostRequest updateGroup = new PostRequest(Pithos.getStorageAPIURL(), app.getUserID(), path) { |
79 | 83 |
|
... | ... | |
98 | 102 |
app.sessionExpired(); |
99 | 103 |
} |
100 | 104 |
}; |
101 |
updateGroup.setHeader("X-Auth-Token", app.getUserToken());
|
|
102 |
updateGroup.setHeader("X-Account-Group-" + URL.encodePathSegment(group.getName()), "~");
|
|
105 |
updateGroup.setHeader(Const.X_AUTH_TOKEN, app.getUserToken());
|
|
106 |
updateGroup.setHeader("X-Account-Group-" + URL.encodePathSegment(groupName), "~");
|
|
103 | 107 |
Scheduler.get().scheduleDeferred(updateGroup); |
104 | 108 |
} |
105 | 109 |
} |
Also available in: Unified diff