From 2e596dbed3efc87cf1927cbad5f6d34bb5ea3b93 Mon Sep 17 00:00:00 2001 From: izabel <izabel> Date: Fri, 3 Sep 2010 13:36:35 +0000 Subject: [PATCH] [LMS-1727] show material content properties in plate reviewer table SVN: 17709 --- .../dataaccess/db/DatabaseVersionHolder.java | 2 +- .../generic/shared/basic/dto/Material.java | 7 +++++ .../client/web/client/application/Dict.java | 2 ++ .../detailviewers/PlateMaterialReviewer.java | 5 ++-- .../PlateMaterialReviewerColDefKind.java | 26 +++++++++++++++++ .../client/web/public/screening-dictionary.js | 1 + .../logic/GenePlateLocationsLoader.java | 29 +++++++++++++++---- .../shared/basic/dto/WellContent.java | 7 +++-- 8 files changed, 68 insertions(+), 11 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseVersionHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseVersionHolder.java index 5620e784013..2980e7dcda0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseVersionHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseVersionHolder.java @@ -24,7 +24,7 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db; public final class DatabaseVersionHolder { /** Current version of the database. */ - private static final String DATABASE_VERSION = "055";// S87 + private static final String DATABASE_VERSION = "056";// S89 private DatabaseVersionHolder() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Material.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Material.java index 0fc24bfc278..1e268f15943 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Material.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Material.java @@ -126,4 +126,11 @@ public class Material extends CodeWithRegistration<Material> implements { return getIdentifier(); } + + @Override + public String toString() + { + return getIdentifier(); + } + } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java index 1ebed662693..af303183b0b 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java @@ -36,6 +36,8 @@ public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.clie public static final String WELL_CONTENT_MATERIAL_TYPE = "WELL_CONTENT_MATERIAL_TYPE"; + public static final String WELL_CONTENT_PROPERTIES = "WELL_CONTENT_PROPERTIES"; + public static final String PLATE = "PLATE"; public static final String WELL = "WELL"; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMaterialReviewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMaterialReviewer.java index bed0c97cd2b..31fc626feb6 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMaterialReviewer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMaterialReviewer.java @@ -56,8 +56,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityReference; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ClientPluginFactory; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator; @@ -289,7 +289,7 @@ public class PlateMaterialReviewer extends AbstractSimpleBrowserGrid<WellContent { public void handle(WellContent wellContent, boolean specialKeyPressed) { - EntityReference contentMaterial = wellContent.getMaterialContent(); + Material contentMaterial = wellContent.getMaterialContent(); ExperimentReference experiment = wellContent.getExperiment(); ExperimentSearchCriteria experimentCriteria = ExperimentSearchCriteria.createExperiment(experiment.getId(), @@ -353,6 +353,7 @@ public class PlateMaterialReviewer extends AbstractSimpleBrowserGrid<WellContent ColumnDefsAndConfigs<WellContent> schema = super.createColumnsDefinition(); setLinksRenderer(schema, new PlateMaterialReviewerColDefKind[] { PlateMaterialReviewerColDefKind.WELL_CONTENT_MATERIAL, + PlateMaterialReviewerColDefKind.WELL_CONTENT_MATERIAL, PlateMaterialReviewerColDefKind.PLATE, PlateMaterialReviewerColDefKind.WELL, PlateMaterialReviewerColDefKind.DATASET }); setImageRenderer(schema); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/PlateMaterialReviewerColDefKind.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/PlateMaterialReviewerColDefKind.java index 93365fe6143..c9bb8128f5e 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/PlateMaterialReviewerColDefKind.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ui/columns/specific/PlateMaterialReviewerColDefKind.java @@ -19,6 +19,8 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.AbstractColumnDefinitionKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.LinkExtractor; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetImagesReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; @@ -57,6 +59,30 @@ public enum PlateMaterialReviewerColDefKind implements IColumnDefinitionKind<Wel } }), + WELL_CONTENT_PROPERTIES(new AbstractColumnDefinitionKind<WellContent>( + Dict.WELL_CONTENT_PROPERTIES, true) + { + @Override + public String tryGetValue(WellContent entity) + { + + Material material = entity.getMaterialContent(); + String separator = " <br/> "; + StringBuilder sb = new StringBuilder(); + for (IEntityProperty p : material.getProperties()) + { + if (sb.length() != 0) + { + sb.append(separator); + } + sb.append(p.getPropertyType().getCode()); + sb.append(": "); + sb.append(p.tryGetAsString()); + } + return sb.toString(); + } + }), + EXPERIMENT(new AbstractColumnDefinitionKind<WellContent>(Dict.EXPERIMENT, true) { @Override diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js index 6f7cf905c6b..10038c31c45 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js @@ -44,6 +44,7 @@ var screening = { WELL_CONTENT_MATERIAL: "Content", WELL_CONTENT_MATERIAL_TYPE: "Content Type", + WELL_CONTENT_PROPERTIES: "Content Properties", PLATE_MATERIAL_REVIEWER_TITLE: "Wells Reviewing Panel", PLATE_MATERIAL_REVIEWER_HELP_INFO: "Specify a list of material codes contained in the wells (e.g. gene symbols, control names or compound names). Press the search button. The content of all wells in this experiment will be checked and wells containing specified materials will be shown.", PLATE_MATERIAL_REVIEWER_SPECIFY_METERIAL_ITEMS: "List of material codes contained in the wells (e.g. gene symbols, control names or compound names) separated by commas (\",\") or one code per line.", diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/GenePlateLocationsLoader.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/GenePlateLocationsLoader.java index 47f29b4b1e4..6030713c393 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/GenePlateLocationsLoader.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/GenePlateLocationsLoader.java @@ -36,6 +36,7 @@ import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.server.business.bo.common.DatabaseContextUtils; import ch.systemsx.cisd.openbis.generic.server.business.bo.datasetlister.IDatasetLister; +import ch.systemsx.cisd.openbis.generic.server.business.bo.materiallister.IMaterialLister; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; @@ -44,7 +45,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchField; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityReference; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialAttributeSearchFieldKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SearchCriteriaConnection; import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; @@ -386,17 +389,30 @@ public class GenePlateLocationsLoader wellLocations.add(convert(location)); } sortByMaterialName(wellLocations); + IMaterialLister materialLister = businessObjectFactory.createMaterialLister(session); + List<Material> containedMaterials = getMaterials(wellLocations); + materialLister.enrichWithProperties(containedMaterials); return wellLocations; } + private List<Material> getMaterials(List<WellContent> wellLocations) + { + List<Material> materials = new ArrayList<Material>(); + for (WellContent wc : wellLocations) + { + materials.add(wc.getMaterialContent()); + } + return materials; + } + private static void sortByMaterialName(List<? extends WellContent> wellLocations) { Collections.sort(wellLocations, new Comparator<WellContent>() { public int compare(WellContent o1, WellContent o2) { - EntityReference m1 = o1.getMaterialContent(); - EntityReference m2 = o2.getMaterialContent(); + Material m1 = o1.getMaterialContent(); + Material m2 = o2.getMaterialContent(); return m1.getCode().compareTo(m2.getCode()); } }); @@ -412,9 +428,12 @@ public class GenePlateLocationsLoader EntityReference plate = new EntityReference(loc.plate_id, loc.plate_code, loc.plate_type_code, EntityKind.SAMPLE, loc.plate_perm_id); - EntityReference materialContent = - new EntityReference(loc.material_content_id, loc.material_content_code, - loc.material_content_type_code, EntityKind.MATERIAL, null); + Material materialContent = new Material(); + materialContent.setCode(loc.material_content_code); + materialContent.setId(loc.material_content_id); + MaterialType type = new MaterialType(); + type.setCode(loc.material_content_type_code); + materialContent.setMaterialType(type); return new WellContent(location, well, plate, convertExperiment(loc), materialContent); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellContent.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellContent.java index 229f3468fb7..d5ae969848d 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellContent.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/WellContent.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityReference; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; /** * Describes the well and its location on the plate. Contains pointers to well and plate samples, a @@ -37,7 +38,7 @@ public class WellContent implements IsSerializable private ExperimentReference experiment; // a pointer to a material which was being searched for inside a well - private EntityReference materialContent; + private Material materialContent; // contains only images for this well, null if no images have been acquired private DatasetImagesReference imagesOrNull; @@ -49,7 +50,7 @@ public class WellContent implements IsSerializable } public WellContent(WellLocation locationOrNull, EntityReference well, EntityReference plate, - ExperimentReference experiment, EntityReference materialContent) + ExperimentReference experiment, Material materialContent) { this.locationOrNull = locationOrNull; this.well = well; @@ -73,7 +74,7 @@ public class WellContent implements IsSerializable return plate; } - public EntityReference getMaterialContent() + public Material getMaterialContent() { return materialContent; } -- GitLab