Package org.cipres.treebase.web.model

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


    HttpServletRequest request,
    HttpServletResponse response,
    Object command,
    BindException bindExp) {

    RowSegmentCommand rowSegmentCommand = (RowSegmentCommand) command;
    Long matrix_row_id = ControllerUtil.getMatrixRowId(request);
    MatrixRow matrixRow = mMatrixRowService.findByID(matrix_row_id);

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("++MARTIX ROW ID++ : " + matrix_row_id.toString());
    }

    // will never get here. see onCancel().
    // if (request.getParameter(ACTION_CANCEL) != null) {
    // System.out.println("MARTIX ROW ID In Cancel Button: " + matrix_row_id.toString());
    // return null;
    // // return new ModelAndView(getSuccessView() + "?id=" + matrix_row_id.toString());
    // }

    // get matrix so we can have the taxon label to show to user

    if (request.getParameter(ACTION_SUBMIT) != null) {
      System.out.println("MARTIX ROW ID In Submit Button: " + matrix_row_id.toString());
      matrixRow.addSegment(rowSegmentCommand.getRowSegment());
      mMatrixRowService.update(matrixRow);
    } else if (request.getParameter(ACTION_UPDATE) != null) {
      mRowSegmentService.update(rowSegmentCommand.getRowSegment());
    } else if (request.getParameter(ACTION_DELETE) != null) {
      mRowSegmentService.deleteRowSegment(rowSegmentCommand.getRowSegment());
    }
    return new ModelAndView(getSuccessView() + "?id=" + matrix_row_id.toString());
  }
View Full Code Here


  protected ModelAndView onCancel(
    HttpServletRequest pRequest,
    HttpServletResponse pResponse,
    Object pCommand) throws Exception {

    RowSegmentCommand rowSegmentCommand = (RowSegmentCommand) pCommand;
    Long matrix_row_id = ControllerUtil.getMatrixRowId(pRequest);
    // setCan
    return new ModelAndView(getCancelView() + "?id=" + matrix_row_id.toString());
  }
View Full Code Here

    // get matrix so we can have the taxon label to show to user

    Long matrix_row_id = ControllerUtil.getMatrixRowId(request);
    MatrixRow matrixRow = mMatrixRowService.findByID(matrix_row_id);

    RowSegmentCommand rowSegmentCommand = new RowSegmentCommand();
    // add taxon label
    rowSegmentCommand.setTaxonLabel(matrixRow.getTaxonLabel().getTaxonLabel());
    rowSegmentCommand.setTaxonLabelId(matrixRow.getTaxonLabel().getId());
    // add matrix row data
    rowSegmentCommand.setMatrixRowData(matrixRow.buildElementAsString());

    String matrix_row_segment_id = ServletRequestUtils.getStringParameter(request, "id", null);

    // Setting the session variable "REQUEST_VIEW_URL
    List<String> sessionlist = new ArrayList<String>();
    sessionlist.add(request.getRequestURL().toString());
    sessionlist.add(matrix_row_segment_id);

    request.getSession().setAttribute("REQUEST_VIEW_URL", sessionlist);

    if (TreebaseUtil.isEmpty(matrix_row_segment_id)) {
      return rowSegmentCommand;
    }

    // setCancelParamKey("?id=" + matrix_row_id.toString());

    RowSegment rowSegment = mRowSegmentService.findByID(Long.parseLong(matrix_row_segment_id));
    rowSegmentCommand.setRowSegment(rowSegment);

    rowSegmentCommand.setMatrixRowDataSelected(rowSegment.getSegmentData());
   
    return rowSegmentCommand;
  }
View Full Code Here

TOP

Related Classes of org.cipres.treebase.web.model.RowSegmentCommand

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.