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());