- Timestamp:
- Jun 9, 2010, 12:54:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r534 r545 49 49 * @return header representation as a MappingColumn hashmap 50 50 */ 51 def getHeader(HSSFWorkbook wb, int sheetindex, theEntity= 0){51 def getHeader(HSSFWorkbook wb, int sheetindex, theEntity=null){ 52 52 53 53 def sheet = wb.getSheetAt(sheetindex) … … 62 62 def datamatrix_celltype = sheet.getRow(datamatrix_start).getCell(index).getCellType() 63 63 def headercell = sheet.getRow(sheet.getFirstRowNum()).getCell(index) 64 64 def tft = TemplateFieldType.STRING //default templatefield type 65 66 65 67 // Check for every celltype, currently redundant code, but possibly this will be 66 68 // a piece of custom code for every cell type like specific formatting … … 70 72 //parse cell value as double 71 73 def parsable = true 72 def templatefieldtype = TemplateFieldType.STRING74 def fieldtype = TemplateFieldType.STRING 73 75 74 76 // is this string perhaps a double? … … 77 79 } catch (NumberFormatException nfe) { parsable = false } 78 80 finally { 79 if (parsable) templatefieldtype = TemplateFieldType.DOUBLE81 if (parsable) fieldtype = TemplateFieldType.DOUBLE 80 82 } 81 83 82 84 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), 83 templatefieldtype: templatefieldtype,85 templatefieldtype:fieldtype, 84 86 index:index, 85 87 entity:theEntity, 86 88 property:property); 89 87 90 break 88 91 case HSSFCell.CELL_TYPE_NUMERIC: … … 115 118 property:property); 116 119 break 117 } 118 } 120 } // end of switch 121 } // end of cell loop 119 122 return header 120 123 } … … 305 308 study.setFieldValue(mc.property, value) 306 309 break 307 case Subject : (record.any {it.getClass()==mc.entity}) ? 0 : record.add(subject) 310 case Subject : (record.any {it.getClass()==mc.entity}) ? 0 : record.add(subject) 311 println "TOT HIER" + mc.property + "/ " + value 308 312 subject.setFieldValue(mc.property, value) 309 313 break
Note: See TracChangeset
for help on using the changeset viewer.