Changeset 1552
- Timestamp:
- Feb 23, 2011, 1:25:46 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r1548 r1552 111 111 def selected = (attrs['selected']) ? attrs['selected'] : "" 112 112 def fuzzyTreshold = attrs[ 'treshold' ] && attrs[ 'treshold' ].toString().isNumber() ? Float.valueOf( attrs[ 'treshold' ] ) : 0.1; 113 113 def returnmatchonly = attrs['returnmatchonly'] 114 114 115 def domainfields = mc.entityclass.giveDomainFields().findAll { it.type == mc.templatefieldtype } 115 116 domainfields = domainfields.findAll { it.preferredIdentifier != mc.identifier} … … 126 127 /*(mc.identifier) ? out << createPropertySelect(attrs['name'], prefcolumn, matchvalue, mc.index) : 127 128 out << createPropertySelect(attrs['name'], templatefields, matchvalue, mc.index)*/ 128 129 out << createPropertySelect(attrs['name'], templatefields, matchvalue, selected, mc.index, fuzzyTreshold) 129 130 // Just return the matched value only 131 if (returnmatchonly) 132 out << ImporterService.mostSimilar(matchvalue, templatefields, fuzzyTreshold) 133 else // Return a selectbox 134 out << createPropertySelect(attrs['name'], templatefields, matchvalue, selected, mc.index, fuzzyTreshold) 135 130 136 } 131 137 -
trunk/grails-app/views/importer/common/_properties_horizontal.gsp
r1525 r1552 36 36 <g:select name="importmapping_id" from="${importer_importmappings}" noSelection="['':'-Select mapping-']" optionValue="name" optionKey="id"/> 37 37 </div> 38 </td> 38 </td> 39 40 <g:set var="usedfuzzymatches" value="${'-'}"/> 41 39 42 <g:each var="mappingcolumn" in="${importer_header}"> 40 43 <!-- set selected values based on submitted columnproperties, actually refresh --> … … 46 49 </g:else> 47 50 51 <g:set var="matchvalue" value="${mappingcolumn.name}"/> 52 48 53 <td class="header" width="200px"> 49 54 <b>${mappingcolumn.name}</b> 50 <importer:propertyChooser name="columnproperty" mappingcolumn="${mappingcolumn}" matchvalue="${mappingcolumn.name}" selected="${selected}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" "allfieldtypes="true"/> 51 </td> 55 56 <!-- store the found match --> 57 <g:set var="fuzzymatch" value="${importer.propertyChooser(name:columnproperty, mappingcolumn:mappingcolumn, matchvalue:mappingcolumn.name, selected:selected, fuzzymatching:importer_fuzzymatching, template_id:importer_template_id, returnmatchonly:'true')}"/> 58 59 <g:if test="${usedfuzzymatches.contains( fuzzymatch.toString() ) }"> 60 <g:set var="matchvalue" value=""/> 61 </g:if> 62 63 <importer:propertyChooser name="columnproperty" mappingcolumn="${mappingcolumn}" matchvalue="${matchvalue}" selected="${selected}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" allfieldtypes="true"/> 64 </td> 65 66 <!-- build up a string with fuzzy matches used, to prevent duplicate fuzzy matching --> 67 <g:set var="usedfuzzymatches" value="${usedfuzzymatches + ',' + fuzzymatch.toString() }"/> 68 52 69 </g:each> 53 70 </tr>
Note: See TracChangeset
for help on using the changeset viewer.