Skip to content
Snippets Groups Projects
Commit 9ba7d94d authored by tpylak's avatar tpylak
Browse files

fix NPE

SVN: 22190
parent 7ea81cc9
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellFeatureVec ...@@ -73,6 +73,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellFeatureVec
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellReplicaImage; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellReplicaImage;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.AnalysisProcedureCriteria;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.ExperimentSearchCriteria;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.MaterialSearchCodesCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.MaterialSearchCodesCriteria;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.MaterialSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellSearchCriteria.MaterialSearchCriteria;
...@@ -357,7 +358,8 @@ public class WellContentLoader extends AbstractContentLoader ...@@ -357,7 +358,8 @@ public class WellContentLoader extends AbstractContentLoader
{ {
Set<PlateIdentifier> plates = extractPlates(locations); Set<PlateIdentifier> plates = extractPlates(locations);
// TODO KE: 2011-07-15 add analysis procedure support here // TODO KE: 2011-07-15 add analysis procedure support here
return createFeatureVectorDatasetsRetriever(plates, null); return createFeatureVectorDatasetsRetriever(plates,
AnalysisProcedureCriteria.createAllProcedures());
} }
private static Collection<ExternalData> selectChildlessImageDatasets( private static Collection<ExternalData> selectChildlessImageDatasets(
...@@ -743,7 +745,7 @@ public class WellContentLoader extends AbstractContentLoader ...@@ -743,7 +745,7 @@ public class WellContentLoader extends AbstractContentLoader
SingleExperimentSearchCriteria experimentOrNull = experimentCriteria.tryGetExperiment(); SingleExperimentSearchCriteria experimentOrNull = experimentCriteria.tryGetExperiment();
BasicProjectIdentifier projectOrNull = experimentCriteria.tryGetProjectIdentifier(); BasicProjectIdentifier projectOrNull = experimentCriteria.tryGetProjectIdentifier();
IScreeningQuery dao = createDAO(); IScreeningQuery dao = getScreeningDAO();
if (materialSearchCriteria.tryGetMaterialCodesOrProperties() != null) if (materialSearchCriteria.tryGetMaterialCodesOrProperties() != null)
{ {
MaterialSearchCodesCriteria codesCriteria = MaterialSearchCodesCriteria codesCriteria =
...@@ -882,7 +884,7 @@ public class WellContentLoader extends AbstractContentLoader ...@@ -882,7 +884,7 @@ public class WellContentLoader extends AbstractContentLoader
private List<WellContent> loadLocations(TechId geneMaterialId, TechId experimentId) private List<WellContent> loadLocations(TechId geneMaterialId, TechId experimentId)
{ {
DataIterator<WellContentQueryResult> locations = DataIterator<WellContentQueryResult> locations =
createDAO().getPlateLocationsForMaterialId(geneMaterialId.getId(), getScreeningDAO().getPlateLocationsForMaterialId(geneMaterialId.getId(),
experimentId.getId()); experimentId.getId());
return convert(locations); return convert(locations);
...@@ -891,23 +893,18 @@ public class WellContentLoader extends AbstractContentLoader ...@@ -891,23 +893,18 @@ public class WellContentLoader extends AbstractContentLoader
private List<WellContent> loadLocations(TechId geneMaterialId) private List<WellContent> loadLocations(TechId geneMaterialId)
{ {
DataIterator<WellContentQueryResult> locations = DataIterator<WellContentQueryResult> locations =
createDAO().getPlateLocationsForMaterialId(geneMaterialId.getId()); getScreeningDAO().getPlateLocationsForMaterialId(geneMaterialId.getId());
return convert(locations); return convert(locations);
} }
private List<WellContent> loadLocationsForProject(TechId geneMaterialId, TechId projectId) private List<WellContent> loadLocationsForProject(TechId geneMaterialId, TechId projectId)
{ {
DataIterator<WellContentQueryResult> locations = DataIterator<WellContentQueryResult> locations =
createDAO().getPlateLocationsForMaterialAndProjectIds(geneMaterialId.getId(), getScreeningDAO().getPlateLocationsForMaterialAndProjectIds(geneMaterialId.getId(),
projectId.getId()); projectId.getId());
return convert(locations); return convert(locations);
} }
private IScreeningQuery createDAO()
{
return createDAO(daoFactory);
}
private List<WellContent> convert(Iterable<WellContentQueryResult> queryResults) private List<WellContent> convert(Iterable<WellContentQueryResult> queryResults)
{ {
List<WellContent> wellContents = convertAndRemoveDuplicateWells(queryResults); List<WellContent> wellContents = convertAndRemoveDuplicateWells(queryResults);
...@@ -955,16 +952,15 @@ public class WellContentLoader extends AbstractContentLoader ...@@ -955,16 +952,15 @@ public class WellContentLoader extends AbstractContentLoader
private static WellContent convert(WellContentQueryResult well) private static WellContent convert(WellContentQueryResult well)
{ {
WellLocation location =
ScreeningUtils.tryCreateLocationFromMatrixCoordinate(well.well_code);
EntityReference wellReference = EntityReference wellReference =
new EntityReference(well.well_id, well.well_code, well.well_type_code, new EntityReference(well.well_id, well.well_code, well.well_type_code,
EntityKind.SAMPLE, well.well_perm_id); EntityKind.SAMPLE, well.well_perm_id);
EntityReference plate = EntityReference plate =
new EntityReference(well.plate_id, well.plate_code, well.plate_type_code, new EntityReference(well.plate_id, well.plate_code, well.plate_type_code,
EntityKind.SAMPLE, well.plate_perm_id); EntityKind.SAMPLE, well.getPlatePermId());
return new WellContent(location, wellReference, plate, convertExperiment(well)); WellLocation wellLocation = well.getWellReference().getWellLocation();
return new WellContent(wellLocation, wellReference, plate, convertExperiment(well));
} }
private static ExperimentReference convertExperiment(WellContentQueryResult loc) private static ExperimentReference convertExperiment(WellContentQueryResult loc)
......
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