Changeset 16027

Show
Ignore:
Timestamp:
02/07/08 12:16:36 (6 months ago)
Author:
julie
Message:

use boolean instead of string for direction. replace optimised method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/intermine/pathquery/main/src/org/intermine/pathquery/PathQuery.java

    r16025 r16027  
    637637    } 
    638638 
     639    /** 
     640     * Removes everything from the order by list and adds the first path in the view list 
     641     */ 
     642    public void resetOrderBy() { 
     643        sortOrder.clear(); 
     644        validateOrderBy(); 
     645    } 
     646 
    639647 
    640648    /*****************************************************************************/ 
  • trunk/intermine/web/main/src/org/intermine/web/struts/SortOrderChange.java

    r16024 r16027  
    5050        PathQuery query = (PathQuery) session.getAttribute(Constants.QUERY); 
    5151 
    52         query.resetSortOrder(); 
     52        query.resetOrderBy(); 
    5353 
    5454        return new ForwardParameters(mapping.findForward("query")) 
     
    7575        PathQuery query = (PathQuery) session.getAttribute(Constants.QUERY); 
    7676 
    77         if (direction == null) { 
    78             direction = "asc"; 
     77        Boolean sortAscending = Boolean.TRUE; 
     78        if (direction != null && direction.equals("desc")) { 
     79            sortAscending = Boolean.FALSE; 
    7980        } 
    80  
    81         query.setOrderBy(path, direction); 
     81        query.setOrderBy(path, sortAscending); 
    8282 
    8383        return new ForwardParameters(mapping.findForward("query"))