Updated Task Resume added mapping

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@98639 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-15 11:05:14 +00:00
parent 90c724d858
commit 56c0ced40e
2 changed files with 77 additions and 13 deletions

View File

@ -5242,3 +5242,35 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
50% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 13.19 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -14,14 +14,11 @@ 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;
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceEntry;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
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;
@ -29,9 +26,6 @@ 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.RequestProperties;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeMap;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -265,7 +259,7 @@ public class ReplaceBatchDialog extends Window implements
hide();
} else {
if (conditionCode == null) {
StartTaskResume();
startTaskResume();
} else {
switch (conditionCode) {
case AllowedColumnType:
@ -293,7 +287,7 @@ public class ReplaceBatchDialog extends Window implements
case MaxOneCodenameForDataLocale:
break;
case MissingValueOnExternalReference:
StartTaskResume();
startTaskResume();
break;
case MustContainAtLeastOneDimension:
break;
@ -308,7 +302,7 @@ public class ReplaceBatchDialog extends Window implements
case ValidPeriodFormat:
break;
default:
StartTaskResume();
startTaskResume();
break;
}
@ -334,7 +328,7 @@ public class ReplaceBatchDialog extends Window implements
}
protected void StartTaskResume() {
protected void startTaskResume() {
TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
taskId);
TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession,
@ -363,6 +357,37 @@ public class ReplaceBatchDialog extends Window implements
});
}
protected void startTaskResume(ArrayList<ColumnMappingData> mapping) {
TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
taskId, mapping);
TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Task Resume failed:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error on task resume",
"Error on task resume (taskId=" + taskId
+ ")");
}
close();
}
public void onSuccess(Void v) {
Log.trace("Started task resume");
callForTaskResume();
}
});
}
protected void callForTaskResume() {
TaskResumeProgressDialog dialog = new TaskResumeProgressDialog(eventBus);
@ -402,6 +427,8 @@ public class ReplaceBatchDialog extends Window implements
ReplaceBatchColumnSession replaceBatchColumnSession) {
Log.debug("ReplaceBatchColumnSession: "+replaceBatchColumnSession.toString());
/*TODO: Remove this lines
ColumnData col = replaceBatchColumnSession.getColumnData();
ColumnTypeCode colTypeCode = ColumnTypeMap.getColumnTypeCode(col
.getTypeCode());
@ -409,7 +436,8 @@ public class ReplaceBatchDialog extends Window implements
.getDataTypeName());
ColumnData codelistColumnReference = replaceBatchColumnSession
.getConnection();
*/
ArrayList<ReplaceEntry> replaceEntryList = replaceBatchColumnSession
.getReplaceEntryList();
ArrayList<ColumnMappingData> mapping = new ArrayList<ColumnMappingData>();
@ -422,15 +450,18 @@ public class ReplaceBatchDialog extends Window implements
sourceArg, targetArg);
mapping.add(columnMappingData);
}
startTaskResume(mapping);
ColumnMappingList columnMappingList = new ColumnMappingList("1", "map",
/*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(
@ -454,6 +485,7 @@ public class ReplaceBatchDialog extends Window implements
}
});
*/
}