root/trunk/grails-app/views/importer/common/_properties_horizontal.gsp @ 1555

Revision 1555, 3.8 KB (checked in by t.w.abma@…, 3 years ago)

- disabled <Enter> key to prevent submission of form (JS)
- using matching, going to step 3 and back to 2 (next/prev) manually changed properties are now remembered instead of automatically being rematched
- added simple explanation to buttons via title attribute

  • Property svn:keywords set to Rev Author Date
Line 
1<%@ page import="org.dbnp.gdt.GdtService" %>
2<%
3        /**
4         * Properties template which shows entities and allows to assign properties to columns
5         *
6         * @author Tjeerd Abma
7         * @since 20100210
8         * @package importer
9         *
10         * Revision information:
11         * $Rev$
12         * $Author$
13         * $Date$
14         */
15%>
16
17
18<!-- saveproperties action was defined in the form --> 
19  ${mappingname}
20
21    <table>
22              <tr><td colspan="3"><h4>defaultentity</h4></td></tr>
23                <tr>
24            <td class="header" width="55px">
25              <input class="buttonsmall" id="clearselect" type="button" value="Clear" name="clearselect" title="Clear all selections">
26              <input class="buttonsmall" id="fuzzymatchselect" type="button" value="Match" name="fuzzymatchselect" title="Automatically match columns to properties">
27              <input type="hidden" name="fuzzymatching" id="fuzzymatching" value="false">
28              <input class="buttonsmall" id="savepropertiesbutton" type="button" value="Save" name="savepropertiesbutton" title="Save the currently set mappings">
29              <input class="buttonsmall" id="loadpropertiesbutton" type="button" value="Load" name="loadpropertiesbutton" title="Load previously saved mappings">
30              <div id="savemapping" style="display:none">
31                Give current mapping a name and press Save:
32                <input type="text" name="mappingname" size="20" id="mappingname">
33              </div>
34              <div id="loadmapping" style="display:none">
35                Select an existing mapping and press Load:
36                <g:select name="importmapping_id" from="${importer_importmappings}" noSelection="['':'-Select mapping-']" optionValue="name" optionKey="id"/>
37              </div>
38            </td>
39           
40            <g:set var="usedfuzzymatches" value="${'-'}"/>
41
42            <g:each var="mappingcolumn" in="${importer_header}">
43              <!-- set selected values based on submitted columnproperties, actually refresh -->
44              <g:if test="${importer_columnproperty}">
45                <g:set var="selected" value="${importer_columnproperty.index['' + mappingcolumn.index + '']}"/>
46              </g:if>
47              <g:else>
48                <g:set var="selected" value="${mappingcolumn.property}"/>
49              </g:else>
50
51              <g:set var="matchvalue" value="${mappingcolumn.name}"/>
52
53                          <td class="header" width="200px">
54                                <b>${mappingcolumn.name}</b>
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
69            </g:each>
70                </tr>
71
72        <g:each var="row" in="${session.importer_datamatrix}">
73                <tr>
74                  <td class="datamatrix">                   
75                  </td>
76                    <g:each var="cell" in="${row}">
77                        <td class="datamatrix">
78                            <g:if test="${cell.toString()==''}">.</g:if>
79                            <g:else><importer:displayCell cell="${cell}"/></g:else>
80                        </td>
81                    </g:each>
82                </tr>
83                </g:each>
84         
85    </table>
Note: See TracBrowser for help on using the browser.