/*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
public void execute() {
if (containerPanel != null)
containerPanel.hide();
- final Group group = user.getGroup();
+ final String groupName = user.getGroup();
+ final Group group = app.getAccount().getGroup(groupName);
+ if (group == null)
+ return;
group.removeMember(user.getName());
String path = "?update=";
PostRequest updateGroup = new PostRequest(app.getApiPath(), app.getUsername(), path) {
@Override
- public void onSuccess(@SuppressWarnings("unused") Resource result) {
- app.updateGroupNode(group);
+ public void onSuccess(Resource result) {
+ app.fetchAccount(new Command() {
+
+ @Override
+ public void execute() {
+ Group updatedGroup2 = app.getAccount().getGroup(groupName);
+ if (updatedGroup2 != null)
+ app.updateGroupNode(updatedGroup2);
+ else {
+ app.updateGroupNode(null);
+ }
+ }
+ });
}
@Override
public void onError(Throwable t) {
GWT.log("", t);
+ app.setError(t);
if (t instanceof RestException) {
app.displayError("Unable to update group:" + ((RestException) t).getHttpStatusText());
}
String groupMembers = "";
if (!group.getMembers().isEmpty()) {
for (String u : group.getMembers())
- groupMembers += (u + ",");
+ groupMembers += (URL.encodePathSegment(u) + ",");
}
else
groupMembers = "~";