Fixed Error Management
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-replacebyexternal-widget@101905 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7bcc00902a
commit
1c731d1401
|
@ -24,6 +24,7 @@ import com.sencha.gxt.core.client.util.Margins;
|
|||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign;
|
||||
|
||||
|
@ -33,15 +34,16 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ReplaceByExternalOperationInProgressCard extends WizardCard implements
|
||||
MonitorDialogListener {
|
||||
public class ReplaceByExternalOperationInProgressCard extends WizardCard
|
||||
implements MonitorDialogListener {
|
||||
|
||||
protected ReplaceByExternalOperationInProgressCard thisCard;
|
||||
protected ReplaceByExternalSession replaceByExternalSession;
|
||||
protected TRId newTrId;
|
||||
protected HtmlLayoutContainer resultField;
|
||||
|
||||
public ReplaceByExternalOperationInProgressCard(final ReplaceByExternalSession replaceByExternalSession) {
|
||||
public ReplaceByExternalOperationInProgressCard(
|
||||
final ReplaceByExternalSession replaceByExternalSession) {
|
||||
super("Operation In Progress", "");
|
||||
|
||||
this.replaceByExternalSession = replaceByExternalSession;
|
||||
|
@ -57,17 +59,17 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
|
||||
description.setHTML(0, 0,
|
||||
"<span style=\"font-weight:bold;\";>Replace with: </span>");
|
||||
description.setText(0, 1, replaceByExternalSession.getExternalTabularResource()
|
||||
.getName());
|
||||
description.setText(0, 1, replaceByExternalSession
|
||||
.getExternalTabularResource().getName());
|
||||
description.setHTML(1, 0,
|
||||
"<span style=\"font-weight:bold;\";>Type: </span>");
|
||||
description.setText(1, 1, replaceByExternalSession.getExternalTabularResource()
|
||||
.getTableTypeName());
|
||||
description.setText(1, 1, replaceByExternalSession
|
||||
.getExternalTabularResource().getTableTypeName());
|
||||
|
||||
description.setHTML(2, 0,
|
||||
"<span style=\"font-weight:bold;\";>Owner: </span>");
|
||||
description.setText(2, 1, replaceByExternalSession.getExternalTabularResource()
|
||||
.getOwnerLogin());
|
||||
description.setText(2, 1, replaceByExternalSession
|
||||
.getExternalTabularResource().getOwnerLogin());
|
||||
|
||||
FramedPanel summary = new FramedPanel();
|
||||
summary.setHeadingText("Union Summary");
|
||||
|
@ -81,7 +83,7 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
operationInProgressPanel.add(resultField, new BoxLayoutData(
|
||||
new Margins(10, 5, 10, 5)));
|
||||
|
||||
setContent(operationInProgressPanel);
|
||||
setCenterWidget(operationInProgressPanel, new MarginData(0));
|
||||
resultField.setVisible(false);
|
||||
|
||||
}
|
||||
|
@ -90,8 +92,8 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
*
|
||||
*/
|
||||
public void startUnion() {
|
||||
TDGWTServiceAsync.INSTANCE.startReplaceByExternal(replaceByExternalSession,
|
||||
new AsyncCallback<String>() {
|
||||
TDGWTServiceAsync.INSTANCE.startReplaceByExternal(
|
||||
replaceByExternalSession, new AsyncCallback<String>() {
|
||||
|
||||
public void onSuccess(String taskId) {
|
||||
openMonitorDialog(taskId);
|
||||
|
@ -108,18 +110,19 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
if (caught instanceof TDGWTIsLockedException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
showErrorAndHide("Error Locked",
|
||||
caught.getLocalizedMessage(), caught);
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
if (caught instanceof TDGWTIsFinalException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
showErrorAndHide("Error Final",
|
||||
caught.getLocalizedMessage(),
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
showErrorAndHide(
|
||||
"Error in Replace By External",
|
||||
"An error occured in Replace By External: "
|
||||
+ caught.getLocalizedMessage(),
|
||||
"An error occured in Replace By External.",
|
||||
caught.getLocalizedMessage(),
|
||||
caught);
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +136,6 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
public void setup() {
|
||||
getWizardWindow().setEnableBackButton(false);
|
||||
setBackButtonVisible(false);
|
||||
setNextButtonVisible(false);
|
||||
getWizardWindow().setEnableNextButton(false);
|
||||
getWizardWindow().setNextButtonToFinish();
|
||||
startUnion();
|
||||
|
@ -189,7 +191,7 @@ public class ReplaceByExternalOperationInProgressCard extends WizardCard impleme
|
|||
new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
showErrorAndHide("Error in Replace By External", reason, caught);
|
||||
showErrorAndHide("Error in Replace By External", reason, details, caught);
|
||||
|
||||
}
|
||||
forceLayout();
|
||||
|
|
Loading…
Reference in New Issue