From 5b0d061e4094e1a29085a3410667fd5e8bc1e000 Mon Sep 17 00:00:00 2001 From: tpylak <tpylak> Date: Wed, 8 Jun 2011 11:51:53 +0000 Subject: [PATCH] minor: add dataset code to the label SVN: 21649 --- .../detailviewers/utils/EntityTypeLabelUtils.java | 15 +++++++-------- .../utils/EntityTypeLabelUtilsTest.java | 12 +++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtils.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtils.java index 98dc8dd18e1..9968021cabf 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtils.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtils.java @@ -44,14 +44,13 @@ public class EntityTypeLabelUtils /** * Creates user friendly labels, e.g.<br> - * Raw (TIFF), 2011-05-30 12:34<br> - * Overview (JPG), 2011-05-30 12:34<br> + * Raw (TIFF), 2011-05-30, 12378612873681-12312<br> + * Overview (JPG), 2011-05-30, 12378612873681-12312<br> * <br> - * Features, 2011-05-30 12:34<br> - * Quality<br> - * Metadata, 2011-05-30 12:34<br> + * Features, 2011-05-30, 12378612873681-12312<br> + * Metadata, 2011-05-30, 12378612873681-12312<br> * <br> - * Hcs analysis cell classifications (MAT), 2011-05-30 12:34<br> + * Hcs analysis cell classifications (MAT), 2011-05-30, 12378612873681-12312<br> */ public static String createDatasetLabel(DatasetReference datasetReference, boolean withFileType) { @@ -65,13 +64,13 @@ public class EntityTypeLabelUtils { String typeLabel = getDatasetUserFriendlyTypeCode(datasetReference); String fileType = withFileType ? " (" + datasetReference.getFileTypeCode() + ")" : ""; - return typeLabel + fileType + ", " + registrationDate; + return typeLabel + fileType + ", " + registrationDate + ", " + datasetReference.getCode(); } private static String renderDate(DatasetReference datasetReference) { return DateRenderer.renderDate(datasetReference.getRegistrationDate(), - BasicConstant.DATE_WITH_SHORT_TIME); + BasicConstant.DATE_WITHOUT_TIME_FORMAT_PATTERN); } private static String getDatasetUserFriendlyTypeCode(DatasetReference datasetReference) diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtilsTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtilsTest.java index 271c6da2bf0..8178affe4bd 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtilsTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/utils/EntityTypeLabelUtilsTest.java @@ -33,9 +33,10 @@ public class EntityTypeLabelUtilsTest extends AssertJUnit @Test public void test() { - assertEquals("Raw (DAT), 2011-05-30 12:34", createLabel("HCS_IMAGE_RAW", true)); - assertEquals("Features, 2011-05-30 12:34", createLabel("HCS_ANALYSIS_WELL_FEATURES", false)); - assertEquals("Analysis cell classifications (DAT), 2011-05-30 12:34", + assertEquals("Raw (DAT), 2011-05-30, 123412342314-1234", createLabel("HCS_IMAGE_RAW", true)); + assertEquals("Features, 2011-05-30, 123412342314-1234", + createLabel("HCS_ANALYSIS_WELL_FEATURES", false)); + assertEquals("Analysis cell classifications (DAT), 2011-05-30, 123412342314-1234", createLabel("HCS_ANALYSIS_CELL_CLASSIFICATIONS", true)); } @@ -43,8 +44,9 @@ public class EntityTypeLabelUtilsTest extends AssertJUnit private String createLabel(String typeCode, boolean withFileType) { DatasetReference ref = - new DatasetReference(0, "code", typeCode, null, "DAT", null, null, null, null); - return EntityTypeLabelUtils.createDatasetLabel(ref, withFileType, "2011-05-30 12:34"); + new DatasetReference(0, "123412342314-1234", typeCode, null, "DAT", null, null, + null, null); + return EntityTypeLabelUtils.createDatasetLabel(ref, withFileType, "2011-05-30"); } } \ No newline at end of file -- GitLab