diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index e2c240a..c61c82e 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -49,6 +49,7 @@ import org.gcube.data.analysis.tabulardata.model.column.type.CodeNameColumnType; import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType; import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType; import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata; +import org.gcube.data.analysis.tabulardata.model.metadata.common.ImmutableLocalizedText; import org.gcube.data.analysis.tabulardata.model.metadata.common.LocalizedText; import org.gcube.data.analysis.tabulardata.model.metadata.common.NamesMetadata; import org.gcube.data.analysis.tabulardata.model.metadata.table.ExportMetadata; @@ -2833,10 +2834,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug(labelColumnSession.toString()); OperationDefinition operationDefinition; Map map = new HashMap(); - + + ImmutableLocalizedText localizedText=new ImmutableLocalizedText(labelColumnSession.getLabel()); + + map.put(Constants.NAME_PARAMETER_ID, localizedText); + operationDefinition = OperationDefinitionMap.map( - OperationsId.ChangeLabel.toString(), capabilities); - + OperationsId.ColumnNameAdd.toString(), capabilities); + + invocation = new OperationExecution(labelColumnSession.getColumnData() .getColumnId(), operationDefinition.getOperationId(), map); @@ -3199,11 +3205,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements HttpSession session = this.getThreadLocalRequest().getSession(); SessionUtil.setLabelColumnSession(session, labelColumnSession); ASLSession aslSession = SessionUtil.getAslSession(session); - + logger.debug(labelColumnSession.toString()); + AuthorizationProvider.instance.set(new AuthorizationToken( aslSession.getUsername())); TabularDataService service = TabularDataServiceFactory.getService(); - + OperationExecution invocation = retrieveOperationExecution(service, labelColumnSession); if (invocation == null) { @@ -3217,7 +3224,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug("OperationInvocation: \n" + invocation.toString()); Task trTask = service.execute(invocation, serviceTR); logger.debug("Start Task on service: TaskId " + trTask.getId()); - SessionUtil.setDeleteColumnTask(session, trTask); + SessionUtil.setLabelColumnTask(session, trTask); return; } catch (Exception e) { e.printStackTrace(); @@ -3935,6 +3942,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void setTabResourceInformation(TabResource tabResource) throws TDGWTServiceException { + /* + TabularResourceId tabularResourceId=new TabularResourceId(new Long(labelColumnSession.getColumnData().getTrId().getId())); + + TabularResource tr=service.getTabularResource(tabularResourceId); + org.gcube.data.analysis.tabulardata.service.tabular.metadata.NameMetadata name=tr.getMetadata(org.gcube.data.analysis.tabulardata.service.tabular.metadata.NameMetadata.class); + name.*/ // TODO Auto-generated method stub } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/OperationsId.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/OperationsId.java index e7177d2..191b96d 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/OperationsId.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/OperationsId.java @@ -58,7 +58,7 @@ public enum OperationsId { ChangeTableType("1002"), CreateDatasetView("1003"), RemoveColumn("1004"), - ChangeLabel("1005"), + ColumnNameAdd("710044479"), AddLabel("1006"), RemoveLabel("1007"), ChangeToAnnotationColumn("2000"), diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java index 26c687f..f1129cc 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java @@ -29,7 +29,8 @@ public class Constants { public static final String PARAMETER_DATA_TYPE="dataType"; public static final String PARAMETER_TARGET_DATA_TYPE="targetDataType"; - + + public static final String NAME_PARAMETER_ID="NAME_PARAMETER_ID"; public static final String PARAMETER_KEY="key"; public static final String PARAMETER_REFERENCE_COLUMN="refColumn"; public static final String PARAMETER_PERIOD_FORMAT="periodFormat";