Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111867 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a516dff10c
commit
94c414838f
|
@ -34,13 +34,14 @@ public class OpExecution4GeospatialCreateCoordinates extends OpExecutionBuilder
|
||||||
private TabularDataService service;
|
private TabularDataService service;
|
||||||
private GeospatialCreateCoordinatesSession geospatialCreateCoordinatesSession;
|
private GeospatialCreateCoordinatesSession geospatialCreateCoordinatesSession;
|
||||||
private ASLSession aslSession;
|
private ASLSession aslSession;
|
||||||
|
|
||||||
public OpExecution4GeospatialCreateCoordinates(
|
public OpExecution4GeospatialCreateCoordinates(
|
||||||
ASLSession aslSession, TabularDataService service,
|
ASLSession aslSession,
|
||||||
|
TabularDataService service,
|
||||||
GeospatialCreateCoordinatesSession geospatialCreateCoordinatesSession) {
|
GeospatialCreateCoordinatesSession geospatialCreateCoordinatesSession) {
|
||||||
this.service = service;
|
this.service = service;
|
||||||
this.geospatialCreateCoordinatesSession = geospatialCreateCoordinatesSession;
|
this.geospatialCreateCoordinatesSession = geospatialCreateCoordinatesSession;
|
||||||
this.aslSession=aslSession;
|
this.aslSession = aslSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -51,52 +52,60 @@ public class OpExecution4GeospatialCreateCoordinates extends OpExecutionBuilder
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
TRId trId = geospatialCreateCoordinatesSession.getTrId();
|
TRId trId = geospatialCreateCoordinatesSession.getTrId();
|
||||||
logger.debug("trID: " + trId);
|
logger.debug("trID: " + trId);
|
||||||
if(trId==null){
|
if (trId == null) {
|
||||||
logger.error("Error Creating Geospatial Coordinates: trId is null");
|
logger.error("Error Creating Geospatial Coordinates: trId is null");
|
||||||
throw new TDGWTServiceException("No tabular resource set");
|
throw new TDGWTServiceException("No tabular resource set");
|
||||||
}
|
}
|
||||||
|
|
||||||
long tabId;
|
long tabId;
|
||||||
if(trId.isViewTable()){
|
if (trId.isViewTable()) {
|
||||||
tabId = new Long(trId.getReferenceTargetTableId());
|
tabId = new Long(trId.getReferenceTargetTableId());
|
||||||
} else {
|
} else {
|
||||||
tabId = new Long(trId.getTableId());
|
tabId = new Long(trId.getTableId());
|
||||||
|
|
||||||
}
|
}
|
||||||
TableId tId = new TableId(tabId);
|
TableId tId = new TableId(tabId);
|
||||||
|
|
||||||
ColumnData latitudeColumn=geospatialCreateCoordinatesSession.getLatitude();
|
ColumnData latitudeColumn = geospatialCreateCoordinatesSession
|
||||||
logger.debug("Latitude Column: "+latitudeColumn);
|
.getLatitude();
|
||||||
if(latitudeColumn==null){
|
logger.debug("Latitude Column: " + latitudeColumn);
|
||||||
|
if (latitudeColumn == null) {
|
||||||
logger.error("Error Creating Geospatial Coordinates: Latitude Column is null");
|
logger.error("Error Creating Geospatial Coordinates: Latitude Column is null");
|
||||||
throw new TDGWTServiceException("No latitude column set");
|
throw new TDGWTServiceException("No latitude column set");
|
||||||
}
|
}
|
||||||
ColumnLocalId latitudeId = new ColumnLocalId(latitudeColumn.getColumnId());
|
ColumnLocalId latitudeId = new ColumnLocalId(
|
||||||
ColumnReference latitudeColumnReference = new ColumnReference(tId, latitudeId);
|
latitudeColumn.getColumnId());
|
||||||
|
ColumnReference latitudeColumnReference = new ColumnReference(tId,
|
||||||
ColumnData longitudeColumn=geospatialCreateCoordinatesSession.getLatitude();
|
latitudeId);
|
||||||
logger.debug("Longitude Column: "+longitudeColumn);
|
|
||||||
if(longitudeColumn==null){
|
ColumnData longitudeColumn = geospatialCreateCoordinatesSession
|
||||||
|
.getLatitude();
|
||||||
|
logger.debug("Longitude Column: " + longitudeColumn);
|
||||||
|
if (longitudeColumn == null) {
|
||||||
logger.error("Error Creating Geospatial Coordinates: Longitude Column is null");
|
logger.error("Error Creating Geospatial Coordinates: Longitude Column is null");
|
||||||
throw new TDGWTServiceException("No longitude column set");
|
throw new TDGWTServiceException("No longitude column set");
|
||||||
}
|
}
|
||||||
ColumnLocalId longitudeId = new ColumnLocalId(longitudeColumn.getColumnId());
|
ColumnLocalId longitudeId = new ColumnLocalId(
|
||||||
ColumnReference longitudeColumnReference = new ColumnReference(tId, longitudeId);
|
longitudeColumn.getColumnId());
|
||||||
|
ColumnReference longitudeColumnReference = new ColumnReference(tId,
|
||||||
|
longitudeId);
|
||||||
|
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.CoordinatesEnhancement.toString(), service);
|
OperationsId.EnhanceLatLong.toString(), service);
|
||||||
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LATITUDE, latitudeColumnReference);
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LATITUDE,
|
||||||
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LONGITUDE, longitudeColumnReference);
|
latitudeColumnReference);
|
||||||
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE, geospatialCreateCoordinatesSession.getType().getId());
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LONGITUDE,
|
||||||
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_USER, aslSession.getUsername());
|
longitudeColumnReference);
|
||||||
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE,
|
||||||
|
geospatialCreateCoordinatesSession.getType().getId());
|
||||||
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_USER,
|
||||||
|
aslSession.getUsername());
|
||||||
|
|
||||||
invocation = new OperationExecution(
|
invocation = new OperationExecution(
|
||||||
operationDefinition.getOperationId(), map);
|
operationDefinition.getOperationId(), map);
|
||||||
|
|
||||||
|
|
||||||
operationExecutionSpec.setOp(invocation);
|
operationExecutionSpec.setOp(invocation);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue