- Timestamp:
- Nov 15, 2010, 11:10:37 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1140 r1141 111 111 112 112 def templates = Template.get(session.importer_template_id) 113 113 114 114 render(view:"step2_simple", model:[entities: selectedentities, 115 115 header:session.importer_header, -
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r1126 r1141 538 538 } 539 539 540 static def stringSimilarity (l_str, r_str, degree=2) { 540 static def stringSimilarity (l_str, r_str, degree=2) { 541 541 similarity(l_str.toLowerCase().toCharArray(), 542 542 r_str.toLowerCase().toCharArray(), -
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r1087 r1141 22 22 class ImporterTagLib { 23 23 static namespace = 'importer' 24 def ImporterService 24 25 25 26 /** … … 100 101 * @param name name for the property chooser element 101 102 * @param importtemplate_id template identifier where fields are retrieved from 103 * @param matchvalue value which will be looked up via fuzzy matching against the list of options and will be selected 102 104 * @param MappingColumn object containing all required information 103 105 * @param allfieldtypes boolean true if all templatefields should be listed, otherwise only show filtered templatefields … … 111 113 def mc = attrs['mappingcolumn'] 112 114 def allfieldtypes = attrs['allfieldtypes'] 115 def matchvalue = attrs['matchvalue'] 113 116 def domainfields = mc.entity.giveDomainFields().findAll { it.type == mc.templatefieldtype } 114 117 domainfields = domainfields.findAll { it.preferredIdentifier != mc.identifier} … … 122 125 def prefcolumn = mc.entity.giveDomainFields().findAll { it.preferredIdentifier == true } 123 126 124 (mc.identifier) ? out << createPropertySelect(attrs['name'], prefcolumn, m c.index) :125 out << createPropertySelect(attrs['name'], templatefields, m c.index)127 (mc.identifier) ? out << createPropertySelect(attrs['name'], prefcolumn, matchvalue, mc.index) : 128 out << createPropertySelect(attrs['name'], templatefields, matchvalue, mc.index) 126 129 } 127 130 … … 131 134 * @param name name of the HTML select object 132 135 * @param options list of options (fields) to be used 136 * @param matchvalue value which will be looked up via fuzzy matching against the list of options and will be selected 133 137 * @param columnIndex column identifier (corresponding to position in header of the Excel sheet) 134 138 * @return HTML select object 135 139 */ 136 def createPropertySelect(String name, options, Integer columnIndex) 137 { 140 def createPropertySelect(String name, options, matchvalue, Integer columnIndex) 141 { 142 //String.metaClass.mostSimilarTo = { ImporterService.mostSimilar(delegate, it) } 143 //println "mostsimilar="+ImporterService.mostSimilar(matchvalue, options) 144 138 145 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${columnIndex}\">" 139 146 -
trunk/grails-app/views/importer/common/_properties_horizontal.gsp
r959 r1141 24 24 <td class="header" width="200px"> 25 25 <b>${header[selentity.columnindex.toInteger()].name}</b> 26 <importer:propertyChooser name="columnproperty" mappingcolumn="${header[selentity.columnindex.toInteger()]}" allfieldtypes="${allfieldtypes}"/>26 <importer:propertyChooser name="columnproperty" mappingcolumn="${header[selentity.columnindex.toInteger()]}" matchvalue="test" "allfieldtypes="${allfieldtypes}"/> 27 27 </td> 28 28 </g:if>
Note: See TracChangeset
for help on using the changeset viewer.