Changeset 1556


Ignore:
Timestamp:
Feb 24, 2011, 1:38:17 PM (6 years ago)
Author:
t.w.abma@…
Message:
  • wizard error showing up too early removed, now only showing after clicking next on the "check imported data" step (this was already in there)
  • importer wizard preview now shows entity being imported again
  • uploaded file is deleted from the server when the importer wizard has completed
Location:
trunk/grails-app
Files:
2 edited

Legend:

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

    r1555 r1556  
    260260                                // Grom a development message
    261261                                if (pluginManager.getGrailsPlugin('grom')) ".persisting instances to the database...".grom()
    262 
    263                                 if (saveEntities(flow, params)) {
    264                                         //if (ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata)) {
    265                                         //log.error ".import wizard succesfully persisted all entities"
    266                                         //def session = sessionFactory.getCurrentSession()
    267                                         //session.clear()
     262               
     263                // Always delete the uploaded file in the save step to be sure it doesn't reside there anymore
     264                fileService.delete(flow.importer_importedfile)
     265
     266                                // Save all entities
     267                if (saveEntities(flow, params)) {                                                                             
    268268                                        success()
    269269                                } else {
     
    334334         * @returns boolean true if correctly validated, otherwise false
    335335         */
    336         boolean fileImportPage(flow, flash, params) {
     336        boolean fileImportPage(flow, flash, params) {       
    337337                def importedfile = fileService.get(params['importfile'])
    338                 //fileService.delete(YourFile)
     338        flow.importer_importedfile = params['importfile']               
    339339
    340340        if (importedfile.exists()) {
     
    371371                        flow.importer_headerrow = params.headerrow.toInteger()
    372372            flow.importer_entityclass = entityClass
    373 
     373            flow.importer_entity = GdtService.cachedEntities.find{ it.entity==entityName }
     374         
    374375                        // Get the header from the Excel file using the arguments given in the first step of the wizard
    375376                        flow.importer_header = ImporterService.getHeader(session.importer_workbook,
     
    528529
    529530        // loop through all entities to validate them and add them to wizardErrors flash when invalid
    530         table.each { record ->
     531        /*table.each { record ->
    531532            record.each { entity ->
    532533                if (!entity.validate()) {
     
    534535                }
    535536            }
    536         }
     537        }*/
    537538
    538539        flow.importer_failedcells = failedcells
  • trunk/grails-app/views/importer/common/_properties_horizontal.gsp

    r1555 r1556  
    1616
    1717
    18 <!-- saveproperties action was defined in the form --> 
    19   ${mappingname}
    20 
     18<!-- saveproperties action was defined in the form -->   
    2119    <table>
    22               <tr><td colspan="3"><h4>defaultentity</h4></td></tr>
     20              <tr><td colspan="3"><h4>${importer_entity.name}</h4></td></tr>
    2321                <tr>
    2422            <td class="header" width="55px">
Note: See TracChangeset for help on using the changeset viewer.