Changeset 1191

Show
Ignore:
Timestamp:
23-11-10 11:17:00 (3 years ago)
Author:
t.w.abma@…
Message:

- calling savePostview url directly gives a warning now that the files already have been imported and/or that the import wizard steps should be followed from the beginning

Files:
1 modified

Legend:

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

    r1171 r1191  
    4141 
    4242    def index = { 
     43        // no data has been imported yet 
     44        session.validatedSuccesfully = null 
     45 
    4346        // should do a check what is in the url, strip it? 
    4447        session.import_referer = params.redirectTo 
     
    334337     */ 
    335338    def savePostview = { 
    336         def validatedSuccesfully = ImporterService.saveDatamatrix(session.importer_study, session.importer_importeddata) 
    337         render(view:"step4", model:[validatedSuccesfully:validatedSuccesfully, totalrows:session.importer_importeddata.size, referer: session.import_referer]) 
     339         
     340        if (session.validatedSuccesfully) { 
     341            render (template:"common/error", 
     342                    model:[error:"Data is already imported or you are calling the url directly without following the previous import steps."]) 
     343        } else { 
     344            session.validatedSuccesfully = ImporterService.saveDatamatrix(session.importer_study, session.importer_importeddata) 
     345            render(view:"step4", model:[validatedSuccesfully:session.validatedSuccesfully, totalrows:session.importer_importeddata.size, referer: session.import_referer]) 
     346        } 
    338347    } 
    339348