Fixes bug on DMP editor model exposing deleted Datasets.

This commit is contained in:
gkolokythas 2019-06-20 13:33:10 +03:00
parent e39e0df143
commit 4d9ae93cf2
1 changed files with 1 additions and 14 deletions

View File

@ -220,21 +220,8 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(datasetProfile);
this.profiles.add(associatedProfile);
}
/*Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps());
Element item = (Element) viewStyleDoc.getElementsByTagName("profiles").item(0);
this.profiles = new LinkedList<>();
if (item != null) {
NodeList associatedProfilesElement = item.getChildNodes();
for (int temp = 0; temp < associatedProfilesElement.getLength(); temp++) {
Node associatedProfileElement = associatedProfilesElement.item(temp);
if (associatedProfileElement.getNodeType() == Node.ELEMENT_NODE) {
this.profiles.add(new AssociatedProfile().fromXml((Element) associatedProfileElement));
}
}
}*/
}
this.datasets = entity.getDataset().stream().map(item -> new DatasetListingModel().fromDataModel(item)).collect(Collectors.toList());
this.datasets = entity.getDataset().stream().filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue())).map(x-> new DatasetListingModel().fromDataModel(x)).collect(Collectors.toList());
this.modified = entity.getModified();
this.created = entity.getCreated();
this.description = entity.getDescription();