- Timestamp:
- Mar 3, 2010, 3:50:32 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r203 r231 125 125 return System.currentTimeMillis() + Runtime.runtime.freeMemory() 126 126 } 127 128 def importdata = { 129 130 } 127 131 } -
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r215 r231 15 15 16 16 package dbnp.importer 17 import dbnp.studycapturing.Template 17 18 18 19 class ImporterTagLib { … … 70 71 } 71 72 72 73 /** 74 * Possibly this will later on return an AJAX-like autocompletion chooser for the fields? 75 * 76 * @param importtemplate_id template identifier where fields are retrieved from 77 * @param columnindex column in the header we're talking about 78 * @return chooser object 79 * */ 80 def propertyChooser = { attrs -> 81 // TODO: this should be changed to retrieving fields per entity 82 def t = Template.get(session.importtemplate_id) 83 def columnindex = attrs['columnindex'] 84 85 switch (attrs['entitytype']) { 86 case 0 : createSelect(-1, "property", t.fields, "1") 87 break 88 case 1 : break 89 case 2 : break 90 case 3 : break 91 default : out << createPropertySelect("property", t.fields, columnindex) 92 break 93 } 94 } 95 96 /** 97 * @param name name of the HTML select object 98 * @param options list of options to be used 99 * @param columnIndex column identifier (corresponding to position in header of the Excel sheet) 100 * @return HTML select object 101 */ 102 def createPropertySelect(String name, options, String columnIndex) 103 { 104 def res = "<select style=\"font-size:10px\" name=\"${name}\">" 105 106 options.each { f -> 107 res += "<option value=\"${columnIndex}:${f.id}\"" 108 //res += (e.type.toInteger() == selected) ? " selected" : "" 109 res += ">${f}</option>" 110 } 111 112 res += "</select>" 113 return res 114 } 73 115 74 116 /** … … 93 135 out << createSelect(selected, attrs['name'], standardcelltypes, customvalue) 94 136 } 95 96 97 137 } -
trunk/grails-app/views/importer/common/_properties.gsp
r215 r231 26 26 <b>${header[selentity.columnindex.toInteger()].value}</b> 27 27 </td> 28 <td> 29 30 <g:each var="template" in="${templates}"> 31 ${template.studyFields()} 32 </g:each> 28 <td> 29 <!-- <g:select name="template" from="${templates.fields}"/> --> 30 <importer:propertyChooser entity="${selentity.type.toLong()}" columnindex="${selentity.columnindex}"/> 33 31 </td> 32 </tr> 34 33 </g:if> 35 34 </g:each> … … 40 39 </tr> 41 40 </g:each> 41 <tr> 42 <td> 43 <input type="submit" name="savebutton" value="Next"/> 44 </td> 45 </tr> 46 42 47 </table> 43 48 </g:form>
Note: See TracChangeset
for help on using the changeset viewer.