Skip to content
Snippets Groups Projects
Commit 5b0d061e authored by tpylak's avatar tpylak
Browse files

minor: add dataset code to the label

SVN: 21649
parent de757496
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
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