Ignore:
Timestamp:
Jun 17, 2011, 1:54:56 PM (8 years ago)
Author:
robert@…
Message:
  • Installed templates (in order to extend session lifetime to 2 hours)
  • Implemented background worker to do work outside the HTTP request
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/nl/tno/massSequencing/StudyController.groovy

    r59 r70  
    4444                }
    4545
    46                 // Export the sequences and quality scores
    47                 response.setHeader "Content-disposition", "attachment; filename=" + name.trim() + ".zip"
    48                 try {
    49                         fastaService.export( assaySamples.unique(), response.getOutputStream() );
    50                         response.outputStream.flush();
    51                 } catch( Exception e ) {
    52                         log.error( "Exception occurred during export of sequences. Probably the user has cancelled the download." );
    53                         e.printStackTrace();
    54                 }
     46                // Start the export in the background
     47                def returnUrl = params.url ? params.url.toString() : createLink( controller: "study" ).toString()
     48                def finishUrl = createLink( controller: "assaySample", action: 'downloadFasta', params: [ processId: '%s' ] ).toString();
     49                def url = fastaService.startExportProcess( assaySamples, session, name, returnUrl, finishUrl )
     50               
     51                // Show a waiting screen
     52                redirect( url: url );
    5553        }
    5654
     
    7977                                tags << [assaySampleId: assaySample.id, sampleName: assaySample.sample.name, assayName: assaySample.assay.name, studyName: assaySample.assay.study.name, tag: "-"]
    8078                        }
     79
     80                        sampleExcelService.sessionToken = session.sessionToken
     81                       
    8182                        sampleExcelService.exportExcelSampleData( assaySamples.unique(), tags, response.getOutputStream() );
    8283                        response.outputStream.flush();
Note: See TracChangeset for help on using the changeset viewer.