diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java index bb2a43b6036f30782ae5d877863993001c48eb65..f7874d1d8683a1a7aad4571c7904a38143865de0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java @@ -33,6 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.RealNumberRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionUI; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.LinkExtractor; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractBrowserGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ColumnDefsAndConfigs; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; @@ -79,9 +80,10 @@ public abstract class TypedTableGrid<T extends IsSerializable> this.header = header; } - public String tryGetLink(T entity) + public String tryGetLink(T entity, final ISerializableComparable value) { - return null; // FIXME LMS-1848 + return (value == null) ? null : LinkExtractor.createPermlink(entityKind, + value.toString()); } public void handle(TableModelRowWithObject<T> rowItem, boolean specialKeyPressed) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGridColumnDefinitionUI.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGridColumnDefinitionUI.java index 9f11712cc4245d05e7258f5dd9bacb6ce699182b..65b848525f5a04a1d36e571fa80feb19f0f2f275 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGridColumnDefinitionUI.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGridColumnDefinitionUI.java @@ -22,19 +22,19 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.TypedTableGridColumnDefinition; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ILinkGenerator; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * - * * @author Franz-Josef Elmer */ public class TypedTableGridColumnDefinitionUI<T extends IsSerializable> extends - TypedTableGridColumnDefinition<T> implements IColumnDefinitionUI<TableModelRowWithObject<T>> + TypedTableGridColumnDefinition<T> implements + IColumnDefinitionUI<TableModelRowWithObject<T>> { private transient final ILinkGenerator<T> linkGeneratorOrNull; - + private boolean hidden; public TypedTableGridColumnDefinitionUI(TableModelColumnHeader header, String title, @@ -54,7 +54,7 @@ public class TypedTableGridColumnDefinitionUI<T extends IsSerializable> extends { this(null, null, null, null, null); } - + public int getWidth() { return header.getDefaultColumnWidth(); @@ -81,8 +81,9 @@ public class TypedTableGridColumnDefinitionUI<T extends IsSerializable> extends { return null; } - T objectOrNull = entity.getObjectOrNull(); - return objectOrNull == null ? null : linkGeneratorOrNull.tryGetLink(objectOrNull); + final ISerializableComparable value = entity.getValues().get(header.getIndex()); + final T objectOrNull = entity.getObjectOrNull(); + return objectOrNull == null ? null : linkGeneratorOrNull.tryGetLink(objectOrNull, value); } public boolean isNumeric() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java index 144a622886ff1f35d8c8729fdb1d49b78a4f0964..46edb0046eab59031c818fd35d15446b54642857 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java @@ -105,14 +105,20 @@ public class LinkExtractor return tryExtractMaterial(entityOrNull); } else { - URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, entityOrNull - .getEntityKind().name()); - url.addParameter(PermlinkUtilities.PERM_ID_PARAMETER_KEY, entityOrNull.getPermId()); - return tryPrint(url); + return createPermlink(entityOrNull.getEntityKind(), entityOrNull.getPermId()); } } + /** creates permid for entities other than material */ + public static String createPermlink(EntityKind entityKind, String permId) + { + assert entityKind != EntityKind.MATERIAL; + URLMethodWithParameters url = new URLMethodWithParameters(""); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, entityKind.name()); + url.addParameter(PermlinkUtilities.PERM_ID_PARAMETER_KEY, permId); + return tryPrint(url); + } + public static final String tryExtract(Project p) { if (p == null) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ILinkGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ILinkGenerator.java index 76bd185a38fe45b5d51465f126bd4d2e00176e89..05e3c2f333728d4bd4ef4a1a1445cfb84e6fdf3a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ILinkGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ILinkGenerator.java @@ -18,12 +18,12 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid; import com.google.gwt.user.client.rpc.IsSerializable; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; + /** - * - * * @author Franz-Josef Elmer */ public interface ILinkGenerator<T extends IsSerializable> { - public String tryGetLink(T entity); + public String tryGetLink(T entity, ISerializableComparable comparableValue); } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java index 940cf861f17128e2fc8886781c412911cb299342..c39877914e985460e0623f50fe35ad54a84f1486 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/RawDataSampleGrid.java @@ -37,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteri import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; @@ -53,7 +54,8 @@ class RawDataSampleGrid extends TypedTableGrid<Sample> final IViewContext<IPhosphoNetXClientServiceAsync> viewContext) { RawDataSampleGrid grid = new RawDataSampleGrid(viewContext); - DisposableEntityChooser<TableModelRowWithObject<Sample>> disposable = grid.asDisposableWithoutToolbar(); + DisposableEntityChooser<TableModelRowWithObject<Sample>> disposable = + grid.asDisposableWithoutToolbar(); return new DatabaseModificationAwareComponent(disposable.getComponent(), disposable); } @@ -80,7 +82,7 @@ class RawDataSampleGrid extends TypedTableGrid<Sample> linkMSInjectionSample(); linkBiologicalSample(); } - + private void linkMSInjectionSample() { registerListenerAndLinkGenerator(RawDataSampleGridIDs.CODE, @@ -94,10 +96,11 @@ class RawDataSampleGrid extends TypedTableGrid<Sample> specialKeyPressed); } - public String tryGetLink(Sample entity) + public String tryGetLink(Sample entity, ISerializableComparable value) { return LinkExtractor.tryExtract(entity); } + }); } @@ -114,7 +117,8 @@ class RawDataSampleGrid extends TypedTableGrid<Sample> .getGeneratedFrom(), false, specialKeyPressed); } - public String tryGetLink(Sample entity) + public String tryGetLink(Sample entity, + ISerializableComparable comparableValue) { return LinkExtractor.tryExtract(entity.getGeneratedFrom()); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java index c4c4862758a200900a72895a4e9af3a3d572ab52..347e2cab3e1f8ee9c402435ba58972043f1f9ddb 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java @@ -38,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSe import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningDisplayTypeIDGenerator; @@ -53,7 +54,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellMetadata; public class PlateMetadataBrowser extends TypedTableGrid<WellMetadata> { public static final String BROWSER_ID = GenericConstants.ID_PREFIX + "plate_metadata_browser"; - + /** * Fetches information about the plate with the specified plate id and opens plate metadata * browser tab for that plate. @@ -155,7 +156,7 @@ public class PlateMetadataBrowser extends TypedTableGrid<WellMetadata> .getWellSample(), false, specialKeyPressed); } - public String tryGetLink(WellMetadata entity) + public String tryGetLink(WellMetadata entity, ISerializableComparable value) { return LinkExtractor.tryExtract(entity.getWellSample()); } @@ -171,7 +172,8 @@ public class PlateMetadataBrowser extends TypedTableGrid<WellMetadata> } @Override - protected void prepareExportEntities(TableExportCriteria<TableModelRowWithObject<WellMetadata>> exportCriteria, + protected void prepareExportEntities( + TableExportCriteria<TableModelRowWithObject<WellMetadata>> exportCriteria, AbstractAsyncCallback<String> callback) { screeningViewContext.getService().prepareExportPlateMetadata(exportCriteria, callback); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java index be86515cb8f507f864b634ca71c4c5dc7a6585f6..24ebb2131f395b2f784df46e54a55dd47b93a6ce 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java @@ -67,6 +67,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWit import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; @@ -247,7 +248,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WELL_CONTENT_MATERIAL, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { Material material = entity.getMaterialContent(); String experimentIdentifier = @@ -279,7 +280,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WellSearchGridColumnIds.EXPERIMENT, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { return LinkExtractor.tryExtract(entity.getExperiment()); } @@ -298,7 +299,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WellSearchGridColumnIds.PLATE, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { return LinkExtractor.tryExtract(entity.getPlate()); } @@ -317,7 +318,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WellSearchGridColumnIds.WELL, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { return LinkExtractor.tryExtract(entity.getWell()); } @@ -336,7 +337,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WellSearchGridColumnIds.IMAGE_DATA_SET, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { DatasetImagesReference imageDataset = entity.tryGetImageDataset(); if (imageDataset != null) @@ -366,7 +367,7 @@ public class WellSearchGrid extends TypedTableGrid<WellContent> registerListenerAndLinkGenerator(WellSearchGridColumnIds.IMAGE_ANALYSIS_DATA_SET, new ICellListenerAndLinkGenerator<WellContent>() { - public String tryGetLink(WellContent entity) + public String tryGetLink(WellContent entity, ISerializableComparable value) { DatasetReference dataset = entity.tryGetFeatureVectorDataset(); if (dataset != null)