- Timestamp:
- Feb 26, 2010, 12:26:29 PM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r203 r215 22 22 import org.apache.poi.hssf.usermodel.HSSFCell 23 23 import org.apache.poi.ss.usermodel.DataFormatter 24 import dbnp.studycapturing.Template 24 25 25 26 class ImporterController { … … 29 30 * Default page 30 31 **/ 31 def index = { } 32 def index = { 33 [templates:Template.list()] 34 } 32 35 33 36 /** … … 47 50 48 51 session.header = header 52 session.importtemplate_id = params.template_id 49 53 50 54 render (view:"step1", model:[header:header, datamatrix:datamatrix]) … … 52 56 } 53 57 58 /** 59 * User has assigned all entities to the columns and continues to the next step (assigning properties to columns) 60 * 61 * @param entity list of entities 62 * @return properties page 63 */ 54 64 def savepreview = { 55 65 def entities = request.getParameterValues("entity") 56 66 57 render(view:"step2", model:[entities:entities, header:session.header]) 67 // currently only one template is used for all entities 68 // TODO: show template fields per entity 69 70 def templates = Template.get(session.importtemplate_id) 71 72 render(view:"step2", model:[entities:entities, header:session.header, templates:templates]) 58 73 } 59 74 } -
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r203 r215 93 93 out << createSelect(selected, attrs['name'], standardcelltypes, customvalue) 94 94 } 95 96 95 97 } -
trunk/grails-app/views/importer/common/_preview.gsp
r203 r215 54 54 </g:each> 55 55 <tr> 56 <td align="right" colspan="${datamatrix.length}"><input type="submit" value=" Accept"></td>56 <td align="right" colspan="${datamatrix.length}"><input type="submit" value="Next"></td> 57 57 </tr> 58 58 </table> -
trunk/grails-app/views/importer/common/_properties.gsp
r203 r215 27 27 </td> 28 28 <td> 29 <g:select name="property" from="${['BMI', 'DOB', 'Gender']}" /> 29 30 <g:each var="template" in="${templates}"> 31 ${template.studyFields()} 32 </g:each> 30 33 </td> 31 34 </g:if> -
trunk/grails-app/views/importer/index.gsp
r147 r215 17 17 <table border="0"> 18 18 <tr> 19 <td width="160px">Choose your Excel file to import:</td> 20 <td width="280px"><input type="file" name="importfile"/></td> 21 <td><input type="submit" value="Import"/></td> 22 </tr> 19 <td width="100px"> 20 Choose your Excel file to import: 21 </td> 22 <td width="100px"> 23 <input type="file" name="importfile"/> 24 </td> 25 </tr> 26 <tr> 27 <td> 28 Template 29 </td> 30 <td> 31 <g:select name="template_id" from="${templates}" optionKey="id"/> 32 </td> 33 </tr> 34 <tr> 35 <td colspan="2"> 36 <input type="submit" value="Next"/> 37 </td> 38 </tr> 23 39 </table> 24 40 </g:form> -
trunk/grails-app/views/importer/step1.gsp
r203 r215 20 20 <meta name="layout" content="main"/> 21 21 <link rel="stylesheet" href="${resource(dir: 'css', file: 'importer.css')}"/> 22 <title> Import wizard preview</title>22 <title>Step 1: import wizard preview</title> 23 23 </head> 24 24 <body> 25 <h1> Import wizard preview</h1>25 <h1>Step 1: import wizard preview</h1> 26 26 <p>Below you see a preview of your imported file, please correct the automatically detected types.</p> 27 <importer:preview header="${header}" datamatrix="${datamatrix}"/> 28 </body> 29 27 <importer:preview header="${header}" datamatrix="${datamatrix}"/> 28 </body> 30 29 </html> -
trunk/grails-app/views/importer/step2.gsp
r203 r215 26 26 <h1>Step 2: import wizard entities/properties</h1> 27 27 <p>Below you see the entities and columns, assign properties to the columns.</p> 28 <importer:properties entities="${entities}" header="${header}" />28 <importer:properties entities="${entities}" header="${header}" templates="${templates}"/> 29 29 </body> 30 30 </html>
Note: See TracChangeset
for help on using the changeset viewer.