if (pRequest.getParameter("treeblockid") != null) {
String TBID = pRequest.getParameter("treeblockid");
Long value = Long.parseLong(TBID);
TreeBlock TB = getPhyloTreeHome().findTreeBlockById(value);
if (TB.getTitle().startsWith("Tree")) {
newickStringName = TB.getTitle();
} else {
newickStringName = "Tree Block: " + TB.getTitle();
}
for (PhyloTree aTree : TB.getTreeList()) {
treeMap.put(getMapKey(aTree), aTree.getId() + separator + aTree.getNewickString()
+ separator + "T");
phylowsMap.put(getMapKey(aTree), aTree.getTreebaseIDString().getNamespacedGUID().toString());
if ( defaultNewick.equals("") ) {
defaultNewick = aTree.getNewickString();
}
treeList.add(aTree);
}
// XXX ok, so this mess started when we somehow combined phylowidget for searching
// with phylowidget for submission (why???) -- rvosa
if ( TB.getTreeListIterator().hasNext() ) {
Study study = TB.getTreeListIterator().next().getStudy();
if ( study != null && study.isPublished() ) {
pRequest.getSession().setAttribute("treeBlockID", TB.getId());
if ( TB.getTreeListIterator().hasNext() ) {
pRequest.getSession().setAttribute("studyID", study.getId());
}
}
}
}