diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java index 66d29d7b487b4d52a57d90b6b81f730c0cf22cd7..6a90d49b85968868b002b03bbbf0ca546cc11d15 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java @@ -131,8 +131,7 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements List<String> notAvailableDatasets = new ArrayList<String>(); for (DataPE dataSet : datasets) { - if (dataSet.isExternalData() == false - || dataSet.tryAsExternalData().getStatus().isAvailable() == false) + if (dataSet.isAvailable() == false) { notAvailableDatasets.add(dataSet.getCode()); } @@ -159,9 +158,7 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements List<String> notDeletableDatasets = new ArrayList<String>(); for (DataPE dataSet : datasets) { - // TODO 2011-05-16, Piotr Buczek: change this after deletion is implemented - if (dataSet.isExternalData() == false - || dataSet.tryAsExternalData().getStatus().isDeletable() == false) + if (dataSet.isDeletable() == false) { notDeletableDatasets.add(dataSet.getCode()); } @@ -242,7 +239,6 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements public void deleteLoadedDataSets(String reason) { - dataSets = loadContainedDataSetsRecursively(); assertDatasetsAreDeletable(dataSets); dataSets = sortTopologicallyByContainerRelationship(dataSets); @@ -267,34 +263,6 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements } } - private List<DataPE> loadContainedDataSetsRecursively() - { - Map<Long, DataPE> loadCache = new HashMap<Long, DataPE>(); - for (DataPE dataSet : dataSets) - { - loadContainedDataSetsInternal(dataSet, loadCache); - } - - return new ArrayList<DataPE>(loadCache.values()); - } - - private void loadContainedDataSetsInternal(DataPE dataSet, Map<Long /* id */, DataPE> loaded) - { - Long id = dataSet.getId(); - if (false == loaded.containsKey(id)) - { - loaded.put(id, dataSet); - if (dataSet.getContainedDataSets() != null) - { - for (DataPE containedDataSet : dataSet.getContainedDataSets()) - { - loadContainedDataSetsInternal(containedDataSet, loaded); - } - } - - } - } - private List<DataPE> sortTopologicallyByContainerRelationship(List<DataPE> datasets) { DAG<DataPE> dag = new DAG<DataPE>(datasets) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java index ef8e31f3cc57e9d7818e69c4be76e4239a4622ec..e0ce585d984113a32507bd8155c8ee2d78708ecd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java @@ -657,17 +657,6 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements @Transient public boolean isDeletable() { - if (containedDataSets != null) - { - for (DataPE containedDataSet : containedDataSets) - { - if (containedDataSet.isDeletable() == false) - { - return false; - } - } - - } return true; } } \ No newline at end of file