ref 6078:TDM - Create a new widget to support operations's invocation on DataMiner

https://support.d4science.org/issues/6078

Updated to support DataMiner

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@144882 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-03-13 18:58:50 +00:00
parent 3314543edd
commit 37d7be2f5a
11 changed files with 213 additions and 104 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/tabular-data-gwt-service-2.15.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/tabular-data-gwt-service-2.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-gwt-service-2.15.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/tabular-data-gwt-service-2.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -33,5 +33,5 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/tabular-data-gwt-service-2.15.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/tabular-data-gwt-service-2.16.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,4 +1,7 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-16-0" date="2017-04-01">
<Change>Added DataMiner [issue #6548]</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-15-0" date="2017-02-15"> <Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-15-0" date="2017-02-15">
<Change>Updatetd to new PortalContext [issue #6548]</Change> <Change>Updatetd to new PortalContext [issue #6548]</Change>
</Changeset> </Changeset>

31
pom.xml
View File

@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-gwt-service</artifactId> <artifactId>tabular-data-gwt-service</artifactId>
<version>2.15.0-SNAPSHOT</version> <version>2.16.0-SNAPSHOT</version>
<name>tabular-data-gwt-service</name> <name>tabular-data-gwt-service</name>
<description>tabular-data-gwt-service allows communication between the GUI and services</description> <description>tabular-data-gwt-service allows communication between the GUI and services</description>
@ -68,17 +68,9 @@
<version>1.0.1</version> <version>1.0.1</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- <!-- <dependency> <groupId>org.gcube.common</groupId> <artifactId>common-authorization</artifactId>
<dependency> <scope>runtime</scope> </dependency> <dependency> <groupId>org.gcube.common</groupId>
<groupId>org.gcube.common</groupId> <artifactId>authorization-client</artifactId> <scope>runtime</scope> </dependency> -->
<artifactId>common-authorization</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<scope>runtime</scope>
</dependency> -->
</dependencies> </dependencies>
</profile> </profile>
@ -138,12 +130,8 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- GCube Widgets <!-- GCube Widgets <dependency> <groupId>org.gcube.portlets.user</groupId>
<dependency> <artifactId>gcube-widgets</artifactId> <scope>compile</scope> </dependency> -->
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<scope>compile</scope>
</dependency> -->
@ -255,6 +243,13 @@
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- DataMiner Manager Client Library -->
<dependency>
<groupId>org.gcube.data.analysis</groupId>
<artifactId>data-miner-manager-cl</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-widget-common-event --> <!-- tabular-data-widget-common-event -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>

View File

@ -35,7 +35,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.share.ShareRule;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTabResource; import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTabResource;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate; import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate;
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource; import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
import org.gcube.portlets.user.td.gwtservice.shared.statistical.StatisticalOperationSession; import org.gcube.portlets.user.td.gwtservice.shared.statistical.DataMinerOperationSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata; import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata;
@ -115,7 +115,6 @@ public interface TDGWTService extends RemoteService {
*/ */
public UserInfo hello() throws TDGWTServiceException; public UserInfo hello() throws TDGWTServiceException;
/** /**
* Set locale on server * Set locale on server
* *
@ -149,7 +148,6 @@ public interface TDGWTService extends RemoteService {
public String getUriFromResolver(UriResolverSession uriResolverSession) public String getUriFromResolver(UriResolverSession uriResolverSession)
throws TDGWTServiceException; throws TDGWTServiceException;
/** /**
* Get VRE Folder Id * Get VRE Folder Id
* *
@ -158,7 +156,6 @@ public interface TDGWTService extends RemoteService {
*/ */
public String getVREFolderIdByScope() throws TDGWTServiceException; public String getVREFolderIdByScope() throws TDGWTServiceException;
// PeriodDataType // PeriodDataType
/** /**
* Get list of PeriodDataType * Get list of PeriodDataType
@ -769,8 +766,6 @@ public interface TDGWTService extends RemoteService {
public AvailableCharsetList getAvailableCharsetForExport() public AvailableCharsetList getAvailableCharsetForExport()
throws TDGWTServiceException; throws TDGWTServiceException;
/** /**
* Start CSV Export and invokes the client library * Start CSV Export and invokes the client library
* *
@ -1233,15 +1228,15 @@ public interface TDGWTService extends RemoteService {
public String startMapCreation(MapCreationSession mapCreationSession) public String startMapCreation(MapCreationSession mapCreationSession)
throws TDGWTServiceException; throws TDGWTServiceException;
// Statistical // DataMiner
/** /**
* *
* @param statisticalOperationSession * @param dataMinerOperationSession
* @return * @return
* @throws TDGWTServiceException * @throws TDGWTServiceException
*/ */
public String startStatisticalOperation( public String startDataMinerOperation(
StatisticalOperationSession statisticalOperationSession) DataMinerOperationSession dataMinerOperationSession)
throws TDGWTServiceException; throws TDGWTServiceException;
// Chart // Chart

View File

@ -34,7 +34,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.share.ShareRule;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTabResource; import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTabResource;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate; import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate;
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource; import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
import org.gcube.portlets.user.td.gwtservice.shared.statistical.StatisticalOperationSession; import org.gcube.portlets.user.td.gwtservice.shared.statistical.DataMinerOperationSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata; import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata;
@ -235,8 +235,7 @@ public interface TDGWTServiceAsync {
void setShareTemplate(ShareTemplate shareTemplate, void setShareTemplate(ShareTemplate shareTemplate,
AsyncCallback<Void> callback); AsyncCallback<Void> callback);
void setShareRule(ShareRule shareRule, void setShareRule(ShareRule shareRule, AsyncCallback<Void> callback);
AsyncCallback<Void> callback);
// CodelistPagingLoaded // CodelistPagingLoaded
void setCodelistsPagingLoader(AsyncCallback<Void> callback); void setCodelistsPagingLoader(AsyncCallback<Void> callback);
@ -286,7 +285,8 @@ public interface TDGWTServiceAsync {
AsyncCallback<String> callback); AsyncCallback<String> callback);
// Export CSV // Export CSV
void getAvailableCharsetForExport(AsyncCallback<AvailableCharsetList> callback); void getAvailableCharsetForExport(
AsyncCallback<AvailableCharsetList> callback);
void startCSVExport(CSVExportSession csvExportSession, void startCSVExport(CSVExportSession csvExportSession,
AsyncCallback<String> callback); AsyncCallback<String> callback);
@ -328,10 +328,10 @@ public interface TDGWTServiceAsync {
void startLabelColumn(LabelColumnSession labelColumnSession, void startLabelColumn(LabelColumnSession labelColumnSession,
AsyncCallback<String> callback); AsyncCallback<String> callback);
void startChangeColumnsPosition(ChangeColumnsPositionSession changeColumnsPositionSession, void startChangeColumnsPosition(
ChangeColumnsPositionSession changeColumnsPositionSession,
AsyncCallback<Void> callback); AsyncCallback<Void> callback);
/* /*
* void startSplitColumn(SplitColumnSession * void startSplitColumn(SplitColumnSession
* splitColumnSession,AsyncCallback<Void> callback); * splitColumnSession,AsyncCallback<Void> callback);
@ -422,7 +422,6 @@ public interface TDGWTServiceAsync {
OperationMonitorSession operationMonitorSession, OperationMonitorSession operationMonitorSession,
AsyncCallback<OperationMonitor> callback); AsyncCallback<OperationMonitor> callback);
// File Upload Monitor // File Upload Monitor
void getFileUploadMonitor(AsyncCallback<FileUploadMonitor> callback); void getFileUploadMonitor(AsyncCallback<FileUploadMonitor> callback);
@ -443,9 +442,10 @@ public interface TDGWTServiceAsync {
void startMapCreation(MapCreationSession mapCreationSession, void startMapCreation(MapCreationSession mapCreationSession,
AsyncCallback<String> callback); AsyncCallback<String> callback);
// Statistical
void startStatisticalOperation( // DataMiner
StatisticalOperationSession statisticalOperationSession, void startDataMinerOperation(
DataMinerOperationSession dataMinerOperationSession,
AsyncCallback<String> callback); AsyncCallback<String> callback);
// Chart // Chart

View File

@ -74,7 +74,7 @@ public class SessionConstants {
public static final String REPLACE_BY_EXTERNAL_SESSION = "REPLACE_BY_EXTERNAL_SESSION"; public static final String REPLACE_BY_EXTERNAL_SESSION = "REPLACE_BY_EXTERNAL_SESSION";
public static final String STATISTICAL_OPERATION_SESSION = "STATISTICAL_OPERATION_SESSION"; public static final String DATAMINER_OPERATION_SESSION = "DATAMINER_OPERATION_SESSION";
public static final String NORMALIZATION_SESSION = "NORMALIZATION_SESSION"; public static final String NORMALIZATION_SESSION = "NORMALIZATION_SESSION";

View File

@ -42,7 +42,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.rule.DetachTableRulesSession
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession; import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession; import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource; import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
import org.gcube.portlets.user.td.gwtservice.shared.statistical.StatisticalOperationSession; import org.gcube.portlets.user.td.gwtservice.shared.statistical.DataMinerOperationSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResubmitSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskWrapper; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskWrapper;
@ -1673,25 +1673,25 @@ public class SessionUtil {
} }
// //
public static StatisticalOperationSession getStatisticalOperationSession( public static DataMinerOperationSession getDataMinerOperationSession(
HttpServletRequest httpRequest, HttpServletRequest httpRequest,
ServiceCredentials serviceCredentials) throws TDGWTServiceException { ServiceCredentials serviceCredentials) throws TDGWTServiceException {
SessionOp<StatisticalOperationSession> sessionOp = new SessionOp<>(); SessionOp<DataMinerOperationSession> sessionOp = new SessionOp<>();
StatisticalOperationSession statisticalOperationSession = sessionOp DataMinerOperationSession dataMinerOperationSession = sessionOp
.get(httpRequest, serviceCredentials, .get(httpRequest, serviceCredentials,
SessionConstants.STATISTICAL_OPERATION_SESSION, SessionConstants.DATAMINER_OPERATION_SESSION,
StatisticalOperationSession.class); DataMinerOperationSession.class);
return statisticalOperationSession; return dataMinerOperationSession;
} }
public static void setStatisticalOperationSession( public static void setDataMinerOperationSession(
HttpServletRequest httpRequest, HttpServletRequest httpRequest,
ServiceCredentials serviceCredentials, ServiceCredentials serviceCredentials,
StatisticalOperationSession statisticalOperationSession) { DataMinerOperationSession dataMinerOperationSession) {
SessionOp<StatisticalOperationSession> sessionOp = new SessionOp<>(); SessionOp<DataMinerOperationSession> sessionOp = new SessionOp<>();
sessionOp.set(httpRequest, serviceCredentials, sessionOp.set(httpRequest, serviceCredentials,
SessionConstants.STATISTICAL_OPERATION_SESSION, SessionConstants.DATAMINER_OPERATION_SESSION,
statisticalOperationSession); dataMinerOperationSession);
} }
// //

View File

@ -117,6 +117,7 @@ import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Chan
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4ChartTopRating; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4ChartTopRating;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Clone; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Clone;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4CodelistMapping; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4CodelistMapping;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4DataMinerOperation;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4DeleteColumn; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4DeleteColumn;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4DeleteRows; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4DeleteRows;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Denormalization; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Denormalization;
@ -141,7 +142,6 @@ import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMX
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXCodelistImport; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXCodelistImport;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXDatasetExport; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SDMXDatasetExport;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SplitColumn; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4SplitColumn;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4StatisticalOperation;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4TimeAggregation; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4TimeAggregation;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Union; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecution4Union;
import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecutionDirector; import org.gcube.portlets.user.td.gwtservice.server.opexecution.OpExecutionDirector;
@ -206,7 +206,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTabResource;
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate; import org.gcube.portlets.user.td.gwtservice.shared.share.ShareTemplate;
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource; import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
import org.gcube.portlets.user.td.gwtservice.shared.source.SourceType; import org.gcube.portlets.user.td.gwtservice.shared.source.SourceType;
import org.gcube.portlets.user.td.gwtservice.shared.statistical.StatisticalOperationSession; import org.gcube.portlets.user.td.gwtservice.shared.statistical.DataMinerOperationSession;
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS; import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS;
import org.gcube.portlets.user.td.gwtservice.shared.task.JobS; import org.gcube.portlets.user.td.gwtservice.shared.task.JobS;
import org.gcube.portlets.user.td.gwtservice.shared.task.JobSClassifier; import org.gcube.portlets.user.td.gwtservice.shared.task.JobSClassifier;
@ -9020,13 +9020,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} }
/**
*
* {@inheritDoc}
*/
@Override @Override
public String startStatisticalOperation( public String startDataMinerOperation(
StatisticalOperationSession statisticalOperationSession) DataMinerOperationSession dataMinerOperationSession)
throws TDGWTServiceException { throws TDGWTServiceException {
HttpServletRequest httpRequest = null; HttpServletRequest httpRequest = null;
try { try {
@ -9034,16 +9033,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ServiceCredentials serviceCredentials = SessionUtil ServiceCredentials serviceCredentials = SessionUtil
.getServiceCredentials(httpRequest); .getServiceCredentials(httpRequest);
SessionUtil.setStatisticalOperationSession(httpRequest, SessionUtil.setDataMinerOperationSession(httpRequest,
serviceCredentials, statisticalOperationSession); serviceCredentials, dataMinerOperationSession);
TabularDataService service = TabularDataServiceFactory.getService(); TabularDataService service = TabularDataServiceFactory.getService();
checkTRId(statisticalOperationSession.getTrId(), httpRequest, checkTRId(dataMinerOperationSession.getTrId(), httpRequest,
serviceCredentials); serviceCredentials);
TabularResourceId tabularResourceId = new TabularResourceId( TabularResourceId tabularResourceId = new TabularResourceId(
Long.valueOf(statisticalOperationSession.getTrId().getId())); Long.valueOf(dataMinerOperationSession.getTrId().getId()));
TabularResource tabularResource = service TabularResource tabularResource = service
.getTabularResource(tabularResourceId); .getTabularResource(tabularResourceId);
@ -9052,8 +9051,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
checkTabularResourceLocked(tabularResource, httpRequest, checkTabularResourceLocked(tabularResource, httpRequest,
serviceCredentials); serviceCredentials);
OpExecution4StatisticalOperation opEx = new OpExecution4StatisticalOperation( OpExecution4DataMinerOperation opEx = new OpExecution4DataMinerOperation(
service, serviceCredentials, statisticalOperationSession); service, serviceCredentials, dataMinerOperationSession);
OpExecutionDirector director = new OpExecutionDirector(); OpExecutionDirector director = new OpExecutionDirector();
director.setOperationExecutionBuilder(opEx); director.setOperationExecutionBuilder(opEx);
director.constructOperationExecution(); director.constructOperationExecution();
@ -9061,7 +9060,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
if (invocation == null) { if (invocation == null) {
throw new TDGWTServiceException( throw new TDGWTServiceException(
"Error Statistical Operation invocation: Operation not supported"); "Error DataMiner Operation invocation: Operation not supported");
} }
logger.debug("OperationInvocation: \n" + invocation.toString()); logger.debug("OperationInvocation: \n" + invocation.toString());
@ -9069,7 +9068,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Start Task on service: TaskId " + trTask.getId()); logger.debug("Start Task on service: TaskId " + trTask.getId());
TaskWrapper taskWrapper = new TaskWrapper(trTask, TaskWrapper taskWrapper = new TaskWrapper(trTask,
UIOperationsId.StatisticalOperation, UIOperationsId.StatisticalOperation,
statisticalOperationSession.getTrId()); dataMinerOperationSession.getTrId());
SessionUtil.setStartedTask(httpRequest, serviceCredentials, SessionUtil.setStartedTask(httpRequest, serviceCredentials,
taskWrapper); taskWrapper);
return trTask.getId().getValue(); return trTask.getId().getValue();
@ -9083,12 +9082,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights));
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
throw new TDGWTServiceException("Error in statistical operation: " throw new TDGWTServiceException("Error in DataMiner operation: "
+ e.getLocalizedMessage()); + e.getLocalizedMessage());
} }
} }
/** /**
* *
* {@inheritDoc} * {@inheritDoc}

View File

@ -0,0 +1,64 @@
package org.gcube.portlets.user.td.gwtservice.server.opexecution;
import java.util.HashMap;
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.service.TabularDataService;
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
import org.gcube.portlets.user.td.gwtservice.server.util.ServiceCredentials;
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.statistical.DataMinerOperationSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.OperationsId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Operation DataMiner
*
* @author "Giancarlo Panichi" email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class OpExecution4DataMinerOperation extends OpExecutionBuilder {
private static Logger logger = LoggerFactory
.getLogger(OpExecution4DataMinerOperation.class);
private TabularDataService service;
private ServiceCredentials serviceCredentials;
private DataMinerOperationSession dataMinerOperationSession;
public OpExecution4DataMinerOperation(
TabularDataService service,ServiceCredentials serviceCredentials,
DataMinerOperationSession dataMinerOperationSession) {
this.service = service;
this.serviceCredentials = serviceCredentials;
this.dataMinerOperationSession = dataMinerOperationSession;
}
@Override
public void buildOpEx() throws TDGWTServiceException {
OperationExecution invocation = null;
logger.debug(dataMinerOperationSession.toString());
OperationDefinition operationDefinition;
Map<String, Object> map = new HashMap<String, Object>();
operationDefinition = OperationDefinitionMap.map(
OperationsId.StatisticalOperation.toString(), service);
map.put(Constants.PARAMETER_DATAMINER_GCUBETOKEN, serviceCredentials.getToken());
map.put(Constants.PARAMETER_DATAMINER_OPERATOR, dataMinerOperationSession.getOperator());
invocation = new OperationExecution(
operationDefinition.getOperationId(), map);
operationExecutionSpec.setOp(invocation);
}
}

View File

@ -73,6 +73,9 @@ public class Constants {
public static final String PARAMETER_STATISTICAL_OPERATION_DESCRIPTION = "description"; public static final String PARAMETER_STATISTICAL_OPERATION_DESCRIPTION = "description";
public static final String PARAMETER_STATISTICAL_OPERATION_TITLE = "title"; public static final String PARAMETER_STATISTICAL_OPERATION_TITLE = "title";
public static final String PARAMETER_DATAMINER_GCUBETOKEN = "gcubetoken";
public static final String PARAMETER_DATAMINER_OPERATOR = "operator";
public static final String PARAMETER_ADD_ROW_COMPOSITE_FIELD = "field"; public static final String PARAMETER_ADD_ROW_COMPOSITE_FIELD = "field";
public static final String PARAMETER_ADD_ROW_COMPOSITE_TOSETVALUE = "toSetValue"; public static final String PARAMETER_ADD_ROW_COMPOSITE_TOSETVALUE = "toSetValue";
public static final String PARAMETER_ADD_ROW_COMPOSITE = "mapping"; public static final String PARAMETER_ADD_ROW_COMPOSITE = "mapping";

View File

@ -0,0 +1,49 @@
/**
*
*/
package org.gcube.portlets.user.td.gwtservice.shared.statistical;
import java.io.Serializable;
import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DataMinerOperationSession implements Serializable {
private static final long serialVersionUID = -8968614490778086448L;
private TRId trId;
private Operator operator;
public DataMinerOperationSession() {
super();
}
public DataMinerOperationSession(TRId trId, Operator operator) {
super();
this.trId = trId;
this.operator = operator;
}
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
public Operator getOperator() {
return operator;
}
public void setOperator(Operator operator) {
this.operator = operator;
}
}