The documentation has been updated
@@ -97,7 +97,7 @@
|
||||
<ul>
|
||||
<li><a href="subset-by-example.html" target="_self" class=
|
||||
"llink">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
"llink">Filters</a> </li>
|
||||
<li><a href="subset-by-example.html" target="_self" class=
|
||||
"llink">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
|
||||
<title>Jailer - XML Export</title>
|
||||
<title>Jailer - JSON/YAML/XML Export</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
|
||||
<meta name="description" content="Data Export Tool" />
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
@@ -97,7 +97,7 @@
|
||||
<ul>
|
||||
<li><a href="subset-by-example.html" target="_self" class=
|
||||
"llink">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llinkA">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llinkA">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -124,8 +124,9 @@
|
||||
<tr>
|
||||
<td class="content" height="520" valign="top" width="100%">
|
||||
|
||||
This tutorial shows you how to export data to XML and how to define
|
||||
the structure of the XML document.<br />
|
||||
This tutorial shows you how to export data into XML files and how to define
|
||||
the structure of the documents.<br />
|
||||
The export to JSON or YAML files works in the same way.
|
||||
<br />
|
||||
|
||||
<h4>Objective</h4>Exporting all the data related to the employee
|
||||
@@ -135,10 +136,9 @@
|
||||
<h4>Step 1. Switch to XML-mode.<br /></h4>
|
||||
|
||||
<p>Load the model <big><span style=
|
||||
"font-family: monospace;">Demo-Scott.jm</span></big> and switch to XML mode. An additional panel named
|
||||
"XML Mapping" will appear.<br /></p>
|
||||
"font-family: monospace;">Demo-Scott.jm</span></big> and switch to XML mode.<br /></p>
|
||||
|
||||
<p><img alt="" src="xmlt1.gif" /><br /></p>
|
||||
<p><img alt="" src="xmlt1.png" /><br /></p>
|
||||
|
||||
<p><br /></p>
|
||||
|
||||
@@ -165,16 +165,11 @@
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h4>Step 3. Defining the XML structure</h4>
|
||||
<h4>Step 3. Defining the structure</h4>
|
||||
|
||||
<p>In the "XML Mapping" panel you can define the aggregation-type
|
||||
for each association. If the aggregation-type an association from
|
||||
table A to B is not 'none', than the XML representation of entities
|
||||
from table B will be embedded into the XML representation of the
|
||||
associated entities from table A.<br /></p>
|
||||
<p>You can now specify for each association whether it is an aggregation. If an association from table A to B is an aggregation, the XML (JSON/YAML) representations of the entities from table B are embedded into the XML representation of the associated entities from table A.<br /></p>
|
||||
|
||||
<p>Set the aggregation-type to 'implicit list' for the
|
||||
associations:<br /></p>
|
||||
<p>Define the following associations as aggregations (as 'implicit list'):<br /></p>
|
||||
|
||||
<ul>
|
||||
<li>BOSS (from EMPLOYEE to EMPLOYEE)</li>
|
||||
@@ -184,13 +179,12 @@
|
||||
<li>from EMPLOYEE to SALARYGRADE. Change the tag name to
|
||||
<span style="font-style: italic;">salary_grade</span>.<br />
|
||||
<br /></li>
|
||||
</ul>set the aggregation-type to 'explicit list' with
|
||||
'participations' as tag for the association:<br />
|
||||
</ul>Define the following associations as aggregations (as 'explicit list'):<br />
|
||||
|
||||
<ul>
|
||||
<li>from EMPLOYEE to PROJECT_PARTICIPATION<br />
|
||||
<br /></li>
|
||||
</ul>and set the aggregation-type to 'flat' for the associations:
|
||||
</ul>and the following associations as 'flat' aggregations:
|
||||
|
||||
<ul>
|
||||
<li>from EMPLOYEE to PROJECT_PARTICIPATION</li>
|
||||
@@ -199,7 +193,7 @@
|
||||
|
||||
<li>from PROJECT_PARTICIPATION to ROLE<br /></li>
|
||||
</ul><br />
|
||||
<img alt="" src="xmlt2.gif" /><br />
|
||||
<img alt="" src="xmlt2.png" /><br />
|
||||
|
||||
<p><br />
|
||||
Export data into a file <a href="scott-2.xml"><img style=
|
||||
@@ -230,31 +224,36 @@
|
||||
allows you to define how columns will be mapped to XML elements or
|
||||
attributes. By default each column is mapped to an element with the same
|
||||
name. You can open the dialog using the "<span style=
|
||||
"font-style: italic;">map column</span>" button or via the context menu of a
|
||||
"font-style: italic;">Column Mapping ...</span>" button or via the context menu of a
|
||||
table.<br />
|
||||
<br />
|
||||
The <span style="font-style: italic;">column mapping template</span> of a
|
||||
table describes the XML represenation of each exported row:<br />
|
||||
table describes the XML (JSON/YAML) represenation of each exported row:<br />
|
||||
|
||||
<ul>
|
||||
<li>Expression starting with <span style="font-style: italic;">SQL:</span>
|
||||
<li>Expression starting with <span style="font-style: italic;"><font color="#0000bb">SQL:</font></span>
|
||||
will be replaced by the value of the SQL expression thereafter.
|
||||
<span style="font-style: italic;">T</span> is the alias for the row. Note
|
||||
<span style="font-style: italic;"><font color="#0000bb">T</font></span> is the alias for the row. Note
|
||||
that even scalar subqueries are allowed here.</li>
|
||||
|
||||
<li><span style="font-style: italic;">j:assoc</span> elements will be
|
||||
replaced by the XML representation of the associated rows.<br /></li>
|
||||
</ul><br />
|
||||
<li><span style="font-style: italic;"><font color="#0000bb">j:assoc</font></span> elements will be
|
||||
replaced by the representation of the associated rows.<br /></li>
|
||||
|
||||
<li>An <span style="font-style: italic;"><font color="#0000bb">j:if-not-null</font></span> attribute determines whether an element should be written. <br>
|
||||
The attribute value is an SQL expression (analogous to the expressions after <span style="font-style: italic;"><font color="#0000bb">SQL:</font></span>).<br>
|
||||
If it evaluates to <span style="font-style: italic;"><font color="#0000bb">null</font></span>, the element is omitted. The <span style="font-style: italic;"><font color="#0000bb">j:if-null</font></span> attributes work in the opposite way.
|
||||
</li>
|
||||
</ul>In addition, parameters can be used here, to which values can then be assigned in the "Export Data" dialog or via CLI.<br /><br />
|
||||
We change the mapping in the following way:<br />
|
||||
|
||||
<ol>
|
||||
<li>Foreign keys should not appear in the XML document as they are
|
||||
redundant.<br /></li>
|
||||
|
||||
<li>Map primary keys to attributes rather than elements.</li>
|
||||
<li>Map primary keys to attributes rather than elements. (Attributes are not supported in JSON or YAML files!)</li>
|
||||
|
||||
<li>Some elements of ROLE and PROJECT should be renamed. Their names are
|
||||
not unique due to the flat embedment into PROJECT_PARTICIPATION:<br />
|
||||
not unique due to the flat embedding into PROJECT_PARTICIPATION:<br />
|
||||
|
||||
<ul>
|
||||
<li>Rename the ROLE-tag <span style=
|
||||
@@ -275,9 +274,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
</ol><br />
|
||||
Open the mapping dialog for table EMPLYOEE:<br />
|
||||
Open the Column Mapping dialog for table EMPLYOEE:<br />
|
||||
<br />
|
||||
<img alt="" src="xmlt3.gif" /><br />
|
||||
<img alt="" src="xmlt3.png" /><br />
|
||||
<br />
|
||||
Remove the elements <span style="font-style: italic;">'empno',</span>
|
||||
<span style="font-style: italic;">'boss'</span> and <span style=
|
||||
@@ -332,12 +331,11 @@
|
||||
Do the following:<br />
|
||||
|
||||
<ul>
|
||||
<li>set the aggregation-type of association 'BOSS' to 'none'.</li>
|
||||
<li>Define the 'BOSS' to 'BOSS' association on the "parent" (red) side to become an aggregation. (The aggregation on the opposite side is then automatically removed).<br>
|
||||
</li>
|
||||
<li>Use the "Column Mapping for EMPLOYEE" dialog to set the name of the 'inverse-BOSS' association to 'subordinates'.</li>
|
||||
|
||||
<li>set the aggregation-type of association 'inverse-BOSS' to 'explicit
|
||||
list', set tag name to 'subordinates'.</li>
|
||||
|
||||
<li>remove restriction from 'inverse-BOSS' association.<br /></li>
|
||||
<li>remove the restriction from 'inverse-BOSS' association (the "child" side).<br /></li>
|
||||
|
||||
<li>set where-condition to T.NAME='KING'.</li>
|
||||
</ul>Export data into a file <a href="scott-4.xml"><img style=
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<ul>
|
||||
<li><a href="subset-by-example.html" target="_self" class=
|
||||
"llink">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
"llink">Filters</a> </li>
|
||||
<li><a href="subset-by-example.html" target="_self" class=
|
||||
"llink">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
|
||||
<tr>
|
||||
<td class="content" height="520" valign="top" width="100%">
|
||||
<h3><font color=#008800">Note: If you do not want to prepare a database yourself, you can use the included "Demo-Scott" database instead.</font></h3> <br>
|
||||
<h4>Step 1. Setup the database<br /></h4>
|
||||
|
||||
<p>Create a new database schema and execute <a href=
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
@@ -98,7 +98,7 @@
|
||||
<li><a href=
|
||||
"subset-by-example.html" target=
|
||||
"_self" class="llinkA">Subset By Example</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">XML Export</a> </li>
|
||||
<li><a href="exporting-xml.html" target="_self" class="llink">JSON/YAML/XML Export</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
BIN
docs/xmlt1.gif
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 76 KiB |
BIN
docs/xmlt1.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
docs/xmlt2.gif
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 72 KiB |
BIN
docs/xmlt2.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
docs/xmlt3.gif
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 58 KiB |
BIN
docs/xmlt3.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
@@ -1,40 +1,28 @@
|
||||
# subject; condition
|
||||
EMPLOYEE; T.NAME='SCOTT'
|
||||
# subject; condition; limit; limit-order
|
||||
EMPLOYEE; T.NAME='SCOTT'; ;
|
||||
|
||||
# association; ; restriction-condition
|
||||
inverse-DEPARTMENT; ; ignore
|
||||
inverse-BOSS; ; ignore
|
||||
inverse-DEPARTMENT; ; ignore
|
||||
inverse-PROJECT; ; ignore
|
||||
inverse-ROLE; ; ignore
|
||||
inverse-SALARY; ; ignore
|
||||
|
||||
#! block additional subjects
|
||||
# subject; condition; limit; limit-order
|
||||
|
||||
#! block xml-mapping
|
||||
inverse-SALARY;employee;NONE
|
||||
BONUS;bonus;NONE
|
||||
SALARY;salary_grade;IMPLICIT_LIST
|
||||
DEPARTMENT;department;IMPLICIT_LIST
|
||||
BOSS;boss;IMPLICIT_LIST
|
||||
inverse-BOSS;employee;NONE
|
||||
inverse-EMPLOYEE;participations;EXPLICIT_LIST
|
||||
inverse-ROLE;project_participation;NONE
|
||||
inverse-PROJECT;project_participation;NONE
|
||||
ROLE;role;FLAT
|
||||
EMPLOYEE;employee;NONE
|
||||
PROJECT;project;FLAT
|
||||
inverse-DEPARTMENT;employee;NONE
|
||||
inverse-BONUS;employee;NONE
|
||||
|
||||
#! block datamodelfolder
|
||||
Demo-Scott
|
||||
|
||||
#! block additional subjects
|
||||
|
||||
#! block export modus
|
||||
SQL
|
||||
XML
|
||||
|
||||
#! block xml settings
|
||||
yyyy-MM-dd;yyyy-MM-dd-HH.mm.ss;entities
|
||||
|
||||
yyyy-MM-dd;yyyy-MM-dd-HH.mm.ss;entities;false;true;false;false;false
|
||||
#! block xml column mapping
|
||||
#! block upserts
|
||||
#! block exclude from deletion
|
||||
|
||||
@@ -43,24 +31,25 @@ yyyy-MM-dd;yyyy-MM-dd-HH.mm.ss;entities
|
||||
#! block filter templates
|
||||
|
||||
#! block layout
|
||||
EMPLOYEE; SALARYGRADE; -174.31384969615323; 96.71389881557332; 1.0
|
||||
EMPLOYEE; EMPLOYEE; -85.64236262694305; -2.2029728159258752; 1.0
|
||||
EMPLOYEE; BOSS#; -41.745963805266626; -69.9528069883284; 1.0
|
||||
EMPLOYEE; ROLE; 107.4111348302336; 90.36657518763403; 1.0
|
||||
EMPLOYEE; BOSS#; -41.745963805266626; -69.9528069883284; 1.0
|
||||
EMPLOYEE; PROJECT; 270.71401723489475; -4.019052749278217; 1.0
|
||||
EMPLOYEE; $ZOOMBOX; 0.0; 0.0; 1.0
|
||||
EMPLOYEE; EMPLOYEE; -85.64236262694305; -2.2029728159258752; 1.0
|
||||
EMPLOYEE; BONUS; -177.91060377315253; -64.48735854019623; 1.0
|
||||
EMPLOYEE; DEPARTMENT; -38.34457182130592; 95.1431476735292; 1.0
|
||||
EMPLOYEE; SALARYGRADE; -174.31384969615323; 96.71389881557332; 1.0
|
||||
EMPLOYEE; PROJECT_PARTICIPATION; 106.20831216593035; -3.732194262449468; 1.0
|
||||
|
||||
#! block known
|
||||
BONUS
|
||||
BOSS
|
||||
DEPARTMENT
|
||||
EMPLOYEE
|
||||
PROJECT
|
||||
ROLE
|
||||
SALARY
|
||||
# known association; decision pending
|
||||
BONUS;
|
||||
BOSS;
|
||||
DEPARTMENT;
|
||||
EMPLOYEE;
|
||||
PROJECT;
|
||||
ROLE;
|
||||
SALARY;
|
||||
|
||||
#! block version
|
||||
6.7.4
|
||||
16.4.0.1
|
||||
|
||||
@@ -451,6 +451,3 @@ public class XmlRowWriter {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO
|
||||
// TODO docu about "j:if-not-null"/"j:is-null" in template dialog
|
||||
|
||||
@@ -624,14 +624,3 @@ public class ColumnMapperDialog extends javax.swing.JDialog {
|
||||
|
||||
private static final long serialVersionUID = -5437578641818236294L;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// TODO parameter panel:
|
||||
// TODO docu? grundsaetzlich, as link to docu?
|
||||
|
||||
// TODO
|
||||
// TODO doku: "tutorial"/"preparation": too(ooooo) old!
|
||||
|
||||
// TODO
|
||||
// TODO update docu
|
||||
// TODO add some template examples
|
||||
|
||||