Ignore:
Timestamp:
May 2, 2011, 11:55:13 AM (9 years ago)
Author:
robert@…
Message:

After searching, several actions can be performed on search results. These actions are called by sending data to a URL. This was done using the HTTP GET method, but that resulted in error with the length of the query string (see #422). This is solved by sending all data using the HTTP POST method.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1010.settings
        1111*.log
         12dtd
  • trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy

    r1794 r1798  
    396396        def exportToExcel = {
    397397                def ids = params.list( 'ids' ).findAll { it.isLong() }.collect { Long.valueOf( it ) };
    398 
    399                 if( !ids ) {
     398                def tokens = params.list( 'tokens' );
     399
     400                if( !ids && !tokens ) {
    400401                        flash.errorMessage = "No study ids given";
    401402                        redirect( controller: "assay", action: "errorPage" );
     
    404405               
    405406                // Find all assay ids for these studies
    406                 def assayIds = ids.collect { id ->
     407                def assayIds = [];
     408                ids.each { id ->
    407409                        def study = Study.get( id );
    408410                        if( study ) {
    409                                 return study.assays.collect { assay -> assay.id }
    410                         } else {
    411                                 return []
     411                                assayIds += study.assays.collect { assay -> assay.id }
    412412                        }
    413                 }.flatten()
     413                }
    414414               
     415                // Also accept tokens for defining studies
     416                tokens.each { token ->
     417                        def study = Study.findByStudyUUID( token );
     418                        if( study )
     419                                assayIds += study.assays.collect { assay -> assay.id }
     420                }
     421                 
    415422                if( !assayIds ) {
    416423                        flash.errorMessage = "No assays found for the given studies";
Note: See TracChangeset for help on using the changeset viewer.