- Timestamp:
- Mar 24, 2010, 4:01:18 PM (11 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r307 r312 59 59 60 60 for (HSSFCell c: sheet.getRow(datamatrix_start)) { 61 def datamatrix_celltype = sheet.getRow(datamatrix_start).getCell(c.getColumnIndex()).getCellType() 62 def headercell = sheet.getRow(sheet.getFirstRowNum()).getCell(c.getColumnIndex()) 61 def index = c.getColumnIndex() 62 def datamatrix_celltype = sheet.getRow(datamatrix_start).getCell(index).getCellType() 63 def headercell = sheet.getRow(sheet.getFirstRowNum()).getCell(index) 63 64 64 65 // Check for every celltype, currently redundant code, but possibly this will be … … 67 68 switch (datamatrix_celltype) { 68 69 case HSSFCell.CELL_TYPE_STRING: 69 header[ c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);70 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING, index:index); 70 71 break 71 72 case HSSFCell.CELL_TYPE_NUMERIC: 72 73 if (HSSFDateUtil.isCellDateFormatted(c)) { 73 header[ c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.DATE)74 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.DATE, index:index) 74 75 } 75 76 else 76 header[ c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.INTEGER);77 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.INTEGER,index:index); 77 78 break 78 79 case HSSFCell.CELL_TYPE_BLANK: 79 header[ c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);80 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING, index:index); 80 81 break 81 82 default: 82 header[ c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);83 header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING,index:index); 83 84 break 84 85 } -
trunk/grails-app/views/importer/common/_preview.gsp
r299 r312 15 15 <g:form name="previewform" action="savepreview"> 16 16 <table> 17 <tr> 18 <td>Identifier:</td> 19 <g:each var="column" in="${header}"> 20 <td> 21 <g:radio name="identifier" value="${column.value.index}"/> 22 </td> 23 </g:each> 24 </td> 25 </tr> 17 26 <tr> 18 27 <td>Columnname:</td> -
trunk/grails-app/views/importer/common/_properties.gsp
r305 r312 18 18 <% if (selectedentities.any { it.type.toInteger() ==stdentity.type.toInteger()} && stdentity.type.toInteger()!=-1) { %> 19 19 <tr><td colspan="2"><h4>${stdentity.name}</h4></td></tr> 20 <tr> 21 <td>Identifier:</td> 20 <tr> 22 21 <td>Columnname:</td> 23 22 <td>Property:</td> … … 25 24 <g:each var="selentity" in="${selectedentities}"> 26 25 <g:if test="${selentity.type.toLong()==stdentity.type}"> 27 <tr> 28 <td width="12px"> 29 <g:checkBox name="identifier"/> 30 </td> 26 <tr> 31 27 <td class="header" width="200px"> 32 28 <b>${header[selentity.columnindex.toInteger()].name}</b> -
trunk/grails-app/views/importer/step2.gsp
r299 r312 25 25 <body> 26 26 <h1>Step 2: import wizard entities/properties</h1> 27 <p>Please choose the study you want to add the data to.</p> 28 <importer: 27 29 <p>Below you see the entities and columns, assign properties to the columns.</p> 28 30 <importer:properties entities="${entities}" header="${header}" templates="${templates}"/>
Note: See TracChangeset
for help on using the changeset viewer.