- Timestamp:
- Mar 10, 2011, 1:06:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy
r1588 r1617 50 50 51 51 def export = { 52 52 def ids = params.list( 'ids' ); 53 53 def studies = [] 54 for ( j in dbnp.studycapturing.Study.list() ){ 55 if (params.containsKey(j.code)){ 56 studies.add(j) 57 } 58 } 54 55 ids.each { 56 if( it.toString().isLong() ) { 57 def study = Study.get( Long.valueOf( it ) ); 58 if( study ) 59 studies << study 60 } 61 } 59 62 60 63 if(studies.size()>1){ … … 63 66 for (studyInstance in studies){ 64 67 downloadFile(studyInstance,false) 65 files.add(new File("web-app/fileuploads/"+studyInstance. code+"_SimpleTox.xls"))68 files.add(new File("web-app/fileuploads/"+studyInstance.id+"_SimpleTox.xls")) 66 69 } 67 70 … … 166 169 if(dl) { 167 170 println "Creation for downloading the file "+studyInstance.title+"_SimpleTox.xls" 168 response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance. code}_SimpleTox.xls\"")171 response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance.title}_SimpleTox.xls\"") 169 172 response.setContentType("application/octet-stream") 170 173 wb.write(response.outputStream) … … 174 177 // Create the file and save into ZIP 175 178 if(!dl){ 176 FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance. code+"_SimpleTox.xls", true)179 FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance.id+"_SimpleTox.xls", true) 177 180 wb.write(fileOut) 178 181 fileOut.close()
Note: See TracChangeset
for help on using the changeset viewer.