Examples of EditFieldCommand


Examples of org.cipres.treebase.web.model.EditFieldCommand

      command.setInput(data.isInputData());
      command.setInputOutputType(data.getInputOutput());
      command.setNotes(data.getNotes());
      command.setId(data.getId());
      List<EditFieldCommand> efcList = new ArrayList<EditFieldCommand>();
      EditFieldCommand efc = null;
      if ( data.getDataType().equals("tree") ) {
        command.setDataId(data.getTreeData().getId());
        efc = new EditFieldCommand(data.getTreeData(),data.getInputOutput());
      }
      else if ( data.getDataType().equals("matrix") ) {
        command.setDataId(data.getMatrixData().getId());
        efc = new EditFieldCommand(data.getMatrixData(),data.getInputOutput());
      }
      efcList.add(efc);
      analyzedDataCommandList.add(command);
    }
    return analyzedDataCommandList;
View Full Code Here

Examples of org.cipres.treebase.web.model.EditFieldCommand

    Boolean input = (data.getInputOutputType().equals(Constants.INPUT_KEY)) ? (true) : (false);

    if (dataType.equals(Constants.MATRIX_KEY)) {
      List<EditFieldCommand> matrixList = data.getMatrixList();
      for (int i = 0; i < matrixList.size(); i++) {
        EditFieldCommand editFieldCommand = matrixList.get(i);
        // check if user update title
        Matrix matrix = mMatrixService.findByID(editFieldCommand.getMatrix().getId());
        matrix.setTitle(editFieldCommand.getMatrix().getTitle());
        mMatrixService.update(matrix);
        if (!editFieldCommand.getChecked()) continue; // skip current iteration if not
        // checked
        AnalyzedMatrix analyzedMatrix = new AnalyzedMatrix();
        analyzedMatrix.setInput(input);
        analyzedMatrix.setMatrix(matrix);
        analysisStep.addAnalyzedData(analyzedMatrix);
        mAnalysisStepService.update(analysisStep);
      }// end for
    } else if (dataType.equals(Constants.TREE_KEY)) {
      List<EditFieldCommand> treeList = data.getTreeList();
      for (int i = 0; i < treeList.size(); i++) {
        EditFieldCommand editFieldCommand = treeList.get(i);
        // check if user update title
        PhyloTree phyloTree = mPhyloTreeService.findByID(editFieldCommand
          .getPhyloTree().getId());
        phyloTree.setLabel(editFieldCommand.getPhyloTree().getLabel());
        mPhyloTreeService.update(phyloTree);
        if (!editFieldCommand.getChecked()) {
          continue; // skip current iteration if not
        }
        // checked
        AnalyzedTree analyzedTree = new AnalyzedTree();
        analyzedTree.setInput(input);
        analyzedTree.setTree(phyloTree);
        analysisStep.addAnalyzedData(analyzedTree);
        mAnalysisStepService.update(analysisStep);
      }
    } else if ( dataType.equals(Constants.TREE_LIST)) {
      List<EditFieldCommand> treeBlockList = data.getTreeBlockList();
      LOGGER.warn("Going to set tree block as analyzed data");
      for ( int i = 0; i < treeBlockList.size(); i++ ) {
        EditFieldCommand editFieldCommand = treeBlockList.get(i);
        if ( ! editFieldCommand.getChecked() ) {
          continue// skip current iteration if not checked
        }       
        TreeBlock treeBlock = mPhyloTreeService.findTreeBlockByID(editFieldCommand.getTreeBlock().getId());
        if ( treeBlock == null ) {
          LOGGER.warn("No treeblock!!!");
        }
        else {
          LOGGER.warn(treeBlock.getTitle());
View Full Code Here

Examples of org.cipres.treebase.web.model.EditFieldCommand

      if (selectedMatrices.containsKey(id)) {
        selected = selectedMatrices.get(id)
          ? (Constants.INPUT_KEY)
          : (Constants.OUTPUT_KEY);
      }
      EditFieldCommand editFieldCommand = new EditFieldCommand(matrix, selected);
      matrixList.add(editFieldCommand);
    }
    command.setMatrixList(matrixList);

    // do the same for trees
    // Iterator<PhyloTree> trees = submission.getTreeIterator();
    List<EditFieldCommand> treeList = new ArrayList<EditFieldCommand>();
    Collection<PhyloTree> trees = submission.getAllSubmittedTrees();
    for (PhyloTree tree : trees) {
      Long id = tree.getId();
      String selected = new String();
      if (selectedTrees.containsKey(id)) {
        selected = selectedTrees.get(id) ? (Constants.INPUT_KEY) : (Constants.OUTPUT_KEY);
      }
      EditFieldCommand editFieldCommand = new EditFieldCommand(tree, selected);
      treeList.add(editFieldCommand);
    }
    command.setTreeList(treeList);
   
    List<EditFieldCommand> treeBlockList = new ArrayList<EditFieldCommand>();
    Collection<TreeBlock> treeBlocks = submission.getSubmittedTreeBlocksReadOnly();
    for (TreeBlock treeBlock : treeBlocks) {
      Long id = treeBlock.getId();
      String selected = new String();
      if ( selectedTreeBlocks.containsKey(id)) {
        selected = selectedTreeBlocks.get(id) ? (Constants.INPUT_KEY) : (Constants.OUTPUT_KEY);
      }
      EditFieldCommand editFieldCommand = new EditFieldCommand(treeBlock,selected);
      treeBlockList.add(editFieldCommand);
    }
    command.setTreeBlockList(treeBlockList);

    return command;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.