diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java index c4b916d..0c8f1a6 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java @@ -47,16 +47,16 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener REPLACEBATH, RESUME; } - protected String WIDTH = "650px"; - protected String HEIGHT = "530px"; - protected TRId trId; - protected String columnName = null; - protected RequestProperties requestProperties; - protected EventBus eventBus; - protected String taskIdOfInvocationS; - protected CALLTYPE callType; + private static final String WIDTH = "650px"; + private static final String HEIGHT = "530px"; + private TRId trId; + + private EventBus eventBus; + private String taskIdOfInvocationS; + private CALLTYPE callType; private InvocationS invocationS; private ConditionCode conditionCode; // For Curation + /** * @@ -64,14 +64,13 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener * @param columnName * @param eventBus */ - public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) { + public ReplaceBatchDialog(TRId trId, String columnLocalId, EventBus eventBus) { this.trId = trId; - this.columnName = columnName; this.eventBus = eventBus; taskIdOfInvocationS = null; initWindow(); ReplaceBatchPanel batchRepalcePanel = new ReplaceBatchPanel(this, trId, - columnName, eventBus); + columnLocalId, eventBus); add(batchRepalcePanel); } @@ -86,7 +85,6 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener Log.debug("ReplaceBatchDialog: " + trId + ", RequestProperties:" + requestProperties); this.trId = trId; - this.requestProperties = requestProperties; this.eventBus = eventBus; invocationS = (InvocationS) requestProperties.getMap().get( diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java index fce1545..812ceb9 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java @@ -96,31 +96,29 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar; public class ReplaceBatchPanel extends FramedPanel implements SingleValueReplaceListener, DimensionRowSelectionListener, ConnectCodelistListener { - protected String WIDTH = "560px"; - protected String HEIGHT = "520px"; - protected EventBus eventBus; - protected TextField label = null; - protected TRId trId; - protected String columnName; + private static final String DON_T_REPLACE = "Don't replace"; + private static final String WIDTH = "560px"; + private static final String HEIGHT = "520px"; + + private EventBus eventBus; + private TRId trId; + + private RefColumn refColumn; + private String columnLocalId; + private ConditionCode conditionCode; // For Curation + private String validationColumnColumnId; // For Curation + + private boolean curation; + private ColumnData column; + private boolean hasValidationColumns; + private ShowOccurrencesType showOccurencesType; + private ColumnData connection; - protected RefColumn refColumn; - protected String columnId; - protected ConditionCode conditionCode; // For Curation - protected String validationColumnColumnId; // For Curation - protected RequestProperties requestProperties; - protected boolean curation; - protected ColumnData column; - protected boolean hasValidationColumns; - protected ShowOccurrencesType showOccurencesType; - protected ColumnData connection; - - protected ReplaceBatchDialog parent; + private ReplaceBatchDialog parent; private ReplaceEntry currentReplaceEntry; private int currentRowIndex; - protected static final String DON_T_REPLACE = "Don't replace"; - private TextButton btnSave; private TextButton btnClose; @@ -133,10 +131,10 @@ public class ReplaceBatchPanel extends FramedPanel implements private TextButton btnDisconnect; private TextField connectionField; - protected ListLoader> loader; - protected Grid grid; - protected ListStore store; - protected HTML info; + private ListLoader> loader; + private Grid grid; + private ListStore store; + private HTML info; private boolean simpleReplace; @@ -145,13 +143,12 @@ public class ReplaceBatchPanel extends FramedPanel implements this.curation = true; this.parent = parent; this.trId = trId; - this.requestProperties = requestProperties; this.eventBus = eventBus; InvocationS invocationS = (InvocationS) requestProperties.getMap().get( RequestPropertiesParameterType.InvocationS); - columnId = invocationS.getColumnId(); + columnLocalId = invocationS.getColumnId(); refColumn = invocationS.getRefColumn(); @@ -170,11 +167,11 @@ public class ReplaceBatchPanel extends FramedPanel implements } public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId, - String columnName, EventBus eventBus) { + String columnLocalId, EventBus eventBus) { this.curation = false; this.parent = parent; this.trId = trId; - this.columnName = columnName; + this.columnLocalId = columnLocalId; this.eventBus = eventBus; this.conditionCode = null; this.validationColumnColumnId = null; @@ -182,9 +179,9 @@ public class ReplaceBatchPanel extends FramedPanel implements connection = null; hasValidationColumns = false; Log.debug("Create BatchReplacePanel(): [" + trId.toString() - + " , columnName:" + columnName + "]"); + + " , columnLocalId:" + columnLocalId + "]"); init(); - retrieveColumn(); + retrieveColumnByColumnId(); } @@ -492,47 +489,12 @@ public class ReplaceBatchPanel extends FramedPanel implements } - protected void retrieveColumn() { - TDGWTServiceAsync.INSTANCE.getColumn(trId, columnName, - new AsyncCallback() { - 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 Final", - caught.getLocalizedMessage()); - } else { - Log.error("load column failure:" - + caught.getLocalizedMessage()); - UtilsGXT3.alert("Error retrieving column", - "Error retrieving column"); - } - } - } - } - - public void onSuccess(ColumnData result) { - Log.debug("Column: " + result); - column = result; - retriveValidationColumn(); - } - - }); - } protected void retrieveColumnByColumnId() { - Log.debug("Retrieve Column by ColumnId: columnId:" + columnId + Log.debug("Retrieve Column by ColumnId: columnLocalId:" + columnLocalId + ", trId:" + trId); - TDGWTServiceAsync.INSTANCE.getColumn(columnId, trId, + TDGWTServiceAsync.INSTANCE.getColumn(columnLocalId, trId, new AsyncCallback() { public void onFailure(Throwable caught) { @@ -562,7 +524,6 @@ public class ReplaceBatchPanel extends FramedPanel implements public void onSuccess(ColumnData result) { Log.debug("Column: " + result); column = result; - columnName = result.getName(); retriveValidationColumn(); } @@ -570,7 +531,7 @@ public class ReplaceBatchPanel extends FramedPanel implements } protected void retriveValidationColumn() { - TDGWTServiceAsync.INSTANCE.getValidationColumns(trId, columnName, + TDGWTServiceAsync.INSTANCE.getValidationColumns(columnLocalId,trId, new AsyncCallback>() { public void onFailure(Throwable caught) {