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: 1552 $ |
---|
12 | * $Author: t.w.abma@umcutrecht.nl $ |
---|
13 | * $Date: 2011-02-23 12:25:46 +0000 (wo, 23 feb 2011) $ |
---|
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"> |
---|
26 | <input class="buttonsmall" id="fuzzymatchselect" type="button" value="Match" name="fuzzymatchselect"> |
---|
27 | <input type="hidden" name="fuzzymatching" id="fuzzymatching" value="false"> |
---|
28 | <input class="buttonsmall" id="savepropertiesbutton" type="button" value="Save" name="savepropertiesbutton"> |
---|
29 | <input class="buttonsmall" id="loadpropertiesbutton" type="button" value="Load" name="loadpropertiesbutton"> |
---|
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> |
---|