Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@95802 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6321051e95
commit
342f1b3178
|
@ -127,6 +127,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
|
import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareInfo;
|
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareInfo;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.task.JobS;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.JobS;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskS;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskS;
|
||||||
|
@ -194,7 +195,6 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi" <a
|
* @author "Giancarlo Panichi" <a
|
||||||
|
@ -420,7 +420,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
|
||||||
TabResource currentTR = SessionUtil.getTabResource(session);
|
TabResource currentTR = SessionUtil.getTabResource(session);
|
||||||
if (currentTR == null) {
|
if (currentTR == null) {
|
||||||
logger.error("CURRENT_TABULAR_RESOURCE is null");
|
logger.error("CURRENT_TABULAR_RESOURCE is null");
|
||||||
|
@ -460,9 +459,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -543,7 +542,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername()));
|
aslSession.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
@ -574,9 +572,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -698,9 +696,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -816,9 +814,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -979,7 +977,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug("Validation Column: " + columns.size());
|
logger.debug("Validation Column: " + columns.size());
|
||||||
return columns;
|
return columns;
|
||||||
|
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
@ -1051,9 +1048,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1113,9 +1110,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
}
|
}
|
||||||
if (column.contains(ViewColumnMetadata.class)) {
|
if (column.contains(ViewColumnMetadata.class)) {
|
||||||
|
@ -1150,7 +1147,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug("getLastTable: " + tData);
|
logger.debug("getLastTable: " + tData);
|
||||||
return tData;
|
return tData;
|
||||||
|
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
@ -1219,9 +1215,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1282,9 +1278,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData=new RelationshipData(
|
RelationshipData relData = new RelationshipData(rel
|
||||||
rel.getTargetTableId().getValue(),
|
.getTargetTableId().getValue(), rel
|
||||||
rel.getTargetColumnId().getValue());
|
.getTargetColumnId().getValue());
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1435,7 +1431,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
// logger.debug("TabResource: "+t);
|
// logger.debug("TabResource: "+t);
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error("Error retrieving tabular resources metadata in retrieveTRMetadataFromService(): "
|
logger.error("Error retrieving tabular resources metadata in retrieveTRMetadataFromService(): "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
|
@ -2179,11 +2174,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
aslSession.getUsername()));
|
aslSession.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
|
||||||
// Import SDMX Codelist takes id 200
|
// Import SDMX Codelist takes id 200
|
||||||
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap
|
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap
|
||||||
.map(OperationsId.SDMXCodelistImport.toString(),
|
.map(OperationsId.SDMXCodelistImport.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
TabResource sdmxImportTabResource = sdmxImportSession
|
TabResource sdmxImportTabResource = sdmxImportSession
|
||||||
.getTabResource();
|
.getTabResource();
|
||||||
|
@ -2657,7 +2650,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
"Tabular Data Service error loading file on storage");
|
"Tabular Data Service error loading file on storage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> parameterInstance = csvImportFileParameter(
|
Map<String, Object> parameterInstance = csvImportFileParameter(
|
||||||
fileUrlOnStorage, fileUploadSession, csvImportSession);
|
fileUrlOnStorage, fileUploadSession, csvImportSession);
|
||||||
|
|
||||||
|
@ -2667,7 +2659,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.getUsername()));
|
.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
|
||||||
// Import CSV file
|
// Import CSV file
|
||||||
|
|
||||||
OperationDefinition importCSVFileOperation = OperationDefinitionMap
|
OperationDefinition importCSVFileOperation = OperationDefinitionMap
|
||||||
|
@ -3067,8 +3058,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
ArrayList<Validations> vList = new ArrayList<Validations>();
|
ArrayList<Validations> vList = new ArrayList<Validations>();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Validation v : vals) {
|
for (Validation v : vals) {
|
||||||
valid = new Validations(String.valueOf(i), v.getDescription(),
|
valid = new Validations(String.valueOf(i),
|
||||||
v.isValid());
|
v.getDescription(), v.isValid());
|
||||||
vList.add(valid);
|
vList.add(valid);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -3517,7 +3508,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.getUsername()));
|
.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
|
||||||
// Export CSV file
|
// Export CSV file
|
||||||
OperationDefinition exportCSVFileOperation = OperationDefinitionMap
|
OperationDefinition exportCSVFileOperation = OperationDefinitionMap
|
||||||
.map(OperationsId.CSVExport.toString(), service);
|
.map(OperationsId.CSVExport.toString(), service);
|
||||||
|
@ -3717,7 +3707,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
OperationExecution invocation = null;
|
OperationExecution invocation = null;
|
||||||
|
|
||||||
|
|
||||||
logger.debug(changeColumnTypeSession.toString());
|
logger.debug(changeColumnTypeSession.toString());
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
@ -3727,16 +3716,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ANNOTATION:
|
case ANNOTATION:
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ChangeToAnnotationColumn.toString(),
|
OperationsId.ChangeToAnnotationColumn.toString(), service);
|
||||||
service);
|
|
||||||
invocation = new OperationExecution(changeColumnTypeSession
|
invocation = new OperationExecution(changeColumnTypeSession
|
||||||
.getColumnData().getColumnId(),
|
.getColumnData().getColumnId(),
|
||||||
operationDefinition.getOperationId(), map);
|
operationDefinition.getOperationId(), map);
|
||||||
break;
|
break;
|
||||||
case ATTRIBUTE:
|
case ATTRIBUTE:
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ChangeToAttributeColumn.toString(),
|
OperationsId.ChangeToAttributeColumn.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_TARGET_DATA_TYPE, ColumnDataTypeMap
|
map.put(Constants.PARAMETER_TARGET_DATA_TYPE, ColumnDataTypeMap
|
||||||
.map(changeColumnTypeSession.getColumnDataTypeTarget()));
|
.map(changeColumnTypeSession.getColumnDataTypeTarget()));
|
||||||
|
@ -3753,8 +3740,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
break;
|
break;
|
||||||
case CODEDESCRIPTION:
|
case CODEDESCRIPTION:
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ChangeToCodeDescription.toString(),
|
OperationsId.ChangeToCodeDescription.toString(), service);
|
||||||
service);
|
|
||||||
invocation = new OperationExecution(changeColumnTypeSession
|
invocation = new OperationExecution(changeColumnTypeSession
|
||||||
.getColumnData().getColumnId(),
|
.getColumnData().getColumnId(),
|
||||||
operationDefinition.getOperationId(), map);
|
operationDefinition.getOperationId(), map);
|
||||||
|
@ -3771,8 +3757,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
break;
|
break;
|
||||||
case DIMENSION:
|
case DIMENSION:
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ChangeToDimensionColumn.toString(),
|
OperationsId.ChangeToDimensionColumn.toString(), service);
|
||||||
service);
|
|
||||||
ColumnData col = changeColumnTypeSession
|
ColumnData col = changeColumnTypeSession
|
||||||
.getCodelistColumnReference();
|
.getCodelistColumnReference();
|
||||||
logger.debug("ReferenceColumn To Set: " + col);
|
logger.debug("ReferenceColumn To Set: " + col);
|
||||||
|
@ -3789,9 +3774,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
operationDefinition.getOperationId(), map);
|
operationDefinition.getOperationId(), map);
|
||||||
break;
|
break;
|
||||||
case MEASURE:
|
case MEASURE:
|
||||||
operationDefinition = OperationDefinitionMap
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
.map(OperationsId.ChangeToMeasureColumn.toString(),
|
OperationsId.ChangeToMeasureColumn.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_TARGET_DATA_TYPE, ColumnDataTypeMap
|
map.put(Constants.PARAMETER_TARGET_DATA_TYPE, ColumnDataTypeMap
|
||||||
.map(changeColumnTypeSession.getColumnDataTypeTarget()));
|
.map(changeColumnTypeSession.getColumnDataTypeTarget()));
|
||||||
|
@ -3838,8 +3822,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
if (replaceColumnSession.isReplaceDimension()) {
|
if (replaceColumnSession.isReplaceDimension()) {
|
||||||
logger.debug("Is a Replace of view column");
|
logger.debug("Is a Replace of view column");
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ReplaceColumnByExpression.toString(),
|
OperationsId.ReplaceColumnByExpression.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
Expression condition = ExpressionGenerator
|
Expression condition = ExpressionGenerator
|
||||||
.genReplaceValueParameterCondition(replaceColumnSession);
|
.genReplaceValueParameterCondition(replaceColumnSession);
|
||||||
|
@ -3860,8 +3843,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug("Is a Replace of basic column");
|
logger.debug("Is a Replace of basic column");
|
||||||
|
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ReplaceColumnByExpression.toString(),
|
OperationsId.ReplaceColumnByExpression.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
Expression condition = ExpressionGenerator
|
Expression condition = ExpressionGenerator
|
||||||
.genReplaceValueParameterCondition(replaceColumnSession);
|
.genReplaceValueParameterCondition(replaceColumnSession);
|
||||||
|
@ -3881,7 +3863,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
return invocation;
|
return invocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve OperationExecution for change column type
|
* Retrieve OperationExecution for change column type
|
||||||
*
|
*
|
||||||
|
@ -3890,8 +3871,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
*/
|
*/
|
||||||
// TODO Check this operation
|
// TODO Check this operation
|
||||||
protected OperationExecution retrieveOperationExecution(
|
protected OperationExecution retrieveOperationExecution(
|
||||||
TabularDataService service,
|
TabularDataService service, EditRowSession editRowSession)
|
||||||
EditRowSession editRowSession)
|
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
|
|
||||||
OperationExecution invocation = null;
|
OperationExecution invocation = null;
|
||||||
|
@ -3901,18 +3881,18 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
ValueMap valueMap = new ValueMap();
|
ValueMap valueMap = new ValueMap();
|
||||||
ArrayList<Map<String,Object>> compositeValue=valueMap.genValueMap(editRowSession);
|
ArrayList<Map<String, Object>> compositeValue = valueMap
|
||||||
|
.genValueMap(editRowSession);
|
||||||
|
|
||||||
if (editRowSession.isNewRow()) {
|
if (editRowSession.isNewRow()) {
|
||||||
logger.debug("Is a add row");
|
logger.debug("Is a add row");
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.AddRow.toString(),
|
OperationsId.AddRow.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_ADD_ROW_COMPOSITE,
|
map.put(Constants.PARAMETER_ADD_ROW_COMPOSITE, compositeValue);
|
||||||
compositeValue);
|
|
||||||
|
|
||||||
invocation = new OperationExecution(operationDefinition.getOperationId(), map);
|
invocation = new OperationExecution(
|
||||||
|
operationDefinition.getOperationId(), map);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Is a edit row");
|
logger.debug("Is a edit row");
|
||||||
|
@ -3921,16 +3901,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
OperationsId.ModifyTuplesValuesByExpression.toString(),
|
OperationsId.ModifyTuplesValuesByExpression.toString(),
|
||||||
service);
|
service);
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_ADD_ROW_COMPOSITE,
|
map.put(Constants.PARAMETER_ADD_ROW_COMPOSITE, compositeValue);
|
||||||
compositeValue);
|
|
||||||
|
|
||||||
invocation = new OperationExecution(operationDefinition.getOperationId(), map);
|
invocation = new OperationExecution(
|
||||||
|
operationDefinition.getOperationId(), map);
|
||||||
}
|
}
|
||||||
|
|
||||||
return invocation;
|
return invocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve OperationExecution for change column type
|
* Retrieve OperationExecution for change column type
|
||||||
*
|
*
|
||||||
|
@ -3947,7 +3926,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
OperationExecution invocation = null;
|
OperationExecution invocation = null;
|
||||||
|
|
||||||
|
|
||||||
logger.debug(replaceBatchColumnSession.toString());
|
logger.debug(replaceBatchColumnSession.toString());
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
@ -4068,8 +4046,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
switch (duplicatesSession.getDuplicateOp()) {
|
switch (duplicatesSession.getDuplicateOp()) {
|
||||||
case VALIDATE:
|
case VALIDATE:
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.DuplicateTupleValidation.toString(),
|
OperationsId.DuplicateTupleValidation.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_KEY, columnReferences);
|
map.put(Constants.PARAMETER_KEY, columnReferences);
|
||||||
|
|
||||||
|
@ -4078,9 +4055,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
operationDefinition = OperationDefinitionMap
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
.map(OperationsId.RemoveDuplicateTuples.toString(),
|
OperationsId.RemoveDuplicateTuples.toString(), service);
|
||||||
service);
|
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_KEY, columnReferences);
|
map.put(Constants.PARAMETER_KEY, columnReferences);
|
||||||
|
|
||||||
|
@ -4332,7 +4308,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
SessionUtil.setChangeColumnTypeTask(session, task);
|
SessionUtil.setChangeColumnTypeTask(session, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("ChangeColumnTypeMonitor(): " + changeColumnTypeMonitor);
|
logger.debug("ChangeColumnTypeMonitor(): "
|
||||||
|
+ changeColumnTypeMonitor);
|
||||||
return changeColumnTypeMonitor;
|
return changeColumnTypeMonitor;
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
|
@ -6265,7 +6242,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -6499,14 +6475,23 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
int i = 1;
|
int i = 1;
|
||||||
ArrayList<Validations> validations = new ArrayList<Validations>();
|
ArrayList<Validations> validations = new ArrayList<Validations>();
|
||||||
for (ValidationDescriptor val : job.getValidations()) {
|
for (ValidationDescriptor val : job.getValidations()) {
|
||||||
Validations validation = new Validations(String.valueOf(i),
|
Validations validation = new Validations(
|
||||||
val.getDescription(), val.isValid());
|
String.valueOf(i), val.getDescription(),
|
||||||
|
val.isValid());
|
||||||
validations.add(validation);
|
validations.add(validation);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
InvocationS invocationS=null;
|
||||||
|
if (job.getInvocation() != null) {
|
||||||
|
invocationS = new InvocationS(job.getInvocation()
|
||||||
|
.getColumnId(), job.getInvocation()
|
||||||
|
.getIdentifier(), job.getInvocation()
|
||||||
|
.getOperationId(), job.getInvocation()
|
||||||
|
.getParameters());
|
||||||
|
}
|
||||||
JobS jobS = new JobS(String.valueOf(j), job.getProgress(),
|
JobS jobS = new JobS(String.valueOf(j), job.getProgress(),
|
||||||
job.getHumaReadableStatus(), job.getDescription(),
|
job.getHumaReadableStatus(), job.getDescription(),
|
||||||
validations);
|
validations,invocationS);
|
||||||
jobSList.add(jobS);
|
jobSList.add(jobS);
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
|
@ -6536,7 +6521,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startEditRow(EditRowSession editRowSession)
|
public void startEditRow(EditRowSession editRowSession)
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
|
@ -6557,13 +6541,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
Long id;
|
Long id;
|
||||||
if (editRowSession.getTrId().isViewTable()) {
|
if (editRowSession.getTrId().isViewTable()) {
|
||||||
id=Long.valueOf(editRowSession.getTrId().getReferenceTargetTableId());
|
id = Long.valueOf(editRowSession.getTrId()
|
||||||
|
.getReferenceTargetTableId());
|
||||||
} else {
|
} else {
|
||||||
id = Long.valueOf(editRowSession.getTrId().getId());
|
id = Long.valueOf(editRowSession.getTrId().getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
TabularResourceId serviceTR = new TabularResourceId(
|
TabularResourceId serviceTR = new TabularResourceId(id);
|
||||||
id);
|
|
||||||
logger.debug("OperationInvocation: \n" + invocation.toString());
|
logger.debug("OperationInvocation: \n" + invocation.toString());
|
||||||
Task trTask = service.execute(invocation, serviceTR);
|
Task trTask = service.execute(invocation, serviceTR);
|
||||||
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
||||||
|
@ -6574,8 +6558,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException("Error in operation: "
|
||||||
"Error in operation: "
|
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6673,15 +6656,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.debug("Error in EditRowMonitor: "
|
logger.debug("Error in EditRowMonitor: " + e.getLocalizedMessage());
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new TDGWTServiceException("Error: "
|
throw new TDGWTServiceException("Error: " + e.getLocalizedMessage());
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package org.gcube.portlets.user.td.gwtservice.shared.task;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi"
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class InvocationS implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7112348181058962879L;
|
||||||
|
|
||||||
|
protected String columnId;
|
||||||
|
protected long operationId;
|
||||||
|
protected Long identifier;
|
||||||
|
protected Map<String, Object> parameters;
|
||||||
|
|
||||||
|
public InvocationS(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public InvocationS(String columnId,long operationId,Long identifier,Map<String, Object> parameters){
|
||||||
|
this.columnId=columnId;
|
||||||
|
this.operationId=operationId;
|
||||||
|
this.identifier=identifier;
|
||||||
|
this.parameters=parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getColumnId() {
|
||||||
|
return columnId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnId(String columnId) {
|
||||||
|
this.columnId = columnId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getOperationId() {
|
||||||
|
return operationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperationId(long operationId) {
|
||||||
|
this.operationId = operationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIdentifier() {
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentifier(Long identifier) {
|
||||||
|
this.identifier = identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getParameters() {
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(Map<String, Object> parameters) {
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "InvocationS [columnId=" + columnId + ", operationId="
|
||||||
|
+ operationId + ", identifier=" + identifier + ", parameters="
|
||||||
|
+ parameters + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -19,18 +19,20 @@ public class JobS implements Serializable {
|
||||||
protected String humaReadableStatus;
|
protected String humaReadableStatus;
|
||||||
protected String description;
|
protected String description;
|
||||||
protected ArrayList<Validations> validations;
|
protected ArrayList<Validations> validations;
|
||||||
|
protected InvocationS invocation;
|
||||||
|
|
||||||
public JobS() {
|
public JobS() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JobS(String id, float progress, String humaReadableStatus, String description,
|
public JobS(String id, float progress, String humaReadableStatus, String description,
|
||||||
ArrayList<Validations> validations) {
|
ArrayList<Validations> validations, InvocationS invocation) {
|
||||||
this.id=id;
|
this.id=id;
|
||||||
this.progress=progress;
|
this.progress=progress;
|
||||||
this.humaReadableStatus=humaReadableStatus;
|
this.humaReadableStatus=humaReadableStatus;
|
||||||
this.description=description;
|
this.description=description;
|
||||||
this.validations=validations;
|
this.validations=validations;
|
||||||
|
this.invocation=invocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
Loading…
Reference in New Issue