Package org.cipres.treebase.domain.tree

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


  public ModelAndView handleRequest(HttpServletRequest pRequest, HttpServletResponse pResponse)
  throws Exception {
    Study study = null;
    if (pRequest.getParameter("treeid") != null) {
      String treeId = pRequest.getParameter("treeid");
      PhyloTree tree = getPhyloTreeService().findByID(Long.parseLong(treeId));
      study = tree.getStudy();
    }
    if (pRequest.getParameter("treeblockid") != null) {
      String treeBlockId = pRequest.getParameter("treeblockid");
      Long value = Long.parseLong(treeBlockId);
      TreeBlock treeBlock = getPhyloTreeHome().findTreeBlockById(value);
View Full Code Here


  }
 
  private void checkAnalyzed(Collection<PhyloTree> mylist, Study study) { 
    Iterator<PhyloTree> treeIterator = mylist.iterator();
    while ( treeIterator.hasNext() ) {
      PhyloTree tree = treeIterator.next();
      if ( tree.isPublished() ) {
        tree.setAnalyzed(true);
      }
      else {
        if ( study != null ) {
          Iterator<PhyloTree> analyzedTreeIterator = study.getTrees().iterator();
          ANALYZED: while ( analyzedTreeIterator.hasNext() ) {
            PhyloTree analyzedTree = analyzedTreeIterator.next();
            if ( analyzedTree.getId() == tree.getId() ) {
              tree.setAnalyzed(true);
              break ANALYZED;
            }
          }
        }
View Full Code Here

    StringBuilder oversizeLabelrowsbldr = new StringBuilder("");
    Iterator<PhyloTree> treeIter = mylist.iterator();

    int i = 0;
    while (treeIter.hasNext()) {
      PhyloTree aTree = treeIter.next();
      if ((aTree.getTitle() != null) && (aTree.getTitle().trim().length() > permittedlength)) {
        check = false;
        oversizeTitlerowsbldr.append(String.valueOf(i + 1)).append(",");
      }
      if ((aTree.getLabel() != null) && (aTree.getLabel().trim().length() > permittedlength)) {
        check = false;
        oversizeLabelrowsbldr.append(String.valueOf(i + 1)).append(",");
      }
      i++;
    }
View Full Code Here

  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

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

      PhyloTree pt = getPhyloTreeService().findByID(
        Long.parseLong(request.getParameter("treeid")));

      Map<String, String> treemap = new HashMap<String, String>();
      treemap.put("TreeId:" + pt.getId(), pt.getNewickString());
      request.getSession().setAttribute("NEWICKSTRINGSMAP", treemap);

    }

    return new ModelAndView(getDefaultView());
View Full Code Here

    }

    if (pRequest.getParameter("treeid") != null) {

      String TreeId = pRequest.getParameter("treeid");
      PhyloTree aTree = getPhyloTreeService().findByID(Long.parseLong(TreeId));
      treeList.add(aTree);

      // use "T" to enable the edit menu items.
      treeMap.put(getMapKey(aTree), TreeId + separator + aTree.getNewickString() + separator
        + "T");
      phylowsMap.put(getMapKey(aTree), aTree.getTreebaseIDString().getNamespacedGUID().toString());
      newickStringName = aTree.getTitle();
      Study study = aTree.getStudy();
      if ( study != null && study.isPublished() ) {
        pRequest.getSession().setAttribute("treeBlockID", aTree.getTreeBlock().getId());
        pRequest.getSession().setAttribute("studyID", study.getId());
      }
      defaultNewick = aTree.getNewickString();
    }
   
    pRequest.getSession().setAttribute("DEFAULTNEWICK", defaultNewick);
    pRequest.getSession().setAttribute("NEWICKSTRINGSMAP", treeMap);
    pRequest.getSession().setAttribute("PHYLOWSMAP", phylowsMap);
View Full Code Here

   * (non-Javadoc)
   * @see org.cipres.treebase.web.controllers.PhyloWSController#getObjectQueryParameters(java.lang.Long)
   */
  @Override
  Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException {
    PhyloTree phyloTree = getPhyloTreeService().findByID(objectId);
    if ( phyloTree == null ) {
      throw new ObjectNotFoundException("Can't find tree " + objectId);
    }
    Study study = phyloTree.getStudy();
   
    if ( study == null ) {
      throw new ObjectNotFoundException("Can't find study for tree "+objectId);
    }
       
View Full Code Here

        }     
      }
      else if ( dataType.equals("Trees") ) {
        for ( int i = 0; i < ids.length; i++ ) {
          if ( ! TreebaseUtil.isEmpty(ids[i]) ) {
            PhyloTree phyloTree = getPhyloTreeService().findByID(Long.parseLong(ids[i]))
            AnalyzedTree analyzedTree = new AnalyzedTree();
            analyzedTree.setInput(input);
            analyzedTree.setTree(phyloTree);
            analysisStep.addAnalyzedData(analyzedTree);
            getAnalysisStepService().update(analysisStep);
View Full Code Here

    HttpServletResponse response,
    Object command,
    BindException bindExp) throws Exception {

    String username = request.getRemoteUser();
    PhyloTree atree = (PhyloTree) command;

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

      Long submission_id = getSubmissionHome().findByTree(atree).getId();
View Full Code Here

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

      Long treeID = Long.parseLong(request.getParameter("treeid"));

      PhyloTree pTree = getPhyloTreeService().findByID(treeID);
      return pTree;
    } else {
      return null;
    }
  }
View Full Code Here

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

    Long treeID = Long.parseLong(request.getParameter("treeid"));
    PhyloTree pTree = getPhyloTreeService().findByID(treeID);

    /*if (pTree.getStudy() != null) { // It means this tree is tied to analysis step
      referenceMap.put("generalmessage", "This PhyloTree is tied to an Analysis Step.");
    }*/
   
    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 (pTree.getId() == ((AnalyzedTree) analyzedData).getTree().getId()) {
             
              referenceMap.put("generalmessage", "This PhyloTree is tied to an Analysis Step.");
             }
           }
        }
       
      }
     
    }

    referenceMap.put("deleteid", "Tree ID : " + treeID);
    referenceMap.put("objectname", "Tree Label : " + pTree.getLabel());

    return referenceMap;
  }
View Full Code Here

TOP

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

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.