Changeset 1143 for trunk/grails-app
- Timestamp:
- Nov 16, 2010, 11:47:46 AM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1141 r1143 39 39 40 40 def index = { 41 //String.metaClass.mostSimilarTo = { ImporterService.mostSimilar(delegate, it) }42 43 //session.import_referer = request.forwardURI44 41 // should do a check what is in the url, strip it? 45 42 session.import_referer = params.redirectTo -
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r1141 r1143 538 538 } 539 539 540 static def stringSimilarity (l_str, r_str, degree=2) { 541 similarity(l_str.toLowerCase().toCharArray(), 542 r_str.toLowerCase().toCharArray(), 540 static def stringSimilarity (l_str, r_str, degree=2) { 541 542 similarity(l_str.toString().toLowerCase().toCharArray(), 543 r_str.toString().toLowerCase().toCharArray(), 543 544 degree) 544 545 } -
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r1141 r1143 140 140 def createPropertySelect(String name, options, matchvalue, Integer columnIndex) 141 141 { 142 // String.metaClass.mostSimilarTo = { ImporterService.mostSimilar(delegate, it) }143 //println "mostsimilar="+ImporterService.mostSimilar(matchvalue, options)142 // Determine which field in the options list matches the best with the matchvalue 143 def mostsimilar = ImporterService.mostSimilar(matchvalue, options) 144 144 145 145 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${columnIndex}\">" 146 146 147 res += "<option value=\"dontimport\" selected>Don't import</option>"147 res += "<option value=\"dontimport\">Don't import</option>" 148 148 149 149 options.each { f -> 150 res+= "<option value=\"${f.name}\">" 151 150 res+= "<option value=\"${f.name}\"" 151 152 res+= (mostsimilar.toString().toLowerCase()==f.name.toLowerCase()) ? 153 " selected>" : 154 ">" 155 152 156 res+= (f.preferredIdentifier) ? 153 157 "${f.name} (IDENTIFIER)</option>" : -
trunk/grails-app/views/importer/common/_properties_horizontal.gsp
r1141 r1143 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()]}" matchvalue=" test" "allfieldtypes="${allfieldtypes}"/>26 <importer:propertyChooser name="columnproperty" mappingcolumn="${header[selentity.columnindex.toInteger()]}" matchvalue="${header[selentity.columnindex.toInteger()].name}" allfieldtypes="${allfieldtypes}"/> 27 27 </td> 28 28 </g:if> -
trunk/grails-app/views/importer/index_simple.gsp
r1103 r1143 56 56 57 57 $(document).ready(function() { 58 59 // handle template selects 60 new SelectAddMore().init({ 61 rel : 'template', 62 url : '/gscf/templateEditor', 63 vars : 'entity', // can be a comma separated list of variable names to pass on 64 label : 'add / modify..', 65 style : 'modify', 66 onClose : function(scope) { 67 refreshWebFlow(); 68 } 69 }); 70 58 71 59 72 $('#simplewizardform').submit(function() { … … 73 86 74 87 </g:javascript> 88 89 <g:if env="production"> 90 <script type="text/javascript" src="${resource(dir: 'js', file: 'SelectAddMore.min.js')}"></script> 91 </g:if><g:else> 92 <script type="text/javascript" src="${resource(dir: 'js', file: 'SelectAddMore.js')}"></script> 93 </g:else> 94 75 95 </head> 76 96 <body> … … 125 145 <td> 126 146 <g:select 147 rel="template" 127 148 name="entity" 128 149 id="entity"
Note: See TracChangeset
for help on using the changeset viewer.