Changeset 1422
- Timestamp:
- Jan 20, 2011, 6:32:41 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1421 r1422 249 249 if (saveEntities(flow, params)) { 250 250 //if (ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata)) { 251 log.error ".import wizard succesfully persisted all entities"251 //log.error ".import wizard succesfully persisted all entities" 252 252 //def session = sessionFactory.getCurrentSession() 253 253 //session.clear() … … 521 521 //def (validatedSuccesfully, updatedEntities, failedToPersist) = 522 522 //try { 523 ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata, authenticationService )523 ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata, authenticationService, log) 524 524 525 525 //} -
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r1421 r1422 257 257 // Update the entity field 258 258 entity.setFieldValue(cell.mappingcolumn.property, correctedvalue) 259 // println"Adjusted " + cell.mappingcolumn.property + " to " + correctedvalue259 //log.info "Adjusted " + cell.mappingcolumn.property + " to " + correctedvalue 260 260 } 261 261 catch (Exception e) { 262 // println"Could not map corrected ontology: " + cell.mappingcolumn.property + " to " + correctedvalue262 //log.info "Could not map corrected ontology: " + cell.mappingcolumn.property + " to " + correctedvalue 263 263 } 264 264 } … … 276 276 * @param datamatrix two dimensional array containing entities with values read from Excel file 277 277 */ 278 static saveDatamatrix(Study study, datamatrix, authenticationService ) {278 static saveDatamatrix(Study study, datamatrix, authenticationService, log) { 279 279 def validatedSuccesfully = 0 280 280 def entitystored = null … … 287 287 record.each { entity -> 288 288 switch (entity.getClass()) { 289 case Study: println"Persisting Study `" + entity + "`: "289 case Study: log.info "Persisting Study `" + entity + "`: " 290 290 entity.owner = authenticationService.getLoggedInUser() 291 291 persistEntity(entity) 292 292 break 293 case Subject: println"Persisting Subject `" + entity + "`: "293 case Subject: log.info "Persisting Subject `" + entity + "`: " 294 294 295 295 // is the current entity not already in the database? … … 302 302 303 303 break 304 case Event: println"Persisting Event `" + entity + "`: "304 case Event: log.info "Persisting Event `" + entity + "`: " 305 305 study.addToEvents(entity) 306 306 break 307 case Sample: println"Persisting Sample `" + entity + "`: "307 case Sample: log.info "Persisting Sample `" + entity + "`: " 308 308 309 309 // is this sample validatable (sample name unique for example?) … … 311 311 312 312 break 313 case SamplingEvent: println"Persisting SamplingEvent `" + entity + "`: "313 case SamplingEvent: log.info "Persisting SamplingEvent `" + entity + "`: " 314 314 study.addToSamplingEvents(entity) 315 315 break 316 default: println"Skipping persisting of `" + entity.getclass() + "`"316 default: log.info "Skipping persisting of `" + entity.getclass() + "`" 317 317 break 318 318 } // end switch … … 391 391 */ 392 392 boolean persistEntity(entity) { 393 println".import wizard persisting ${entity}"393 log.info ".import wizard persisting ${entity}" 394 394 395 395 try {
Note: See TracChangeset
for help on using the changeset viewer.