Package org.cipres.treebase.domain.tree

Examples of org.cipres.treebase.domain.tree.TreeBlock


        ndw.fromTreeBaseToXml(treeResults);
        builder.append(doc.getXmlString());
      }
      else {
        Set<PhyloTree> trees =  treeResults.getResults();
        TreeBlock treeBlock = new TreeBlock();
        TaxonLabelSet taxonLabelSet = new TaxonLabelSet();
        List<String> taxonLabels = new ArrayList<String>();

       
        for (PhyloTree pTree : trees) {
          for (TaxonLabel pTaxLabel : pTree.getTreeBlock().getTaxonLabelList()) {
            if (! taxonLabels.contains(pTaxLabel.getTaxonLabel())) {
              taxonLabelSet.addPhyloTaxonLabel(pTaxLabel);
              taxonLabels.add(pTaxLabel.getTaxonLabel());       
            }
          }
          treeBlock.addPhyloTree(pTree)
        }
       
        treeBlock.setTaxonLabelSet(taxonLabelSet);
        taxonLabelSet.setTitle("TB" + date.getTime());

       
        builder.append("#NEXUS\n\n");
     
        taxonLabelSet.buildNexusBlockTaxa(builder, true, false);
     
        treeBlock.generateAFileDynamicallyNoTranslate(builder);
        fileName += ".nex";
      }
     
        String downloadDirName = request.getSession().getServletContext().getRealPath(
          TreebaseUtil.FILESEP + "NexusFileDownload")
View Full Code Here


    BindException bindExp) throws Exception {

    boolean test = false;

    String username = request.getRemoteUser();
    TreeBlock atreeblock = (TreeBlock) command;

    if (request.getParameter("treeblockid") != null) {

      Long submission_id = getSubmissionHome().findByTreeBlock(atreeblock).getId();
View Full Code Here

  protected Object formBackingObject(HttpServletRequest request) {

    if (request.getParameter("treeblockid") != null) {

      Long treeBlockID = Long.parseLong(request.getParameter("treeblockid"));
      TreeBlock pTreeBlock = getPhyloTreeHome().findTreeBlockById(treeBlockID);

      return pTreeBlock;
    } else {
      return null;
    }
View Full Code Here

    Map<String,String> referenceMap = new HashMap<String,String>();
    referenceMap.put("deleteelementtype", "Delete this particular TreeBlock");

    Long treeBlockID = Long.parseLong(request.getParameter("treeblockid"));
    TreeBlock pTreeBlock = getPhyloTreeHome().findTreeBlockById(treeBlockID);

    Collection<PhyloTree> pTreeCollection = pTreeBlock.getTreeList();
   
    for (PhyloTree pTree : pTreeCollection) {
      /*if (pTree.getStudy() != null) { // It means this tree is tied to analysis step
        setTestVariable(true);
        referenceMap
          .put(
            "generalmessage",
            "Either this TreeBlock or atleast one of the Tree in this Block is tied to an Analysis Step.");
        break; // Even if one tree of the block is ties to Analysis step, we can exit the
        // for loop.
      }*/
 
      for (Analysis analysis : pTree.getStudy().getAnalyses()) {
       
        List<AnalysisStep> analysisStepList = analysis.getAnalysisStepsReadOnly();
       
        for (AnalysisStep analysisStep : analysisStepList) {
         
          List<AnalyzedData> analyzedDataSet = analysisStep.getDataSetReadOnly();
         
          for (AnalyzedData analyzedData : analyzedDataSet) {
           
            if (analyzedData instanceof AnalyzedTree) {
 
              if ( pTreeCollection.contains(((AnalyzedTree) analyzedData).getTree())) {
               
                referenceMap.put("generalmessage", "Either this TreeBlock or at least one of the Tree in this Block is tied to an Analysis Step.");
                break; // Even if one tree of the block is ties to Analysis step, we can exit the
               }
             }
          }
         
        }
      }
    }

    referenceMap.put("deleteid", "TreeBlock ID : " + treeBlockID);
    referenceMap.put("objectname", "TreeBlock Title : " + pTreeBlock.getTitle());

    return referenceMap;
  }
View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.tree.TreeBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.