Skip to content
Snippets Groups Projects
Commit ffd2f765 authored by buczekp's avatar buczekp
Browse files

[LMS-2301] add IDataSourceQueryService to the reporting plugin framework

SVN: 21981
parent c3d303f0
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.api.IDataSet;
import ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.api.IMailService;
import ch.systemsx.cisd.openbis.dss.generic.shared.DataSetProcessingContext;
import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSourceQueryService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISearchService;
import ch.systemsx.cisd.openbis.generic.shared.managed_property.api.ISimpleTableModelBuilderAdaptor;
......@@ -45,6 +46,8 @@ class PluginScriptRunnerFactory implements IPluginScriptRunnerFactory
private final static String SEARCH_SERVICE_VARIABLE_NAME = "searchService";
private final static String DATA_SOURCE_QUERY_SERVICE_VARIABLE_NAME = "queryService";
private final static String MAIL_SERVICE_VARIABLE_NAME = "mailService";
private final String scriptPath;
......@@ -139,6 +142,7 @@ class PluginScriptRunnerFactory implements IPluginScriptRunnerFactory
final Evaluator evaluator = new Evaluator("", null, scriptString, false);
evaluator.set(SEARCH_SERVICE_VARIABLE_NAME, createSearchService());
evaluator.set(MAIL_SERVICE_VARIABLE_NAME, createMailService(context));
evaluator.set(DATA_SOURCE_QUERY_SERVICE_VARIABLE_NAME, createDataSourceQueryService());
return evaluator;
}
......@@ -147,6 +151,11 @@ class PluginScriptRunnerFactory implements IPluginScriptRunnerFactory
return ServiceProvider.getSearchService();
}
private static IDataSourceQueryService createDataSourceQueryService()
{
return ServiceProvider.getDataSourceQueryService();
}
private static IMailService createMailService(DataSetProcessingContext context)
{
return new MailService(context.getMailClient(), context.getUserEmailOrNull());
......
......@@ -26,6 +26,8 @@ import com.marathon.util.spring.StreamSupportingHttpInvokerServiceExporter;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
import ch.systemsx.cisd.etlserver.registrator.api.v1.impl.DataSourceQueryService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSourceQueryService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISearchService;
/**
......@@ -104,6 +106,11 @@ public class ServiceProvider
return ((ISearchService) getApplicationContext().getBean("search-service"));
}
public static IDataSourceQueryService getDataSourceQueryService()
{
return new DataSourceQueryService();
}
public static IDataSetPathInfoProvider getDataSetPathInfoProvider()
{
return ((IDataSetPathInfoProvider) getApplicationContext().getBean(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment