Package org.cipres.treebase.web.model

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


  public ModelAndView onSubmit (HttpServletRequest request,
        HttpServletResponse response,
        Object command,
        BindException errors) throws Exception {

    SearchCommand searchCommand = (SearchCommand) command;
    List<SearchCriteriaCommand> criterias = searchCommand.getCriterias();
    if (request.getParameter("Submit Query") != null) {
      if (criterias.size() == 0) {
        request.setAttribute("messages", getMessageSourceAccessor().getMessage("search.no.criteria.selected"));
        return showForm(request, response, errors);
      }
View Full Code Here


* @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
*/
protected Object formBackingObject(HttpServletRequest request) throws ServletException {

  // retrieve SearchCommand object from request scope
  SearchCommand searchCommand = (SearchCommand) request.getSession().getAttribute(Constants.SEARCH_COMMAND);
  if (searchCommand == null) {
    searchCommand = new SearchCommand();
  }
  return searchCommand;
}
View Full Code Here

   * @see org.springframework.web.servlet.mvc.Controller#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ModelAndView handleRequest(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
   
    SearchCommand searchCommand = (SearchCommand) request.getSession().getAttribute(Constants.SEARCH_COMMAND);
    StudyCriteria studyCriteria = new StudyCriteria();
    List<SearchCriteriaCommand> criterias = searchCommand.getCriterias();
   
    Collection<Study> studyList = new ArrayList<Study>();
    // no longer needed
    request.getSession().removeAttribute(Constants.SEARCH_COMMAND);
    if (searchCommand == null) {
View Full Code Here

    String query = request.getParameter("query");
    if ( ! TreebaseUtil.isEmpty(query) ) {
      return this.handleQueryRequest(request, response, errors, query);
    }
    if (formName.equals("searchByTaxonLabel")) {
      SearchCommand newSearchCommand = (SearchCommand)searchCommand;
      String searchOn = request.getParameter("searchOn");
      String searchTerm = convertStars(request.getParameter("searchTerm"));
      String[] searchTerms = searchTerm.split("\\r\\n")
      Collection<Taxon> taxa = new HashSet<Taxon>();
      for ( int i = 0; i < searchTerms.length; i++ ) {
View Full Code Here

   * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
   */
  protected SearchCommand formBackingObject(HttpServletRequest request) throws ServletException {

    // retrieve SearchCommand object from request scope
    SearchCommand searchCommand = new SearchCommand (request);

    return searchCommand;
  }
View Full Code Here

    Object command,
    BindException errors) throws Exception {

    LOGGER.debug("onSubmit is called");

    SearchCommand searchCommand = (SearchCommand) command;
    List<SearchCriteriaCommand> criterias = searchCommand.getCriterias();

    if (request.getParameter("And") != null) {
      addCriterias(request, searchCommand, Constants.AND_OPERATOR);
    } else if (request.getParameter("OR") != null) {
      addCriterias(request, searchCommand, Constants.OR_OPERATOR);
    } else if (request.getParameter(ACTION_DELETE) != null) {
      if (searchCommand.getCriterias().size() > 0) {
        String[] deleteConditions = request.getParameterValues("deleteCondition");
        for (int i = 0; deleteConditions != null && i < deleteConditions.length; i++) {
          criterias.set(i, null);
        }// end for
        for (int i = 0; i <= criterias.size(); i++) {
View Full Code Here

   */
  protected Object formBackingObject(HttpServletRequest request) throws ServletException {

    LOGGER.debug("formBackingObject() is called");
    // retrieve SearchCommand object from request scope
    SearchCommand searchCommand = (SearchCommand) request.getSession().getAttribute(
      Constants.SEARCH_COMMAND);
    if (searchCommand == null) {
      searchCommand = new SearchCommand();
    }
    return searchCommand;
  }
View Full Code Here

TOP

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

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.