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:
parent
a928695c02
commit
d8be8fddfa
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -33,11 +38,12 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
|
|||
protected EventBus eventBus;
|
||||
|
||||
public TemplateApplyDialog(TRId trId, EventBus eventBus) {
|
||||
this.trId=trId;
|
||||
this.eventBus=eventBus;
|
||||
this.trId = trId;
|
||||
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();
|
||||
}
|
||||
|
@ -71,22 +76,38 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
|
|||
|
||||
}
|
||||
|
||||
protected void close (){
|
||||
protected void close() {
|
||||
hide();
|
||||
}
|
||||
|
||||
|
||||
protected void applyTemplate(final TemplateApplySession templateApplySession){
|
||||
this.templateApplySession=templateApplySession;
|
||||
protected void applyTemplate(final TemplateApplySession templateApplySession) {
|
||||
this.templateApplySession = templateApplySession;
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startTemplateApply(templateApplySession,
|
||||
new AsyncCallback<String>() {
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Apply Template Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Apply Template Error ",
|
||||
"Error in invocation of apply template operation!");
|
||||
|
||||
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! "+caught.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(String taskId) {
|
||||
|
@ -95,12 +116,10 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
|
|||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void openMonitorDialog(String taskId){
|
||||
MonitorDialog monitorDialog=new MonitorDialog(taskId,eventBus);
|
||||
protected void openMonitorDialog(String taskId) {
|
||||
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
|
||||
monitorDialog.addProgressDialogListener(this);
|
||||
monitorDialog.show();
|
||||
}
|
||||
|
@ -143,6 +162,4 @@ public class TemplateApplyDialog extends Window implements MonitorDialogListene
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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,24 +16,24 @@ 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 {
|
||||
public class TemplateDeleteDialog extends Window {
|
||||
protected String WIDTH = "720px";
|
||||
protected String HEIGHT = "530px";
|
||||
protected TemplateDeleteSession templateDeleteSession;
|
||||
protected EventBus eventBus;
|
||||
|
||||
public TemplateDeleteDialog(EventBus eventBus) {
|
||||
this.eventBus=eventBus;
|
||||
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();
|
||||
}
|
||||
|
@ -64,34 +66,42 @@ public class TemplateDeleteDialog extends Window {
|
|||
|
||||
}
|
||||
|
||||
protected void close (){
|
||||
protected void close() {
|
||||
hide();
|
||||
}
|
||||
|
||||
|
||||
protected void templatesDelete(final TemplateDeleteSession templateDeleteSession){
|
||||
this.templateDeleteSession=templateDeleteSession;
|
||||
protected void templatesDelete(
|
||||
final TemplateDeleteSession templateDeleteSession) {
|
||||
this.templateDeleteSession = templateDeleteSession;
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.templateDelete(templateDeleteSession,
|
||||
new AsyncCallback<Void>() {
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Delete Template Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Apply Template Error ",
|
||||
"Error in invocation of delete template operation!");
|
||||
|
||||
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! "
|
||||
+ caught.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(Void result) {
|
||||
UtilsGXT3.info("Delete Template",
|
||||
"Template deleted!");
|
||||
UtilsGXT3.info("Delete Template", "Template deleted!");
|
||||
close();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue