81: TDM - Allow the creation and use of expressions on multi column in TDM portlet
Task-Url: https://support.d4science.org/issues/81 Updated service interface git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@115279 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
46a418dfe7
commit
a78876c569
1
pom.xml
1
pom.xml
|
@ -130,6 +130,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>home-library</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
@ -13,10 +11,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.tika.config.TikaConfig;
|
||||
import org.apache.tika.metadata.Metadata;
|
||||
import org.apache.tika.mime.MediaType;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.storage.FilesStorage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -34,7 +28,7 @@ public class RetrieveFileAndDiscoverMimeTypeServlet extends HttpServlet {
|
|||
.getLogger(RetrieveFileAndDiscoverMimeTypeServlet.class);
|
||||
|
||||
private static final String ATTRIBUTE_STORAGE_URI = "storageURI";
|
||||
private static final int BUFSIZE = 4096;
|
||||
//private static final int BUFSIZE = 4096;
|
||||
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
|
||||
throws ServletException, IOException {
|
||||
|
@ -78,9 +72,12 @@ public class RetrieveFileAndDiscoverMimeTypeServlet extends HttpServlet {
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
InputStream inMime = storage.retrieveImputStream(uri);
|
||||
|
||||
|
||||
TikaConfig tika = new TikaConfig();
|
||||
|
||||
|
||||
|
@ -120,6 +117,7 @@ public class RetrieveFileAndDiscoverMimeTypeServlet extends HttpServlet {
|
|||
in.close();
|
||||
out.close();
|
||||
|
||||
*/
|
||||
logger.trace("Response in "
|
||||
+ (System.currentTimeMillis() - startTime));
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.file.CodelistMappingFileUploadSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
|
@ -92,9 +91,9 @@ public class SessionUtil {
|
|||
ASLSession session;
|
||||
if (username == null) {
|
||||
logger.warn("no user found in session, use test user");
|
||||
/*throw new TDGWTSessionExpiredException("Session Expired!");*/
|
||||
|
||||
throw new TDGWTSessionExpiredException("Session Expired!");
|
||||
|
||||
/*
|
||||
// Remove comment for Test
|
||||
username = Constants.DEFAULT_USER;
|
||||
String scope = Constants.DEFAULT_SCOPE;
|
||||
|
@ -103,7 +102,7 @@ public class SessionUtil {
|
|||
session = SessionManager.getInstance().getASLSession(
|
||||
httpSession.getId(), username);
|
||||
session.setScope(scope);
|
||||
|
||||
*/
|
||||
} else {
|
||||
session = SessionManager.getInstance().getASLSession(
|
||||
httpSession.getId(), username);
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.td.gwtservice.server;
|
||||
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.ParseException;
|
||||
|
@ -35,10 +32,6 @@ import org.gcube.common.homelibrary.home.HomeManagerFactory;
|
|||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint.Profile;
|
||||
import org.gcube.common.resources.gcore.utils.Group;
|
||||
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationProvider;
|
||||
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationToken;
|
||||
import org.gcube.data.analysis.tabulardata.commons.utils.Licence;
|
||||
|
@ -47,7 +40,6 @@ import org.gcube.data.analysis.tabulardata.commons.webservice.exception.Template
|
|||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType;
|
||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TaskStatus;
|
||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TemplateDescription;
|
||||
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.commons.webservice.types.resources.ResourceDescriptor;
|
||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.tasks.ValidationDescriptor;
|
||||
|
@ -144,6 +136,7 @@ import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Repl
|
|||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4ReplaceByExternal;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4ReplaceColumn;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4ReplaceColumnByExpression;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXCodelistExport;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXCodelistImport;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SplitColumn;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4StatisticalOperation;
|
||||
|
@ -157,7 +150,6 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.ColumnDataTypeMap;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.trservice.ExtractReferences;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.JobClassifierMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.LicenceMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.PeriodTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.QueryService;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TDTypeValueMap;
|
||||
|
@ -290,7 +282,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSessi
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.mime.MimeTypeSupport;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.OperationsId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.UIOperationsId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
|
@ -300,8 +291,6 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataT
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.RelationshipData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ValueDataFormat;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.uriresolver.ApplicationType;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -2807,7 +2796,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -4009,7 +3997,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
throws TDGWTServiceException {
|
||||
logger.debug("StartCSVImport: " + csvImportSession);
|
||||
CSVFileUploadSession fileUploadSession = null;
|
||||
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
|
@ -4017,7 +4005,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.debug("Session:" + session.getId());
|
||||
|
||||
|
||||
fileUploadSession = SessionUtil.getCSVFileUploadSession(session);
|
||||
if (fileUploadSession == null) {
|
||||
throw new TDGWTServiceException(
|
||||
|
@ -4109,8 +4097,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
@ -4725,67 +4711,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param exportSession
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> sdmxExportParameter(
|
||||
SDMXExportSession exportSession) throws TDGWTServiceException {
|
||||
boolean internalRegistry = false;
|
||||
String destination = null;// Es:
|
||||
// http://pc-fortunati.isti.cnr.it:8080/FusionRegistry/ws/rest/
|
||||
|
||||
if (exportSession != null) {
|
||||
if (exportSession.getRegistryBaseUrl() != null
|
||||
&& !exportSession.getRegistryBaseUrl().isEmpty()) {
|
||||
destination = exportSession.getRegistryBaseUrl();
|
||||
} else {
|
||||
internalRegistry = true;
|
||||
}
|
||||
} else {
|
||||
internalRegistry = true;
|
||||
}
|
||||
|
||||
if (internalRegistry) {
|
||||
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq 'SDMX'")
|
||||
.addCondition(
|
||||
"$resource/Profile/Name/text() eq 'SDMXRegistry'");
|
||||
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
||||
List<ServiceEndpoint> listService = client.submit(query);
|
||||
if (listService.size() > 0) {
|
||||
ServiceEndpoint serviceEnd = listService.get(0);
|
||||
if (serviceEnd != null) {
|
||||
Profile prof = serviceEnd.profile();
|
||||
Group<AccessPoint> groupA = prof.accessPoints();
|
||||
for (AccessPoint acc : groupA) {
|
||||
if (acc.description().compareTo("REST Interface v2.1") == 0) {
|
||||
destination = acc.address();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
if (destination == null) {
|
||||
logger.debug("Destination: " + destination);
|
||||
throw new TDGWTServiceException("SDMX Service not discovered");
|
||||
}
|
||||
|
||||
Map<String, Object> parameterInstances = new HashMap<String, Object>();
|
||||
parameterInstances
|
||||
.put(Constants.PARAMETER_REGISTRYBASEURL, destination);
|
||||
parameterInstances.put(Constants.PARAMETER_AGENCY, "SDMX");
|
||||
parameterInstances.put(Constants.PARAMETER_ID, "NEW_CL_DIVISION");
|
||||
parameterInstances.put(Constants.PARAMETER_VERSION, "2.0");
|
||||
return parameterInstances;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param trId
|
||||
|
@ -4912,8 +4838,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
SessionUtil.setSDMXExportSession(session, exportSession);
|
||||
|
||||
Map<String, Object> parameterInstance = sdmxExportParameter(exportSession);
|
||||
|
||||
logger.debug("Tabular Data Service");
|
||||
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
|
@ -4929,14 +4853,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
checkTabularResourceIsFlow(tabularResource);
|
||||
checkTabularResourceLocked(tabularResource);
|
||||
|
||||
///
|
||||
OpExecution4SDMXCodelistExport opEx = new OpExecution4SDMXCodelistExport(
|
||||
service, exportSession);
|
||||
OpExecutionDirector director = new OpExecutionDirector();
|
||||
director.setOperationExecutionBuilder(opEx);
|
||||
director.constructOperationExecution();
|
||||
OperationExecution invocation = director.getOperationExecution();
|
||||
|
||||
// Export SDMX Codelist
|
||||
OperationDefinition exportSDMXOperation = OperationDefinitionMap
|
||||
.map(OperationsId.SDMXCodelistExport.toString(), service);
|
||||
|
||||
OperationExecution invocation = new OperationExecution(
|
||||
exportSDMXOperation.getOperationId(), parameterInstance);
|
||||
|
||||
if (invocation == null) {
|
||||
throw new TDGWTServiceException(
|
||||
"Error in SDMXExport: Operation not supported for now!");
|
||||
}
|
||||
logger.debug("OperationInvocation: \n" + invocation.toString());
|
||||
|
||||
Task trTask = service.execute(invocation, new TabularResourceId(
|
||||
|
@ -4956,7 +4885,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGWTServiceException("Error in CSVExport: "
|
||||
throw new TDGWTServiceException("Error in SDMXExport: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -7931,8 +7860,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
if (codelistMappingSession.getSource().getId()
|
||||
.compareTo(SourceType.URL.toString()) == 0) {
|
||||
FilesStorage filesStorage = new FilesStorage();
|
||||
storageId = filesStorage
|
||||
.storageCodelistMappingTempFile(user, codelistMappingSession.getUrl());
|
||||
storageId = filesStorage.storageCodelistMappingTempFile(user,
|
||||
codelistMappingSession.getUrl());
|
||||
} else {
|
||||
CodelistMappingFileUploadSession codelistMappingFileUploadSession = SessionUtil
|
||||
.getCodelistMappingFileUploadSession(session);
|
||||
|
@ -8735,7 +8664,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
List<ResourceDescriptor> resources = service
|
||||
.getResources(tabularResourceId);
|
||||
ResourceTDCreator resourceTDCreator = new ResourceTDCreator(aslSession);
|
||||
ResourceTDCreator resourceTDCreator = new ResourceTDCreator(
|
||||
aslSession);
|
||||
|
||||
ArrayList<ResourceTDDescriptor> resourcesTD = resourceTDCreator
|
||||
.createResourcesDescriptorTD(resources);
|
||||
|
@ -8784,7 +8714,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
List<ResourceDescriptor> resources = service.getResourcesByType(
|
||||
tabularResourceId, resourceType);
|
||||
ResourceTDCreator resourceTDCreator = new ResourceTDCreator(aslSession);
|
||||
ResourceTDCreator resourceTDCreator = new ResourceTDCreator(
|
||||
aslSession);
|
||||
ArrayList<ResourceTDDescriptor> resourcesTD = resourceTDCreator
|
||||
.createResourcesDescriptorTD(resources);
|
||||
|
||||
|
@ -9037,7 +8968,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
logger.debug("SaveResource(): " + saveResourceSession);
|
||||
|
||||
|
||||
String mimeType;
|
||||
MimeTypeSupport mimeTypeSupport = saveResourceSession.getMime();
|
||||
|
@ -9058,89 +8988,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
throw new TDGWTServiceException("Resource has type null!");
|
||||
}
|
||||
|
||||
ApplicationType applicationType = null;
|
||||
|
||||
|
||||
switch (resourceTDType) {
|
||||
case CHART:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case CODELIST:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case CSV:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case GENERIC_FILE:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case GENERIC_TABLE:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case GUESSER:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
break;
|
||||
case JSON:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
case SDMX:
|
||||
saveResourceByStorageId(saveResourceSession, aslSession,
|
||||
mimeType, resourceTDDescriptor);
|
||||
break;
|
||||
case MAP:
|
||||
applicationType = ApplicationType.GIS;
|
||||
break;
|
||||
case SDMX:
|
||||
applicationType = ApplicationType.SMP_ID;
|
||||
ApplicationType applicationType = ApplicationType.GIS;
|
||||
saveResourceByInputStream(saveResourceSession, aslSession,
|
||||
mimeType, resourceTDDescriptor, applicationType);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
ResourceTD resource = resourceTDDescriptor.getResourceTD();
|
||||
UriResolverSession uriResolverSession;
|
||||
if (resource instanceof StringResourceTD) {
|
||||
StringResourceTD stringResourceTD = (StringResourceTD) resource;
|
||||
String uri = stringResourceTD.getStringValue();
|
||||
uriResolverSession = new UriResolverSession(uri,
|
||||
applicationType);
|
||||
} else {
|
||||
if (resource instanceof InternalURITD) {
|
||||
InternalURITD internalURITD = (InternalURITD) resource;
|
||||
uriResolverSession = new UriResolverSession(
|
||||
internalURITD.getId(), applicationType,
|
||||
resourceTDDescriptor.getName(),
|
||||
internalURITD.getMimeType());
|
||||
mimeType = internalURITD.getMimeType();
|
||||
} else {
|
||||
if (resource instanceof TableResourceTD) {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
} else {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UriResolverTDClient uriResolverTDClient = new UriResolverTDClient();
|
||||
String link = uriResolverTDClient.resolve(uriResolverSession,
|
||||
aslSession);
|
||||
|
||||
if (link == null || link.isEmpty()) {
|
||||
throw new TDGWTServiceException(
|
||||
"This resource does not have valid link: " + link);
|
||||
}
|
||||
logger.debug("Create Item On Workspace: [uri=" + link + " ,user: "
|
||||
+ aslSession.getUsername() + " ,fileName: "
|
||||
+ saveResourceSession.getFileName() + " ,fileDescription: "
|
||||
+ saveResourceSession.getFileDescription() + " ,mimetype:"
|
||||
+ mimeType + " ,folder: " + saveResourceSession.getItemId()
|
||||
+ "]");
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspace(link, aslSession.getUsername(),
|
||||
saveResourceSession.getFileName(),
|
||||
saveResourceSession.getFileDescription(), mimeType,
|
||||
saveResourceSession.getItemId());
|
||||
|
||||
return;
|
||||
|
||||
} catch (TDGWTServiceException e) {
|
||||
|
@ -9155,6 +9025,103 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
protected void saveResourceByStorageId(
|
||||
SaveResourceSession saveResourceSession, ASLSession aslSession,
|
||||
String mimeType, ResourceTDDescriptor resourceTDDescriptor) throws TDGWTServiceException {
|
||||
ResourceTD resource = resourceTDDescriptor.getResourceTD();
|
||||
String storageId=null;
|
||||
if (resource instanceof StringResourceTD) {
|
||||
StringResourceTD stringResourceTD = (StringResourceTD) resource;
|
||||
storageId=stringResourceTD.getStringValue();
|
||||
} else {
|
||||
if (resource instanceof InternalURITD) {
|
||||
InternalURITD internalURITD = (InternalURITD) resource;
|
||||
storageId=internalURITD.getId();
|
||||
mimeType = internalURITD.getMimeType();
|
||||
} else {
|
||||
if (resource instanceof TableResourceTD) {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
} else {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (storageId == null || storageId.isEmpty()) {
|
||||
throw new TDGWTServiceException(
|
||||
"This resource does not have valid storage id: " + storageId);
|
||||
}
|
||||
logger.debug("Create Item On Workspace: [storageId=" + storageId + " ,user: "
|
||||
+ aslSession.getUsername() + " ,fileName: "
|
||||
+ saveResourceSession.getFileName() + " ,fileDescription: "
|
||||
+ saveResourceSession.getFileDescription() + " ,mimetype:"
|
||||
+ mimeType + " ,folder: " + saveResourceSession.getItemId()
|
||||
+ "]");
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspaceByStorageId(storageId, aslSession.getUsername(),
|
||||
saveResourceSession.getFileName(),
|
||||
saveResourceSession.getFileDescription(), mimeType,
|
||||
saveResourceSession.getItemId());
|
||||
}
|
||||
|
||||
|
||||
protected void saveResourceByInputStream(
|
||||
SaveResourceSession saveResourceSession, ASLSession aslSession,
|
||||
String mimeType, ResourceTDDescriptor resourceTDDescriptor,
|
||||
ApplicationType applicationType) throws TDGWTServiceException {
|
||||
ResourceTD resource = resourceTDDescriptor.getResourceTD();
|
||||
UriResolverSession uriResolverSession;
|
||||
if (resource instanceof StringResourceTD) {
|
||||
StringResourceTD stringResourceTD = (StringResourceTD) resource;
|
||||
String uri = stringResourceTD.getStringValue();
|
||||
uriResolverSession = new UriResolverSession(uri,
|
||||
applicationType);
|
||||
} else {
|
||||
if (resource instanceof InternalURITD) {
|
||||
InternalURITD internalURITD = (InternalURITD) resource;
|
||||
uriResolverSession = new UriResolverSession(
|
||||
internalURITD.getId(), applicationType,
|
||||
resourceTDDescriptor.getName(),
|
||||
internalURITD.getMimeType());
|
||||
mimeType = internalURITD.getMimeType();
|
||||
} else {
|
||||
if (resource instanceof TableResourceTD) {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
} else {
|
||||
throw new TDGWTServiceException(
|
||||
"Save is not supported for this resource!");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UriResolverTDClient uriResolverTDClient = new UriResolverTDClient();
|
||||
String link = uriResolverTDClient.resolve(uriResolverSession,
|
||||
aslSession);
|
||||
|
||||
if (link == null || link.isEmpty()) {
|
||||
throw new TDGWTServiceException(
|
||||
"This resource does not have valid link: " + link);
|
||||
}
|
||||
logger.debug("Create Item On Workspace: [uri=" + link + " ,user: "
|
||||
+ aslSession.getUsername() + " ,fileName: "
|
||||
+ saveResourceSession.getFileName() + " ,fileDescription: "
|
||||
+ saveResourceSession.getFileDescription() + " ,mimetype:"
|
||||
+ mimeType + " ,folder: " + saveResourceSession.getItemId()
|
||||
+ "]");
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspace(link, aslSession.getUsername(),
|
||||
saveResourceSession.getFileName(),
|
||||
saveResourceSession.getFileDescription(), mimeType,
|
||||
saveResourceSession.getItemId());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -9495,6 +9462,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
throw new TDGWTServiceException(
|
||||
"Error in apply rule on table: ApplyTableRuleSession is null");
|
||||
}
|
||||
|
||||
if (applyTableRuleSession.getRuleDescriptionData() == null) {
|
||||
logger.error("Apply Table Rule Session: RuleDescriptionData is null");
|
||||
throw new TDGWTServiceException(
|
||||
"Error in apply rule on table: rule description is null");
|
||||
}
|
||||
|
||||
if (applyTableRuleSession.getPlaceHolderToColumnMap() == null) {
|
||||
logger.error("Apply Table Rule Session: PlaceHolderToColumnMap is null");
|
||||
throw new TDGWTServiceException(
|
||||
"Error in apply rule on table: map is null");
|
||||
}
|
||||
|
||||
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername(), aslSession.getScope()));
|
||||
|
@ -9511,17 +9491,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
checkTabularResourceLocked(tabularResource);
|
||||
checkTabularResourceIsFinal(tabularResource);
|
||||
|
||||
// TODO
|
||||
Task trTask = null;
|
||||
// service.applyTableRule(tabularResourceId,....);
|
||||
// logger.debug("Rules On Table Apply: TaskId " + trTask.getId());
|
||||
|
||||
RuleId ruleId = new RuleId(applyTableRuleSession
|
||||
.getRuleDescriptionData().getId());
|
||||
|
||||
Task trTask = service.applyTableRule(tabularResourceId,
|
||||
applyTableRuleSession.getPlaceHolderToColumnMap(), ruleId);
|
||||
logger.debug("Rules On Table Apply: TaskId " + trTask.getId());
|
||||
|
||||
TaskWrapper taskWrapper = new TaskWrapper(trTask,
|
||||
UIOperationsId.RuleOnColumnApply,
|
||||
UIOperationsId.RuleOnTableApply,
|
||||
applyTableRuleSession.getTrId());
|
||||
SessionUtil.setStartedTask(session, taskWrapper);
|
||||
return null;
|
||||
// return trTask.getId().getValue();
|
||||
return trTask.getId().getValue();
|
||||
|
||||
} catch (TDGWTServiceException e) {
|
||||
throw e;
|
||||
|
@ -9650,16 +9632,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
ArrayList<RuleDescriptionData> rules = detachTableRulesSession
|
||||
.getRules();
|
||||
ArrayList<RuleId> ruleIds = new ArrayList<RuleId>();
|
||||
List<RuleId> ruleIds = new ArrayList<RuleId>();
|
||||
if (rules != null && rules.size() > 0) {
|
||||
for (RuleDescriptionData r : rules) {
|
||||
RuleId ruleId = new RuleId(r.getId());
|
||||
ruleIds.add(ruleId);
|
||||
}
|
||||
// TODO
|
||||
/*
|
||||
* service.detachTableRules(tabularResourceId, ruleIds);
|
||||
*/
|
||||
service.detachTableRules(tabularResourceId, ruleIds);
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class OpExecution4CSVImport extends OpExecutionBuilder {
|
|||
.map(OperationsId.CSVImport.toString(), service);
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put(Constants.PARAMETER_ID, fileIdOnStorage);
|
||||
map.put(Constants.PARAMETER_URL, fileIdOnStorage);
|
||||
map.put(Constants.PARAMETER_SEPARATOR, String
|
||||
.valueOf(fileUploadSession.getParserConfiguration()
|
||||
.getDelimiter()));// ','
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.server.opexecution;
|
||||
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint.Profile;
|
||||
import org.gcube.common.resources.gcore.utils.Group;
|
||||
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.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.exception.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.OperationsId;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Operation Execution for sdmx codelist export
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OpExecution4SDMXCodelistExport extends OpExecutionBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(OpExecution4SDMXCodelistExport.class);
|
||||
|
||||
private TabularDataService service;
|
||||
private SDMXExportSession sdmxExportSession;
|
||||
|
||||
public OpExecution4SDMXCodelistExport(TabularDataService service,
|
||||
SDMXExportSession sdmxExportSession) {
|
||||
this.service = service;
|
||||
this.sdmxExportSession = sdmxExportSession;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildOpEx() throws TDGWTServiceException {
|
||||
logger.debug(sdmxExportSession.toString());
|
||||
boolean internalRegistry = false;
|
||||
String destination = null;// Es:
|
||||
// http://pc-fortunati.isti.cnr.it:8080/FusionRegistry/ws/rest/
|
||||
|
||||
if (sdmxExportSession != null) {
|
||||
if (sdmxExportSession.getRegistryBaseUrl() != null
|
||||
&& !sdmxExportSession.getRegistryBaseUrl().isEmpty()) {
|
||||
destination = sdmxExportSession.getRegistryBaseUrl();
|
||||
} else {
|
||||
internalRegistry = true;
|
||||
}
|
||||
} else {
|
||||
internalRegistry = true;
|
||||
}
|
||||
|
||||
if (internalRegistry) {
|
||||
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq 'SDMX'")
|
||||
.addCondition(
|
||||
"$resource/Profile/Name/text() eq 'SDMXRegistry'");
|
||||
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
||||
List<ServiceEndpoint> listService = client.submit(query);
|
||||
if (listService.size() > 0) {
|
||||
ServiceEndpoint serviceEnd = listService.get(0);
|
||||
if (serviceEnd != null) {
|
||||
Profile prof = serviceEnd.profile();
|
||||
Group<AccessPoint> groupA = prof.accessPoints();
|
||||
for (AccessPoint acc : groupA) {
|
||||
if (acc.description().compareTo("REST Interface v2.1") == 0) {
|
||||
destination = acc.address();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
if (destination == null) {
|
||||
logger.debug("Destination: " + destination);
|
||||
throw new TDGWTServiceException("SDMX Service not discovered");
|
||||
}
|
||||
|
||||
OperationDefinition operationDefinition = OperationDefinitionMap.map(
|
||||
OperationsId.SDMXCodelistExport.toString(), service);
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
map.put(Constants.PARAMETER_REGISTRYBASEURL, destination);
|
||||
map.put(Constants.PARAMETER_AGENCY, "SDMX");
|
||||
map.put(Constants.PARAMETER_ID, "NEW_CL_DIVISION");
|
||||
map.put(Constants.PARAMETER_VERSION, "2.0");
|
||||
|
||||
OperationExecution invocation = new OperationExecution(
|
||||
operationDefinition.getOperationId(), map);
|
||||
|
||||
operationExecutionSpec.setOp(invocation);
|
||||
}
|
||||
|
||||
}
|
|
@ -81,7 +81,7 @@ public class FilesStorage {
|
|||
try {
|
||||
URL address = new URL(url);
|
||||
is = address.openStream();
|
||||
|
||||
|
||||
IClient client = new StorageClient(user, AccessType.PUBLIC,
|
||||
MemoryType.VOLATILE).getClient();
|
||||
String remotePath = "/CodelistMappingImport/" + address.getFile();
|
||||
|
@ -312,4 +312,43 @@ public class FilesStorage {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param storageId
|
||||
* @param user
|
||||
* @param item_name
|
||||
* @param item_description
|
||||
* @param item_mimetype
|
||||
* @param item_folder
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
public void createItemOnWorkspaceByStorageId(String storageId, String user,
|
||||
String item_name, String item_description, String item_mimetype,
|
||||
String item_folder) throws TDGWTServiceException {
|
||||
|
||||
try {
|
||||
|
||||
Workspace ws = HomeLibrary.getUserWorkspace(user);
|
||||
|
||||
WorkspaceFolder folder = (WorkspaceFolder) ws.getItem(item_folder);
|
||||
String uniqueName = WorkspaceUtil.getUniqueName(item_name, folder);
|
||||
|
||||
logger.debug("ws.createExternalFile [folder: " + folder
|
||||
+ ", uniqueName: " + uniqueName + ", description: "
|
||||
+ item_description + ", mimetype: " + item_mimetype
|
||||
+ ", StorageId: " + storageId + "]");
|
||||
WorkspaceUtil.createExternalFile(folder, uniqueName,
|
||||
item_description, item_mimetype, storageId);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error creating item on workspace", e);
|
||||
e.printStackTrace();
|
||||
throw new TDGWTServiceException(
|
||||
"Error creating item on workspace: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.JobClassifierMap;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.WorkerStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.uriresolver.UriResolverTDClient;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
|
@ -41,9 +40,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.task.TaskS;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskWrapper;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsJobS;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabExportMetadata;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.uriresolver.ApplicationType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -415,8 +412,7 @@ public class BackgroundOperationMonitorCreator {
|
|||
boolean end = SessionUtil.getCSVExportEnd(session);
|
||||
if (end == false) {
|
||||
SessionUtil.setCSVExportEnd(session, true);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
logger.debug("Create Item On Workspace: [ uri: "
|
||||
logger.debug("Create Item On Workspace: [ storageId: "
|
||||
+ exportMetadata.getUri() + " ,user: " + user
|
||||
+ " ,fileName: " + exportSession.getFileName()
|
||||
+ " ,fileDescription: "
|
||||
|
@ -424,13 +420,9 @@ public class BackgroundOperationMonitorCreator {
|
|||
+ " ,mimetype: text/csv" + " ,folder: "
|
||||
+ exportSession.getItemId() + "]");
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
UriResolverSession uriResolverSession = new UriResolverSession(
|
||||
exportMetadata.getUri(), ApplicationType.SMP_ID);
|
||||
UriResolverTDClient uriResolverTDClient=new UriResolverTDClient();
|
||||
String link=uriResolverTDClient.resolve(uriResolverSession, aslSession);
|
||||
|
||||
storage.createItemOnWorkspace(link, user,
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileDescription(), "text/csv",
|
||||
exportSession.getItemId());
|
||||
|
@ -468,8 +460,8 @@ public class BackgroundOperationMonitorCreator {
|
|||
boolean end = SessionUtil.getJSONExportEnd(session);
|
||||
if (end == false) {
|
||||
SessionUtil.setJSONExportEnd(session, true);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
logger.debug("Create Item On Workspace: [ uri: "
|
||||
|
||||
logger.debug("Create Item On Workspace: [ storageId: "
|
||||
+ exportMetadata.getUri() + " ,user: " + user
|
||||
+ " ,fileName: " + exportSession.getFileName()
|
||||
+ " ,fileDescription: "
|
||||
|
@ -477,13 +469,9 @@ public class BackgroundOperationMonitorCreator {
|
|||
+ " ,mimetype: application/json" + " ,folder: "
|
||||
+ exportSession.getItemId() + "]");
|
||||
|
||||
UriResolverSession uriResolverSession = new UriResolverSession(
|
||||
exportMetadata.getUri(), ApplicationType.SMP_ID);
|
||||
UriResolverTDClient uriResolverTDClient=new UriResolverTDClient();
|
||||
String link=uriResolverTDClient.resolve(uriResolverSession, aslSession);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
|
||||
storage.createItemOnWorkspace(link, user,
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileDescription(), "application/json",
|
||||
exportSession.getItemId());
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.JobClassifierMap;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.WorkerStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.uriresolver.UriResolverTDClient;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
|
@ -41,9 +40,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.task.TaskWrapper;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsJobS;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabExportMetadata;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.uriresolver.ApplicationType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -470,8 +467,8 @@ public class OperationMonitorCreator {
|
|||
boolean end = SessionUtil.getCSVExportEnd(session);
|
||||
if (end == false) {
|
||||
SessionUtil.setCSVExportEnd(session, true);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
logger.debug("Create Item On Workspace: [ uri: "
|
||||
|
||||
logger.debug("Create Item On Workspace: [ storageId: "
|
||||
+ exportMetadata.getUri() + " ,user: " + user
|
||||
+ " ,fileName: " + exportSession.getFileName()
|
||||
+ " ,fileDescription: "
|
||||
|
@ -479,13 +476,8 @@ public class OperationMonitorCreator {
|
|||
+ " ,mimetype: text/csv" + " ,folder: "
|
||||
+ exportSession.getItemId() + "]");
|
||||
|
||||
UriResolverSession uriResolverSession = new UriResolverSession(
|
||||
exportMetadata.getUri(), ApplicationType.SMP_ID);
|
||||
UriResolverTDClient uriResolverTDClient=new UriResolverTDClient();
|
||||
String link=uriResolverTDClient.resolve(uriResolverSession, aslSession);
|
||||
|
||||
|
||||
storage.createItemOnWorkspace(link, user,
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileDescription(), "text/csv",
|
||||
exportSession.getItemId());
|
||||
|
@ -523,8 +515,8 @@ public class OperationMonitorCreator {
|
|||
boolean end = SessionUtil.getJSONExportEnd(session);
|
||||
if (end == false) {
|
||||
SessionUtil.setJSONExportEnd(session, true);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
logger.debug("Create Item On Workspace: [ uri: "
|
||||
|
||||
logger.debug("Create Item On Workspace: [ storageId: "
|
||||
+ exportMetadata.getUri() + " ,user: " + user
|
||||
+ " ,fileName: " + exportSession.getFileName()
|
||||
+ " ,fileDescription: "
|
||||
|
@ -532,13 +524,9 @@ public class OperationMonitorCreator {
|
|||
+ " ,mimetype: application/json" + " ,folder: "
|
||||
+ exportSession.getItemId() + "]");
|
||||
|
||||
UriResolverSession uriResolverSession = new UriResolverSession(
|
||||
exportMetadata.getUri(), ApplicationType.SMP_ID);
|
||||
UriResolverTDClient uriResolverTDClient=new UriResolverTDClient();
|
||||
String link=uriResolverTDClient.resolve(uriResolverSession, aslSession);
|
||||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
|
||||
storage.createItemOnWorkspace(link, user,
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileDescription(), "application/json",
|
||||
exportSession.getItemId());
|
||||
|
|
Loading…
Reference in New Issue