Fixed Final and Lock error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-share-widget@100291 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-09-30 12:42:10 +00:00 committed by Giancarlo Panichi
parent 86d7e843c2
commit 8faccb6e46
1 changed files with 26 additions and 15 deletions

View File

@ -4,12 +4,15 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareInfo;
import org.gcube.portlets.user.td.sharewidget.client.util.InfoMessageBox;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.widgets.workspacesharingwidget.client.WorkspaceSmartSharingController;
import org.gcube.portlets.widgets.workspacesharingwidget.client.view.sharing.SmartShare;
@ -52,11 +55,15 @@ public class TRShare {
new AsyncCallback<ShareInfo>() {
public void onFailure(Throwable caught) {
Log.debug("ShareInfo Error: "
+ caught.getLocalizedMessage());
alert("Error retrienving share info",
"Error retrieving share info");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("ShareInfo Error: "
+ caught.getLocalizedMessage());
alert("Error retrienving share info",
"Error retrieving share info");
}
}
public void onSuccess(ShareInfo result) {
@ -83,7 +90,7 @@ public class TRShare {
}
WorkspaceSmartSharingController controller = new WorkspaceSmartSharingController(
file, listAlreadySharedContact,false,true);
file, listAlreadySharedContact, false, true);
final SmartShare sharingWindow = controller.getSharingDialog();
@ -120,25 +127,29 @@ public class TRShare {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.debug("Share Error: "
+ caught.getLocalizedMessage());
alert("Error sharing tabular resource",
"Error sharing tabular resource: "+caught.getLocalizedMessage());
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Share Error: "
+ caught.getLocalizedMessage());
alert("Error sharing tabular resource",
"Error sharing tabular resource: "
+ caught.getLocalizedMessage());
}
}
public void onSuccess(Void result) {
Log.debug("Tabular Resource Shared: "
+ shareInfo.getTabResource().getTrId()
.toString());
info("Shared",
"Tabular Resource is shared");
info("Shared", "Tabular Resource is shared");
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.SHARE, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
});