Added set TabularResource info
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93110 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f691461f55
commit
f91ef9aad6
|
@ -2834,15 +2834,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug(labelColumnSession.toString());
|
logger.debug(labelColumnSession.toString());
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
|
||||||
ImmutableLocalizedText localizedText=new ImmutableLocalizedText(labelColumnSession.getLabel());
|
ImmutableLocalizedText localizedText = new ImmutableLocalizedText(
|
||||||
|
labelColumnSession.getLabel());
|
||||||
|
|
||||||
map.put(Constants.NAME_PARAMETER_ID, localizedText);
|
map.put(Constants.NAME_PARAMETER_ID, localizedText);
|
||||||
|
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.ColumnNameAdd.toString(), capabilities);
|
OperationsId.ColumnNameAdd.toString(), capabilities);
|
||||||
|
|
||||||
|
|
||||||
invocation = new OperationExecution(labelColumnSession.getColumnData()
|
invocation = new OperationExecution(labelColumnSession.getColumnData()
|
||||||
.getColumnId(), operationDefinition.getOperationId(), map);
|
.getColumnId(), operationDefinition.getOperationId(), map);
|
||||||
|
|
||||||
|
@ -3206,11 +3206,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
SessionUtil.setLabelColumnSession(session, labelColumnSession);
|
SessionUtil.setLabelColumnSession(session, labelColumnSession);
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
logger.debug(labelColumnSession.toString());
|
logger.debug(labelColumnSession.toString());
|
||||||
|
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername()));
|
aslSession.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
OperationExecution invocation = retrieveOperationExecution(service,
|
OperationExecution invocation = retrieveOperationExecution(service,
|
||||||
labelColumnSession);
|
labelColumnSession);
|
||||||
if (invocation == null) {
|
if (invocation == null) {
|
||||||
|
@ -3952,25 +3952,28 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
TabularResourceId tabularResourceId = new TabularResourceId(
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
new Long(tabResource.getTrId().getId()));
|
new Long(tabResource.getTrId().getId()));
|
||||||
|
|
||||||
|
TabularResource tr = service.getTabularResource(tabularResourceId);
|
||||||
|
|
||||||
|
NameMetadata name = new NameMetadata(tabResource.getName());;
|
||||||
|
tr.setMetadata(name);
|
||||||
|
DescriptionMetadata description = new DescriptionMetadata(tabResource.getDescription());
|
||||||
|
tr.setMetadata(description);
|
||||||
|
AgencyMetadata agency = new AgencyMetadata(tabResource.getAgency());
|
||||||
|
tr.setMetadata(agency);
|
||||||
|
RightsMetadata rights = new RightsMetadata(tabResource.getRight());
|
||||||
|
tr.setMetadata(rights);
|
||||||
|
|
||||||
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.setValue(tabResource.getName());
|
|
||||||
org.gcube.data.analysis.tabulardata.service.tabular.metadata.DescriptionMetadata description=tr.getMetadata(org.gcube.data.analysis.tabulardata.service.tabular.metadata.DescriptionMetadata.class);
|
|
||||||
description.setValue(tabResource.getDescription());
|
|
||||||
org.gcube.data.analysis.tabulardata.service.tabular.metadata.AgencyMetadata agency=tr.getMetadata(org.gcube.data.analysis.tabulardata.service.tabular.metadata.AgencyMetadata.class);
|
|
||||||
agency.setValue(tabResource.getAgency());
|
|
||||||
org.gcube.data.analysis.tabulardata.service.tabular.metadata.RightsMetadata rights=tr.getMetadata(org.gcube.data.analysis.tabulardata.service.tabular.metadata.RightsMetadata.class);
|
|
||||||
rights.setValue(tabResource.getRight());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug("Error in setTabResourceInformation: "
|
logger.debug("Error in setTabResourceInformation: "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new TDGWTServiceException("Error in setTabResourceInformation: "
|
throw new TDGWTServiceException(
|
||||||
+ e.getLocalizedMessage());
|
"Error in setTabResourceInformation: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue