Minor update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@101400 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-11-03 17:21:54 +00:00
parent a928695c02
commit d8be8fddfa
3 changed files with 99 additions and 71 deletions

View File

@ -562,7 +562,7 @@ public class TabularDataController {
Log.debug("TabularResourceDataView:" + tabularResourceDataView);
openTRIdAfterServerUpdate = tabularResourceDataView.getTrId();
TDGWTServiceAsync.INSTANCE.setActiveTabularResource(
openTRIdAfterServerUpdate, new AsyncCallback<Void>() {
openTRIdAfterServerUpdate, new AsyncCallback<TRId>() {
@Override
public void onFailure(Throwable caught) {
@ -583,7 +583,8 @@ public class TabularDataController {
}
@Override
public void onSuccess(Void result) {
public void onSuccess(TRId result) {
openTRIdAfterServerUpdate=result;
doOpenTRIdAfterServerUpdate();
}

View File

@ -2,13 +2,18 @@ package org.gcube.portlets.user.td.client.template;
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateApplySession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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 com.allen_sauer.gwt.log.client.Log;
@ -18,14 +23,14 @@ import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TemplateApplyDialog extends Window implements MonitorDialogListener{
public class TemplateApplyDialog extends Window implements
MonitorDialogListener {
protected String WIDTH = "720px";
protected String HEIGHT = "530px";
protected TemplateApplySession templateApplySession;
@ -37,7 +42,8 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
this.eventBus = eventBus;
initWindow();
TemplateApplyPanel templateApplyPanel= new TemplateApplyPanel(this,trId, eventBus);
TemplateApplyPanel templateApplyPanel = new TemplateApplyPanel(this,
trId, eventBus);
add(templateApplyPanel);
}
@ -63,7 +69,6 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
closeBtn.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
close();
}
@ -75,18 +80,34 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
hide();
}
protected void applyTemplate(final TemplateApplySession templateApplySession) {
this.templateApplySession = templateApplySession;
TDGWTServiceAsync.INSTANCE.startTemplateApply(templateApplySession,
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Is Final",
caught.getLocalizedMessage());
} else {
Log.debug("Apply Template Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Apply Template Error ",
"Error in invocation of apply template operation!");
UtilsGXT3
.alert("Apply Template Error ",
"Error in invocation of apply template operation! "+caught.getLocalizedMessage());
}
}
}
}
public void onSuccess(String taskId) {
@ -95,10 +116,8 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
});
}
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
monitorDialog.addProgressDialogListener(this);
@ -143,6 +162,4 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
}
}

View File

@ -2,9 +2,12 @@ package org.gcube.portlets.user.td.client.template;
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateDeleteSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -13,11 +16,10 @@ import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TemplateDeleteDialog extends Window {
@ -30,7 +32,8 @@ public class TemplateDeleteDialog extends Window {
this.eventBus = eventBus;
initWindow();
TemplateDeletePanel templateDeletePanel= new TemplateDeletePanel(this, eventBus);
TemplateDeletePanel templateDeletePanel = new TemplateDeletePanel(this,
eventBus);
add(templateDeletePanel);
}
@ -56,7 +59,6 @@ public class TemplateDeleteDialog extends Window {
closeBtn.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
close();
}
@ -68,30 +70,38 @@ public class TemplateDeleteDialog extends Window {
hide();
}
protected void templatesDelete(final TemplateDeleteSession templateDeleteSession){
protected void templatesDelete(
final TemplateDeleteSession templateDeleteSession) {
this.templateDeleteSession = templateDeleteSession;
TDGWTServiceAsync.INSTANCE.templateDelete(templateDeleteSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.debug("Delete Template Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Apply Template Error ",
"Error in invocation of delete template operation!");
"Error in invocation of delete template operation! "
+ caught.getLocalizedMessage());
}
}
}
public void onSuccess(Void result) {
UtilsGXT3.info("Delete Template",
"Template deleted!");
UtilsGXT3.info("Delete Template", "Template deleted!");
close();
}
});
}
}