Revision 1cc6cd7b
Added by Andreas Müller almost 6 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java | ||
---|---|---|
825 | 825 |
if (config.getNewSecundum() != null){ |
826 | 826 |
newSec = refService.load(config.getNewSecundum().getUuid()); |
827 | 827 |
} |
828 |
if (subTree != null){ |
|
829 |
subTreeIndex = TreeIndex.NewInstance(subTree.treeIndex()); |
|
830 |
Long count = dao.countChildrenOf(subTree, subTree.getClassification(), true); |
|
831 |
int intCount = count.intValue(); |
|
832 |
monitor.beginTask("Update Secundum Reference", intCount); |
|
833 |
} |
|
834 |
|
|
835 | 828 |
|
836 | 829 |
if (config.getSubtreeUuid() == null){ |
837 | 830 |
result.setError(); |
... | ... | |
845 | 838 |
result.addException(new NullPointerException("Subtree does not exist")); |
846 | 839 |
monitor.done(); |
847 | 840 |
return result; |
841 |
}else{ |
|
842 |
subTreeIndex = TreeIndex.NewInstance(subTree.treeIndex()); |
|
843 |
int count = config.isIncludeAcceptedTaxa() ? dao.countSecundumForSubtreeAcceptedTaxa(subTreeIndex, newSec, config.isOverwriteExistingAccepted(), config.isIncludeSharedTaxa(), config.isEmptySecundumDetail()):0; |
|
844 |
count += config.isIncludeSynonyms() ? dao.countSecundumForSubtreeSynonyms(subTreeIndex, newSec, config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa() , config.isEmptySecundumDetail()) :0; |
|
845 |
// Long count = dao.countChildrenOf(subTree, subTree.getClassification(), true); |
|
846 |
monitor.beginTask("Update Secundum Reference", count); |
|
848 | 847 |
} |
849 | 848 |
|
850 |
|
|
851 | 849 |
//Reference ref = config.getNewSecundum(); |
852 | 850 |
if (config.isIncludeAcceptedTaxa()){ |
853 | 851 |
monitor.subTask("Update Accepted Taxa"); |
854 | 852 |
|
855 |
Set<TaxonBase> updatedTaxa = dao.setSecundumForSubtreeAcceptedTaxa(subTreeIndex, newSec, config.isOverwriteExistingAccepted(), config.isIncludeSharedTaxa(), config.isEmptySecundumDetail()); |
|
853 |
Set<TaxonBase> updatedTaxa = dao.setSecundumForSubtreeAcceptedTaxa(subTreeIndex, newSec, config.isOverwriteExistingAccepted(), config.isIncludeSharedTaxa(), config.isEmptySecundumDetail(), monitor);
|
|
856 | 854 |
result.addUpdatedObjects(updatedTaxa); |
857 | 855 |
} |
858 | 856 |
if (config.isIncludeSynonyms()){ |
859 | 857 |
monitor.subTask("Update Synonyms"); |
860 |
Set<TaxonBase> updatedSynonyms = dao.setSecundumForSubtreeSynonyms(subTreeIndex, newSec, config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa() , config.isEmptySecundumDetail()); |
|
858 |
Set<TaxonBase> updatedSynonyms = dao.setSecundumForSubtreeSynonyms(subTreeIndex, newSec, config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa() , config.isEmptySecundumDetail(), monitor);
|
|
861 | 859 |
result.addUpdatedObjects(updatedSynonyms); |
862 | 860 |
} |
863 | 861 |
|
... | ... | |
897 | 895 |
|
898 | 896 |
if (includeAcceptedTaxa){ |
899 | 897 |
monitor.subTask("Update Accepted Taxa"); |
900 |
Set<TaxonBase> updatedTaxa = dao.setPublishForSubtreeAcceptedTaxa(subTreeIndex, publish, includeSharedTaxa); |
|
898 |
Set<TaxonBase> updatedTaxa = dao.setPublishForSubtreeAcceptedTaxa(subTreeIndex, publish, includeSharedTaxa, monitor);
|
|
901 | 899 |
// taxonService.saveOrUpdate(updatedTaxa); |
902 | 900 |
result.addUpdatedObjects(updatedTaxa); |
903 | 901 |
} |
904 | 902 |
if (includeSynonyms){ |
905 | 903 |
monitor.subTask("Update Synonyms"); |
906 |
Set<TaxonBase> updatedSynonyms = dao.setPublishForSubtreeSynonyms(subTreeIndex, publish, includeSharedTaxa); |
|
904 |
Set<TaxonBase> updatedSynonyms = dao.setPublishForSubtreeSynonyms(subTreeIndex, publish, includeSharedTaxa, monitor);
|
|
907 | 905 |
// taxonService.saveOrUpdate(updatedSynonyms); |
908 | 906 |
result.addUpdatedObjects(updatedSynonyms); |
909 | 907 |
} |
Also available in: Unified diff
ref #6359, ref #3740 (setSubtree) add progress monitor progress computation, first version of partitioning