Ignore:
Timestamp:
Feb 11, 2011, 2:59:27 PM (10 years ago)
Author:
t.w.abma@…
Message:
  • added load/save button to mappings page
  • fuzzy button applies fuzzy matching
  • fixed bug when pressing save didn't remember selected properties and went into "fuzzy mode"
  • importmapping instance is stored, but adding the mappingcolumns is the last "todo"
Location:
trunk/grails-app/views/importer/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/importer/common/_on_page.gsp

    r1514 r1515  
    4646         // attach event to apply fuzzy matching
    4747         $('#fuzzymatchselect').click(function() {
     48            $("#fuzzymatching").val("true")
    4849            refreshFlow()
    4950          });
    5051
     52          // open load box
     53          $('#loadpropertiesbutton').click(function() {
     54            $("#loadmapping").toggle("scale")
     55          });
     56
     57          // open save box
    5158          $('#savepropertiesbutton').click(function() {
    5259            var width = 500
  • trunk/grails-app/views/importer/common/_properties_horizontal.gsp

    r1514 r1515  
    1616
    1717
    18 <!-- saveproperties action was defined in the form -->
    19   ${flash.mappingname}
     18<!-- saveproperties action was defined in the form --> 
     19  ${mappingname}
     20
    2021    <table>
    21           <g:each var="stdentity" in ="${GdtService.cachedEntities}">
    22               <% if (importer_selectedentities.any { it.name.toLowerCase() == stdentity.entity.toLowerCase() } && stdentity.entity!="") { %>
    23            
    24               <tr><td colspan="3"><h4>${stdentity.name}</h4></td></tr>
     22              <tr><td colspan="3"><h4>defaultentity</h4></td></tr>
    2523                <tr>
    2624            <td class="header" width="55px">
    2725              <input class="buttonsmall" id="clearselect" type="button" value="Clear" name="clearselect">
    2826              <input class="buttonsmall" id="fuzzymatchselect" type="button" value="Match" name="fuzzymatchselect">
     27              <input type="hidden" name="fuzzymatching" id="fuzzymatching" value="false">
    2928              <input class="buttonsmall" id="savepropertiesbutton" type="button" value="Save" name="savepropertiesbutton">
     29              <input class="buttonsmall" id="loadpropertiesbutton" type="button" value="Load" name="loadpropertiesbutton">
    3030              <div id="savemapping" style="display:none">
    3131                Give current mapping a name and press Save:
    3232                <input type="text" name="mappingname" size="20" id="mappingname">
    3333              </div>
    34             </td>
    35             <g:each var="selentity" in="${importer_selectedentities}">
    36               <g:if test="${selentity.name.toLowerCase()==stdentity.entity.toLowerCase()}">
    37                             <td class="header" width="200px">
    38                                 <b>${importer_header[selentity.columnindex.toInteger()].name}</b>
    39                   <importer:propertyChooser name="columnproperty" mappingcolumn="${importer_header[selentity.columnindex.toInteger()]}" matchvalue="${importer_header[selentity.columnindex.toInteger()].name}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" allfieldtypes="true"/>
    40                             </td>                                       
     34              <div id="loadmapping" style="display:none">
     35                Select an existing mapping and press Load:
     36                <g:select name="importmapping" from="${importer_importmappings}" optionValue="name"/>
     37              </div>
     38            </td>           
     39            <g:each var="mappingcolumn" in="${importer_header}">
     40              <g:if test="${importer_columnproperty}">
     41                <g:set var="selected" value="${importer_columnproperty.index['' + mappingcolumn.index + '']}"/>
    4142              </g:if>
     43
     44                          <td class="header" width="200px">
     45                                <b>${mappingcolumn.name}</b>
     46                  <importer:propertyChooser name="columnproperty" mappingcolumn="${mappingcolumn}" matchvalue="${mappingcolumn.name}" selected="${selected}" fuzzymatching="${importer_fuzzymatching}" template_id="${importer_template_id}" "allfieldtypes="true"/>
     47                          </td>                                 
    4248            </g:each>
    4349                </tr>
     
    5561                </tr>
    5662                </g:each>
    57 
    58           <% }  %> <!-- end of JSP if-->
    59           </g:each>
     63         
    6064    </table>
Note: See TracChangeset for help on using the changeset viewer.