Updated Mapping

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@98238 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-01 17:02:35 +00:00
parent b2606d9ed9
commit 544fe2371b
4 changed files with 43 additions and 6 deletions

View File

@ -96,8 +96,8 @@ public class SessionUtil {
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
session = SessionManager.getInstance().getASLSession(
httpSession.getId(), username);
session.setScope(scope);
*/
session.setScope(scope);*/
} else {
session = SessionManager.getInstance().getASLSession(
httpSession.getId(), username);

View File

@ -5,12 +5,16 @@ import java.util.Map;
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId;
import org.gcube.data.analysis.tabulardata.model.column.ColumnReference;
import org.gcube.data.analysis.tabulardata.model.table.TableId;
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
import org.gcube.portlets.user.td.gwtservice.shared.OperationsId;
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -48,7 +52,14 @@ public class OpExecution4CodelistMapping extends OpExecutionBuilder {
operationDefinition = OperationDefinitionMap.map(
OperationsId.CodelistMappingImport.toString(), service);
map.put(Constants.PARAMETER_URL, importUrl);
ColumnData columnData=codelistMappingSession.getConnectedColumn();
TableId tableId=new TableId(new Long(columnData.getTrId().getTableId()));
ColumnLocalId columnId=new ColumnLocalId(columnData.getColumnId());
ColumnReference colRef=new ColumnReference(tableId, columnId);
map.put(Constants.PARAMETER_URL, colRef);
invocation = new OperationExecution(
operationDefinition.getOperationId(), map);

View File

@ -45,6 +45,8 @@ public class Constants {
public static final String PARAMETER_ADD_ROW_COMPOSITE_TOSETVALUE = "toSetValue";
public static final String PARAMETER_ADD_ROW_COMPOSITE = "mapping";
public static final String PARAMETER_IMPORT_CODELIST_MAPPING_OLDCODES = "old_codes";
public static final String PARAMETER_EXTRACT_CODELIST_SOURCE = "source";
public static final String PARAMETER_EXTRACT_CODELIST_TARGET_CODE_COLUMN = "target_code_column";
public static final String PARAMETER_EXTRACT_CODELIST_COLUMN_DEFINITION = "column_definition";

View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import org.gcube.portlets.user.td.gwtservice.shared.resource.ResourceTD;
import org.gcube.portlets.user.td.gwtservice.shared.source.Source;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
public class CodelistMappingSession implements Serializable {
@ -16,7 +18,9 @@ public class CodelistMappingSession implements Serializable {
protected String url;
protected String localFileName;
protected String itemId;
protected TabResource connectedTR;
protected ColumnData connectedColumn;
public TRId getTrId() {
return trId;
}
@ -65,11 +69,31 @@ public class CodelistMappingSession implements Serializable {
this.resourceTD = resourceTD;
}
public TabResource getConnectedTR() {
return connectedTR;
}
public void setConnectedTR(TabResource connectedTR) {
this.connectedTR = connectedTR;
}
public ColumnData getConnectedColumn() {
return connectedColumn;
}
public void setConnectedColumn(ColumnData connectedColumn) {
this.connectedColumn = connectedColumn;
}
@Override
public String toString() {
return "CodelistMappingSession [trId=" + trId + ", source=" + source
+ ", url=" + url + ", localFileName=" + localFileName
+ ", itemId=" + itemId + "]";
+ ", resourceTD=" + resourceTD + ", url=" + url
+ ", localFileName=" + localFileName + ", itemId=" + itemId
+ ", connectedTR=" + connectedTR + ", connectedColumn="
+ connectedColumn + "]";
}
}