Skip to content
Snippets Groups Projects
Commit 43a33df1 authored by buczekp's avatar buczekp
Browse files

[LMS-1123] fixed sample identifier of samples with container in sample browsers

SVN: 12703
parent fb8236b7
No related branches found
No related tags found
No related merge requests found
...@@ -326,7 +326,6 @@ final class SampleListingWorker ...@@ -326,7 +326,6 @@ final class SampleListingWorker
sampleTypes.put(type.getId(), type); sampleTypes.put(type.getId(), type);
if (singleSampleTypeMode == false) if (singleSampleTypeMode == false)
{ {
// TODO 2009-09-24, Piotr Buczek: use to display all parents
maxSampleContainerResolutionDepth = maxSampleContainerResolutionDepth =
Math.max(maxSampleContainerResolutionDepth, type Math.max(maxSampleContainerResolutionDepth, type
.getContainerHierarchyDepth()); .getContainerHierarchyDepth());
...@@ -629,6 +628,24 @@ final class SampleListingWorker ...@@ -629,6 +628,24 @@ final class SampleListingWorker
record.sample.setContainer(container); record.sample.setContainer(container);
record.sample.setCode(IdentifierHelper.convertCode(record.sample.getSubCode(), record.sample.setCode(IdentifierHelper.convertCode(record.sample.getSubCode(),
container.getCode())); container.getCode()));
updateSampleIdentifier(record.sample);
} }
} }
private void updateSampleIdentifier(Sample sample)
{
SampleIdentifier identifier;
if (sample.getDatabaseInstance() != null)
{
final DatabaseInstanceIdentifier dbId =
new DatabaseInstanceIdentifier(databaseInstance.getCode());
identifier = new SampleIdentifier(dbId, sample.getCode());
} else
{
final GroupIdentifier groupId =
new GroupIdentifier(databaseInstance.getCode(), sample.getGroup().getCode());
identifier = new SampleIdentifier(groupId, sample.getCode());
}
sample.setIdentifier(identifier.toString());
}
} }
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