Skip to content
Snippets Groups Projects
Commit 995d0f31 authored by juanf's avatar juanf
Browse files

SSDM-13195 : Extending SampleDAO to rework ProjectPE

parent 22b38028
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -155,6 +155,15 @@ public class MaintenanceTaskStarter implements ApplicationContextAware, Initiali ...@@ -155,6 +155,15 @@ public class MaintenanceTaskStarter implements ApplicationContextAware, Initiali
PersonalAccessTokenValidityWarningTask.DEFAULT_MAINTENANCE_TASK_INTERVAL); PersonalAccessTokenValidityWarningTask.DEFAULT_MAINTENANCE_TASK_INTERVAL);
} }
// if (false == isTaskConfigured(tasks, XLSImporterWarmupTask.class))
// {
// tasks = addTask(tasks,
// XLSImporterWarmupTask.class,
// XLSImporterWarmupTask.DEFAULT_MAINTENANCE_TASK_NAME,
// true,
// XLSImporterWarmupTask.DEFAULT_MAINTENANCE_TASK_INTERVAL);
// }
plugins = MaintenanceTaskUtils.startupMaintenancePlugins(tasks); plugins = MaintenanceTaskUtils.startupMaintenancePlugins(tasks);
} }
......
...@@ -131,6 +131,9 @@ public interface ISampleDAO extends IGenericDAO<SamplePE> ...@@ -131,6 +131,9 @@ public interface ISampleDAO extends IGenericDAO<SamplePE>
/** Returns ids of samples connected with experiments specified by given ids. */ /** Returns ids of samples connected with experiments specified by given ids. */
List<TechId> listSampleIdsByExperimentIds(Collection<TechId> experimentIds); List<TechId> listSampleIdsByExperimentIds(Collection<TechId> experimentIds);
/** Returns ids of samples connected with projects specified by given ids. */
List<TechId> listSampleIdsByProjectIds(Collection<TechId> projectIds);
/** Returns ids of sample of specified types specified by given ids. */ /** Returns ids of sample of specified types specified by given ids. */
List<TechId> listSampleIdsBySampleTypeIds(Collection<TechId> sampleTypeIds); List<TechId> listSampleIdsBySampleTypeIds(Collection<TechId> sampleTypeIds);
......
...@@ -809,6 +809,13 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> ...@@ -809,6 +809,13 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE>
return listSampleIdsByColumn("experimentInternal.id", longIds, "samples for given experiments"); return listSampleIdsByColumn("experimentInternal.id", longIds, "samples for given experiments");
} }
@Override
public List<TechId> listSampleIdsByProjectIds(final Collection<TechId> projects)
{
final List<Long> longIds = TechId.asLongs(projects);
return listSampleIdsByColumn("projectInternal.id", longIds, "samples for given projects");
}
private List<TechId> listSampleIdsByColumn(String columnName, final List<Long> longIds, String message) private List<TechId> listSampleIdsByColumn(String columnName, final List<Long> longIds, String message)
{ {
final List<Long> results = final List<Long> results =
......
package ch.systemsx.cisd.openbis.generic.server.task;
import ch.ethz.sis.openbis.generic.server.asapi.v3.IApplicationServerInternalApi;
import ch.ethz.sis.openbis.generic.server.xls.importer.ImportOptions;
import ch.ethz.sis.openbis.generic.server.xls.importer.XLSImport;
import ch.ethz.sis.openbis.generic.server.xls.importer.enums.ImportModes;
import ch.systemsx.cisd.openbis.generic.server.CommonServiceProvider;
import java.util.Map;
import java.util.Properties;
public class XLSImporterWarmupTask extends AbstractGroupMaintenanceTask {
public static String DEFAULT_MAINTENANCE_TASK_NAME = "xls-importer-warmup-task";
public static final int DEFAULT_MAINTENANCE_TASK_INTERVAL = 24 * 60 * 60;
XLSImporterWarmupTask(boolean configMandatory) {
super(configMandatory);
}
@Override
public void execute() {
ImportOptions options = new ImportOptions();
IApplicationServerInternalApi api = CommonServiceProvider.getApplicationServerApi();
XLSImport importXls = new XLSImport(null, api, Map.of(), ImportModes.UPDATE_IF_EXISTS, options, "DEFAULT");
}
@Override
protected void setUpSpecific(Properties properties) {
}
}
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