Changeset 669 for trunk/grails-app/services/dbnp/importer
- Timestamp:
- Jul 20, 2010, 4:21:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r666 r669 171 171 172 172 (0..header.size()-1).each { columnindex -> 173 def c = sheet.getRow(rowindex).getCell(columnindex, org.apache.poi.ss.usermodel.Row.CREATE_NULL_AS_BLANK) 174 println "DAS " + columnindex + ":" + c 173 def c = sheet.getRow(rowindex).getCell(columnindex, org.apache.poi.ss.usermodel.Row.CREATE_NULL_AS_BLANK) 175 174 row.add(c) 175 //if (c.getCellType() == c.CELL_TYPE_STRING) println "STR"+c.getStringCellValue() 176 //if (c.getCellType() == c.CELL_TYPE_NUMERIC) println "INT" +c.getNumericCellValue() 176 177 } 177 178 //row.add(df.formatCellValue(c)) … … 224 225 def sheet = wb.getSheetAt(sheetindex) 225 226 def table = [] 226 227 227 228 228 // walk through all rows … … 242 242 return table 243 243 } 244 245 /** 246 // start transaction 247 def transaction = sessionFactory.getCurrentSession().beginTransaction() 248 // persist data to the database 249 try { 250 // commit transaction 251 println "commit" 252 transaction.commit() 253 success() 254 } catch (Exception e) { 255 // rollback 256 // stacktrace in flash scope 257 flash.debug = e.getStackTrace() 258 259 println "rollback" 260 transaction.rollback() 261 error() 262 } 263 */ 264 244 265 245 /** 266 246 * Method to store a matrix containing the entities in a record like structure. Every row in the table … … 332 312 def value 333 313 334 try { 335 value = formatValue(df.formatCellValue(cell), mc.templatefieldtype) 336 } catch (NumberFormatException nfe) { 337 value = "" 338 } 314 if (!mc.dontimport) { 315 /*try { 316 value = formatValue(df.formatCellValue(cell), mc.templatefieldtype) 317 } catch (NumberFormatException nfe) { 318 value = "" 319 }*/ 320 value = df.formatCellValue(cell) 339 321 340 322 switch(mc.entity) { … … 354 336 break 355 337 } // end switch 356 } // end for 338 } // end 339 } // end for 357 340 358 341 return record
Note: See TracChangeset
for help on using the changeset viewer.