Skip to content
Snippets Groups Projects
Commit 2795e20f authored by felmer's avatar felmer
Browse files

SSDM-12051: Deletion DTO extended by attributes for total number of...

SSDM-12051: Deletion DTO extended by attributes for total number of experiments, samples and data sets. Implemented and tested in SearchDeletionTest
parent b6176ecf
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,7 @@ public class SearchDeletionExecutor implements ISearchDeletionExecutor ...@@ -101,7 +101,7 @@ public class SearchDeletionExecutor implements ISearchDeletionExecutor
private List<Deletion> listWithDeletedObjects(IOperationContext context) private List<Deletion> listWithDeletedObjects(IOperationContext context)
{ {
IDeletionTable deletionTable = businessObjectFactory.createDeletionTable(context.getSession()); IDeletionTable deletionTable = businessObjectFactory.createDeletionTable(context.getSession());
deletionTable.loadOriginal(); deletionTable.load(true);
return deletionTable.getDeletions(); return deletionTable.getDeletions();
} }
......
...@@ -69,6 +69,9 @@ public class DeletionTranslator extends ...@@ -69,6 +69,9 @@ public class DeletionTranslator extends
deletion.setReason(input.getReason()); deletion.setReason(input.getReason());
deletion.setDeletionDate(input.getRegistrationDate()); deletion.setDeletionDate(input.getRegistrationDate());
deletion.setFetchOptions(new DeletionFetchOptions()); deletion.setFetchOptions(new DeletionFetchOptions());
deletion.setTotalExperimentsCount(input.getTotalExperimentsCount());
deletion.setTotalSamplesCount(input.getTotalSamplesCount());
deletion.setTotalDataSetsCount(input.getTotalDatasetsCount());
return deletion; return deletion;
} }
......
...@@ -13,6 +13,9 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { ...@@ -13,6 +13,9 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
prototype.reason = null; prototype.reason = null;
prototype.deletedObjects = null; prototype.deletedObjects = null;
prototype.deletionDate = null; prototype.deletionDate = null;
prototype.totalExperimentsCount = null;
prototype.totalSamplesCount = null;
prototype.totalDataSetsCount = null;
prototype.getFetchOptions = function() { prototype.getFetchOptions = function() {
return this.fetchOptions; return this.fetchOptions;
}; };
...@@ -47,6 +50,24 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { ...@@ -47,6 +50,24 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
prototype.setDeletionDate = function(deletionDate) { prototype.setDeletionDate = function(deletionDate) {
this.deletionDate = deletionDate; this.deletionDate = deletionDate;
}; };
prototype.getTotalExperimentsCount = function() {
return this.totalExperimentsCount;
};
prototype.setTotalExperimentsCount = function(totalExperimentsCount) {
this.totalExperimentsCount = totalExperimentsCount;
};
prototype.getTotalSamplesCount = function() {
return this.totalSamplesCount;
};
prototype.setTotalSamplesCount = function(totalSamplesCount) {
this.totalSamplesCount = totalSamplesCount;
};
prototype.getTotalDataSetsCount = function() {
return this.totalSamplesCount;
};
prototype.setTotalDataSetsCount = function(totalDataSetsCount) {
this.totalDataSetsCount = totalDataSetsCount;
};
}, { }, {
fetchOptions : "DeletionFetchOptions", fetchOptions : "DeletionFetchOptions",
id : "IDeletionId", id : "IDeletionId",
......
...@@ -217,6 +217,9 @@ public class SearchDeletionTest extends AbstractDeletionTest ...@@ -217,6 +217,9 @@ public class SearchDeletionTest extends AbstractDeletionTest
Assert.assertEquals(deletionOptions.getReason(), latestDeletion.getReason()); Assert.assertEquals(deletionOptions.getReason(), latestDeletion.getReason());
Assert.assertEquals(1, latestDeletion.getDeletedObjects().size()); Assert.assertEquals(1, latestDeletion.getDeletedObjects().size());
Assert.assertEquals(experimentId, latestDeletion.getDeletedObjects().get(0).getId()); Assert.assertEquals(experimentId, latestDeletion.getDeletedObjects().get(0).getId());
Assert.assertEquals(1, latestDeletion.getTotalExperimentsCount());
Assert.assertEquals(1, latestDeletion.getTotalSamplesCount());
Assert.assertEquals(0, latestDeletion.getTotalDataSetsCount());
assertDeletionDate(latestDeletion); assertDeletionDate(latestDeletion);
} }
......
...@@ -48,6 +48,15 @@ public class Deletion implements Serializable ...@@ -48,6 +48,15 @@ public class Deletion implements Serializable
@JsonProperty @JsonProperty
private Date deletionDate; private Date deletionDate;
@JsonProperty
private int totalSamplesCount;
@JsonProperty
private int totalDataSetsCount;
@JsonProperty
private int totalExperimentsCount;
// Method automatically generated with DtoGenerator // Method automatically generated with DtoGenerator
@JsonIgnore @JsonIgnore
public DeletionFetchOptions getFetchOptions() public DeletionFetchOptions getFetchOptions()
...@@ -87,6 +96,39 @@ public class Deletion implements Serializable ...@@ -87,6 +96,39 @@ public class Deletion implements Serializable
this.reason = reason; this.reason = reason;
} }
@JsonIgnore
public int getTotalSamplesCount()
{
return totalSamplesCount;
}
public void setTotalSamplesCount(int totalSamplesCount)
{
this.totalSamplesCount = totalSamplesCount;
}
@JsonIgnore
public int getTotalDataSetsCount()
{
return totalDataSetsCount;
}
public void setTotalDataSetsCount(int totalDataSetsCount)
{
this.totalDataSetsCount = totalDataSetsCount;
}
@JsonIgnore
public int getTotalExperimentsCount()
{
return totalExperimentsCount;
}
public void setTotalExperimentsCount(int totalExperimentsCount)
{
this.totalExperimentsCount = totalExperimentsCount;
}
// Method automatically generated with DtoGenerator // Method automatically generated with DtoGenerator
@JsonIgnore @JsonIgnore
public List<DeletedObject> getDeletedObjects() public List<DeletedObject> getDeletedObjects()
......
...@@ -2549,3 +2549,10 @@ set Force Deletion Of Dependent Deletions ...@@ -2549,3 +2549,10 @@ set Force Deletion Of Dependent Deletions
get Entity Type Code get Entity Type Code
set Entity Type Code set Entity Type Code
get Total Data Sets Count
get Total Experiments Count
get Total Samples Count
set Total Data Sets Count
set Total Experiments Count
set Total Samples Count
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