Changeset 1210

Show
Ignore:
Timestamp:
29-11-10 11:38:52 (3 years ago)
Author:
adem.bilican@…
Message:

modifying the simple tox file name because of errors

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy

    r1112 r1210  
    7474    } 
    7575 
    76     def print = { 
    77         render params 
    78         render "PRINTING" 
    79     } 
    80  
    81  
    8276    def export = { 
    8377 
     
    9488            for (studyInstance in studies){ 
    9589                downloadFile(studyInstance,false) 
    96                 files.add(new File("web-app/fileuploads/"+studyInstance.title+"_SimpleTox.xls")) 
     90                files.add(new File("web-app/fileuploads/"+studyInstance.code+"_SimpleTox.xls")) 
    9791            } 
    9892 
     
    197191        if(dl) { 
    198192            println "Creation for downloading the file "+studyInstance.title+"_SimpleTox.xls" 
    199             response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance.title}_SimpleTox.xls\"") 
     193            response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance.code}_SimpleTox.xls\"") 
    200194            response.setContentType("application/octet-stream") 
    201195            wb.write(response.outputStream) 
     
    205199        // Create the file and save into ZIP 
    206200        if(!dl){ 
    207             FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance.title+"_SimpleTox.xls", true) 
     201            FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance.code+"_SimpleTox.xls", true) 
    208202            wb.write(fileOut) 
    209203            fileOut.close() 
     
    234228    // writing subject properties 
    235229    def writeSubjectProperties(sub,sample,row) { 
     230        println "----- SUBJECT -----" 
    236231        for (u in 0..sample.parentSubject.giveFields().unique().size()-1){ 
    237232            TemplateField tf = sample.parentSubject.giveFields().getAt(u) 
    238             row.createCell((short)9+u).setCellValue("subject-"+tf.name) 
     233            println tf.name 
     234            row.createCell((short)9+u).setCellValue(tf.name) 
    239235            sample.parentSubject.getFieldValue(tf.name) ? sub.createCell((short)9+u).setCellValue(sample.parentSubject.getFieldValue(tf.name).toString()) : "not define" 
    240236        } 
     
    243239    // writing samplingEvent properties 
    244240    def writeSamplingEventProperties(sub,sample,row){ 
     241        println "----- SAMPLING EVENT -----" 
    245242        for (t in 0..sample.parentEvent.giveFields().unique().size()-1){ 
    246243            TemplateField tf =sample.parentEvent.giveFields().getAt(t) 
     244            println tf.name 
    247245            row.createCell((short)9+sample.parentSubject.giveFields().unique().size()+t).setCellValue("samplingEvent-"+tf.name) 
    248246            sample.parentEvent.getFieldValue(tf.name) ? sub.createCell((short)9+sample.parentSubject.giveFields().unique().size()+t).setCellValue(sample.parentEvent.getFieldValue(tf.name).toString()) : "not define" 
     
    257255    // writing sample properties 
    258256    def writeSampleProperties(sub,sample,row){ 
     257        println "----- SAMPLE -----" 
    259258        for (v in 0..sample.giveFields().unique().size()-1){ 
    260259            TemplateField tf =sample.giveFields().getAt(v) 
     260            println tf.name 
    261261            row.createCell((short)9+sample.parentSubject.giveFields().unique().size()+v+sample.parentEvent.giveFields().unique().size()).setCellValue("sample-"+tf.name) 
    262262            sample.getFieldValue(tf.name) ? sub.createCell((short)9+sample.parentSubject.giveFields().unique().size()+v+sample.parentEvent.giveFields().unique().size()).setCellValue(sample.getFieldValue(tf.name).toString()) : "not define"