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:
Giancarlo Panichi 2014-03-13 18:46:48 +00:00
parent f691461f55
commit f91ef9aad6
1 changed files with 23 additions and 20 deletions

View File

@ -2834,15 +2834,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug(labelColumnSession.toString());
OperationDefinition operationDefinition;
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);
operationDefinition = OperationDefinitionMap.map(
OperationsId.ColumnNameAdd.toString(), capabilities);
invocation = new OperationExecution(labelColumnSession.getColumnData()
.getColumnId(), operationDefinition.getOperationId(), map);
@ -3206,11 +3206,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
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) {
@ -3952,25 +3952,28 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TabularResourceId tabularResourceId = new TabularResourceId(
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) {
logger.debug("Error in setTabResourceInformation: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw new TDGWTServiceException("Error in setTabResourceInformation: "
+ e.getLocalizedMessage());
throw new TDGWTServiceException(
"Error in setTabResourceInformation: "
+ e.getLocalizedMessage());
}
}
}