Ignore:
Timestamp:
Jan 18, 2011, 3:51:25 PM (9 years ago)
Author:
t.w.abma@…
Message:
  • cleaned up importer service and controller (and removed flow variables for failed/succesfull entities)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy

    r1388 r1411  
    191191                    success()
    192192                } else {
    193                     println "properties are wrong"
     193                    log.error ".import wizard, properties are set wrong"
    194194                    error()
    195195                }
     
    273273                    if (pluginManager.getGrailsPlugin('grom')) ".persisting instances to the database...".grom()                   
    274274
    275                     if (saveEntities(flow, params)) {                       
     275                    if (saveEntities(flow, params)) {
    276276                        success()
    277                     } else {
     277                    } else {                       
    278278                        log.error ".import wizard imported error, something went wrong showing the imported entities"                       
    279279                        //throw Exception
     
    281281                } catch (Exception e) {
    282282                    // put your error handling logic in
    283                     // here                   
     283                    // here
     284                    log.error ".import wizard, could not save entities:\n" + e.dump()
    284285                    flow.page = 4
    285286                    error()
     
    543544    }
    544545
    545     boolean saveEntities(flow, params) {
    546             def (validatedSuccesfully, updatedEntities, failedToPersist) = ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata)
    547 
    548             flow.importer_validatedsuccesfully = validatedSuccesfully
    549             flow.importer_failedtopersist = failedToPersist
    550             flow.imported_updatedentities = updatedEntities
    551             flow.importer_totalrows = flow.importer_importeddata.size
    552             flow.importer_referer = ""
     546    boolean saveEntities(flow, params) {           
     547            //def (validatedSuccesfully, updatedEntities, failedToPersist) =
     548            try {
     549                ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata)
     550               
     551            }
     552            catch (Exception e) {               
     553                log.error ".import wizard saveEntities error\n" + e.dump()
     554            }
     555           
     556            //flow.importer_validatedsuccesfully = validatedSuccesfully
     557            //flow.importer_failedtopersist = failedToPersist
     558            //flow.imported_updatedentities = updatedEntities
     559            //flow.importer_totalrows = flow.importer_importeddata.size
     560            //flow.importer_referer = ""           
    553561
    554562            return true
     
    596604                def errors = [:]
    597605                object.errors.getAllErrors().each() { error ->
    598                         // error.codes.each() { code -> println code }
    599             println "errors is " + error
     606                        // error.codes.each() { code -> println code }           
    600607
    601608                        // generally speaking g.message(...) should work,
Note: See TracChangeset for help on using the changeset viewer.