Added getListOperatorsPerScope

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/ws-task-executor-widget@167578 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-05-17 16:24:09 +00:00
parent 3352415902
commit 47bdcacedd
4 changed files with 58 additions and 1 deletions

View File

@ -92,7 +92,7 @@ public class WsTaskExecutorWidget {
if(perforRunTaskEvent.getWsItem()!=null && perforRunTaskEvent.getConfiguration()!=null){
String msg = "<div style='font-size:14px; font-weight:bold;'>Executing the task with configuration:</div>";
msg+="<br/>";
msg+="Operator Id: "+perforRunTaskEvent.getConfiguration().getTaskId();
msg+="Operator Id: <br/>"+perforRunTaskEvent.getConfiguration().getTaskId();
int cParam = perforRunTaskEvent.getConfiguration().getListParameters().size();
msg+="<br/><br/>";
if(cParam>0){

View File

@ -2,6 +2,7 @@ package org.gcube.portlets.widgets.wstaskexecutor.client.rpc;
import java.util.List;
import org.gcube.common.workspacetaskexecutor.shared.TaskOperator;
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterType;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskComputation;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
@ -113,4 +114,13 @@ public interface WsTaskExecutorWidgetService extends RemoteService {
TaskExecutionStatus executeTheTask(TaskConfiguration taskConfiguration)
throws ItemNotExecutableException, TaskNotExecutableException,
Exception;
/**
* Gets the list operators per scope.
*
* @param scope the scope
* @return the list operators per scope
* @throws Exception the exception
*/
List<TaskOperator> getListOperatorsPerScope(String scope) throws Exception;
}

View File

@ -5,6 +5,7 @@ package org.gcube.portlets.widgets.wstaskexecutor.client.rpc;
import java.util.List;
import org.gcube.common.workspacetaskexecutor.shared.TaskOperator;
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterType;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskComputation;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
@ -136,4 +137,15 @@ public interface WsTaskExecutorWidgetServiceAsync {
void executeTheTask(TaskConfiguration taskConfiguration, AsyncCallback<TaskExecutionStatus> asyncCallback);
/**
* Gets the list operators per scope.
*
* @param scope the scope
* @param asyncCallback the async callback
* @return the list operators per scope
* @throws Exception the exception
*/
void getListOperatorsPerScope(String scope, AsyncCallback<List<TaskOperator>> asyncCallback) throws Exception;
}

View File

@ -7,6 +7,7 @@ import java.util.List;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.workspacetaskexecutor.dataminer.WorkspaceDataMinerTaskExecutor;
import org.gcube.common.workspacetaskexecutor.shared.TaskOperator;
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterType;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskComputation;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
@ -304,4 +305,38 @@ public class WsTaskExecutorWidgetServiceImpl extends RemoteServiceServlet implem
return exec.monitorRunStatus(configuration, taskComputation);
}
/**
* Gets the list operators per scope.
*
* @param scope the scope
* @return the list operators per scope
* @throws Exception the exception
*/
@Override
public List<TaskOperator> getListOperatorsPerScope(String scope) throws Exception{
if(scope==null || scope.isEmpty())
throw new Exception("Invalid scope null");
WorkspaceDataMinerTaskExecutor exec = getTaskExecutor();
String originalScope = ScopeProvider.instance.get();
try{
ScopeProvider.instance.set(scope);
return exec.getListOperators();
}catch(Exception e){
}finally{
if(originalScope!=null)
ScopeProvider.instance.set(originalScope);
}
return null;
}
}