Updated Curation
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@98708 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4fed851023
commit
0a8dca0d4f
|
@ -397,8 +397,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
new Margins(1)));
|
||||
v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(1)));
|
||||
v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(1)));
|
||||
/*v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(1)));*/
|
||||
v.add(comboTimeDimensionTypeLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(1)));
|
||||
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||
|
@ -557,11 +557,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
+ "!"));
|
||||
Log.debug("ComboColumnReferenceType selected: "
|
||||
+ event.getSelectedItem());
|
||||
|
||||
//TODO Mapping fix
|
||||
/*
|
||||
comboColumnMapping.reset();
|
||||
storeComboColumnMapping.clear();
|
||||
storeComboColumnMapping.commitChanges();
|
||||
comboColumnMappingLabel.setVisible(true);
|
||||
forceLayout();
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ConditionCode;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
||||
|
@ -52,6 +53,12 @@ public class ReplaceBatchDialog extends Window implements
|
|||
private InvocationS invocationS;
|
||||
private ConditionCode conditionCode; // For Curation
|
||||
|
||||
/**
|
||||
*
|
||||
* @param trId
|
||||
* @param columnName
|
||||
* @param eventBus
|
||||
*/
|
||||
public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) {
|
||||
this.trId = trId;
|
||||
this.columnName = columnName;
|
||||
|
@ -63,6 +70,12 @@ public class ReplaceBatchDialog extends Window implements
|
|||
add(batchRepalcePanel);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param trId
|
||||
* @param requestProperties
|
||||
* @param eventBus
|
||||
*/
|
||||
public ReplaceBatchDialog(TRId trId, RequestProperties requestProperties,
|
||||
EventBus eventBus) {
|
||||
Log.debug("ReplaceBatchDialog: " + trId + ", RequestProperties:"
|
||||
|
@ -86,6 +99,9 @@ public class ReplaceBatchDialog extends Window implements
|
|||
add(batchRepalcePanel);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void initWindow() {
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
|
@ -159,11 +175,18 @@ public class ReplaceBatchDialog extends Window implements
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void close() {
|
||||
hide();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param replaceBatchColumnSession
|
||||
*/
|
||||
protected void startBatchReplace(
|
||||
ReplaceBatchColumnSession replaceBatchColumnSession) {
|
||||
if (conditionCode == null) {
|
||||
|
@ -173,7 +196,7 @@ public class ReplaceBatchDialog extends Window implements
|
|||
case AllowedColumnType:
|
||||
break;
|
||||
case AmbiguousValueOnExternalReference:
|
||||
callChangeColumnType(replaceBatchColumnSession);
|
||||
callResumeOnChangeColumnType(replaceBatchColumnSession);
|
||||
break;
|
||||
case CastValidation:
|
||||
break;
|
||||
|
@ -212,6 +235,10 @@ public class ReplaceBatchDialog extends Window implements
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param replaceBatchColumnSession
|
||||
*/
|
||||
protected void callStartReplaceBatchColumn(
|
||||
ReplaceBatchColumnSession replaceBatchColumnSession) {
|
||||
TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn(
|
||||
|
@ -240,6 +267,9 @@ public class ReplaceBatchDialog extends Window implements
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void callReplaceBatchColumnProgressDialog() {
|
||||
ReplaceBatchColumnProgressDialog dialog = new ReplaceBatchColumnProgressDialog(
|
||||
eventBus);
|
||||
|
@ -328,6 +358,9 @@ public class ReplaceBatchDialog extends Window implements
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void startTaskResume() {
|
||||
TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
|
||||
taskId);
|
||||
|
@ -358,9 +391,13 @@ public class ReplaceBatchDialog extends Window implements
|
|||
});
|
||||
}
|
||||
|
||||
protected void startTaskResume(ArrayList<ColumnMappingData> mapping) {
|
||||
/**
|
||||
*
|
||||
* @param mapping
|
||||
*/
|
||||
protected void startTaskResume(ArrayList<ColumnMappingData> mapping, ColumnData column) {
|
||||
TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
|
||||
taskId, mapping);
|
||||
taskId, mapping, column, invocationS);
|
||||
TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession,
|
||||
new AsyncCallback<Void>() {
|
||||
|
||||
|
@ -389,6 +426,9 @@ public class ReplaceBatchDialog extends Window implements
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void callForTaskResume() {
|
||||
TaskResumeProgressDialog dialog = new TaskResumeProgressDialog(eventBus);
|
||||
dialog.addResumeDialogListener(this);
|
||||
|
@ -423,20 +463,15 @@ public class ReplaceBatchDialog extends Window implements
|
|||
|
||||
}
|
||||
|
||||
private void callChangeColumnType(
|
||||
/**
|
||||
*
|
||||
* @param replaceBatchColumnSession
|
||||
*/
|
||||
private void callResumeOnChangeColumnType(
|
||||
ReplaceBatchColumnSession replaceBatchColumnSession) {
|
||||
Log.debug("ReplaceBatchColumnSession: "+replaceBatchColumnSession.toString());
|
||||
|
||||
/*TODO: Remove this lines
|
||||
|
||||
ColumnData col = replaceBatchColumnSession.getColumnData();
|
||||
ColumnTypeCode colTypeCode = ColumnTypeMap.getColumnTypeCode(col
|
||||
.getTypeCode());
|
||||
ColumnDataType colDataType = ColumnTypeMap.getColumnDataType(col
|
||||
.getDataTypeName());
|
||||
ColumnData codelistColumnReference = replaceBatchColumnSession
|
||||
.getConnection();
|
||||
*/
|
||||
ColumnData col=replaceBatchColumnSession.getColumnData();
|
||||
|
||||
ArrayList<ReplaceEntry> replaceEntryList = replaceBatchColumnSession
|
||||
.getReplaceEntryList();
|
||||
|
@ -451,44 +486,13 @@ public class ReplaceBatchDialog extends Window implements
|
|||
mapping.add(columnMappingData);
|
||||
}
|
||||
|
||||
startTaskResume(mapping);
|
||||
|
||||
/*TODO: Remove this lines
|
||||
ColumnMappingList columnMappingList = new ColumnMappingList("1", "map",
|
||||
mapping);
|
||||
|
||||
ChangeColumnTypeSession changeColumnTypeSession = new ChangeColumnTypeSession(
|
||||
col, colTypeCode, colDataType, ColumnTypeCode.DIMENSION,
|
||||
ColumnDataType.Integer, codelistColumnReference,
|
||||
columnMappingList);
|
||||
|
||||
Log.debug("ChangeColumnTypeSession: "+changeColumnTypeSession.toString());
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startChangeColumnType(
|
||||
changeColumnTypeSession, new AsyncCallback<Void>() {
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.debug("Change Column Type Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3
|
||||
.alert("Change Column Type Error ",
|
||||
"Error in invocation of change column type operation!");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSuccess(Void result) {
|
||||
callChangeColumnTypeProgressDialog();
|
||||
startTaskResume(mapping, col);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
protected void callChangeColumnTypeProgressDialog() {
|
||||
ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog(
|
||||
eventBus);
|
||||
|
|
Loading…
Reference in New Issue