Changeset 1050
- Timestamp:
- Nov 2, 2010, 4:48:11 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1047 r1050 44 44 //session.import_referer = request.forwardURI 45 45 // should do a check what is in the url, strip it? 46 session.import_referer = params.redirectTo 46 session.import_referer = params.redirectTo 47 47 } 48 48 … … 269 269 270 270 // First handle the "failed cells" 271 //ImporterService.getFailedCells(session.importer_importeddata) 272 273 //render(view:"step2a_simple", model:[datamatrix:session.importer_importeddata]) 271 //render(view:"step2a_simple", model:[datamatrix:ImporterService.getFailedCells(session.importer_importeddata)]) 274 272 275 273 if (params.layout=="horizontal") -
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r1045 r1050 230 230 } 231 231 return table 232 } 233 234 /** Method to extract failed cells from the datamatrix. Failed cells are cell values 235 * which could not be stored in an entity (e.g. Humu Supiuns in an ontology field). 236 * 237 * @param datamatrix two dimensional array containing entities and possibly also failed cells 238 * @return array of failed cells 239 * */ 240 def getFailedCells(datamatrix) { 241 def failedcells = [] 242 243 datamatrix.each { record -> 244 record.each { column -> 245 column.each { 246 if (it.getClass().getName().equals('java.util.LinkedHashMap$Entry')) { 247 println it.key 248 println it.value 249 failedcells.add(it) 250 } 251 } 252 } 253 } 254 255 return failedcells 232 256 } 233 257 … … 424 448 // leave the field empty and let the user choose the ontology manually in a later step 425 449 failed.put(mc, value) 450 println "failed ("+mc.templatefieldtype+"`" + value + "`" 426 451 } 427 452 } // end … … 431 456 // a failed column means that using the entity.setFieldValue() threw an exception 432 457 //record.add(failed) 433 434 458 return record 435 459 }
Note: See TracChangeset
for help on using the changeset viewer.