Revision: 828
http://treebase.svn.sourceforge.net/treebase/?rev=828&view=rev
Author: hshyket
Date: 2011-05-05 14:29:07 +0000 (Thu, 05 May 2011)
Log Message:
-----------
Fixing issue where matrices and trees were appearing that had unpublished studies. This was happening after doing a taxa search and moving over to the matrix or tree search tabs.
Modified Paths:
--------------
trunk/treebase-core/src/main/java/org/cipres/treebase/domain/search/TaxonSearchResults.java
Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/search/TaxonSearchResults.java
===================================================================
--- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/search/TaxonSearchResults.java 2011-05-04 18:02:23 UTC (rev 827)
+++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/search/TaxonSearchResults.java 2011-05-05 14:29:07 UTC (rev 828)
@@ -34,6 +34,17 @@
for (Taxon m : getResults()) {
matrices.addAll(getTaxonLabelService().findMatrices(m));
}
+
+ // XXX need to filter out orphaned matrices or matrices whose studies are unpublished
+ Collection<Matrix> orphanedMatrices = new HashSet<Matrix>();
+ for ( Matrix mat : matrices ) {
+ if ( mat.getStudy() == null || (mat.getStudy().isPublished() == false) ) {
+ orphanedMatrices.add(mat);
+ }
+ }
+
+ matrices.removeAll(orphanedMatrices);
+
return new MatrixSearchResults(matrices);
}
@@ -60,6 +71,17 @@
for (Taxon t : getResults()) {
trees.addAll(getTaxonLabelService().findTrees(t));
}
+
+ // XXX need to filter out orphaned matrices or matrices whose studies are unpublished
+ Collection<PhyloTree> orphanedTrees = new HashSet<PhyloTree>();
+ for ( PhyloTree tree : trees ) {
+ if (tree.getStudy() == null || (tree.getStudy().isPublished() == false)){
+ orphanedTrees.add(tree);
+ }
+ }
+
+ trees.removeAll(orphanedTrees);
+
return new TreeSearchResults(trees);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|