diff --git a/docs/deleting-data.htm b/docs/deleting-data.htm index 7686d5f47..8f3b1e386 100644 --- a/docs/deleting-data.htm +++ b/docs/deleting-data.htm @@ -97,7 +97,7 @@ diff --git a/docs/exporting-data.htm b/docs/exporting-data.htm index 01dacd2ee..b5935d6dd 100644 --- a/docs/exporting-data.htm +++ b/docs/exporting-data.htm @@ -93,7 +93,7 @@ "llink">Filters
  • Subset By Example
  • -
  • XML Export
  • +
  • JSON/YAML/XML Export
  • diff --git a/docs/exporting-xml.html b/docs/exporting-xml.html index dcb08f556..962825c81 100644 --- a/docs/exporting-xml.html +++ b/docs/exporting-xml.html @@ -1,7 +1,7 @@ - Jailer - XML Export + Jailer - JSON/YAML/XML Export @@ -97,7 +97,7 @@ @@ -124,8 +124,9 @@ - This tutorial shows you how to export data to XML and how to define - the structure of the XML document.
    + This tutorial shows you how to export data into XML files and how to define + the structure of the documents.
    + The export to JSON or YAML files works in the same way.

    Objective

    Exporting all the data related to the employee @@ -135,10 +136,9 @@

    Step 1. Switch to XML-mode.

    Load the model Demo-Scott.jm and switch to XML mode. An additional panel named - "XML Mapping" will appear.

    + "font-family: monospace;">Demo-Scott.jm and switch to XML mode.

    -


    +



    @@ -165,16 +165,11 @@ -

    Step 3. Defining the XML structure

    +

    Step 3. Defining the structure

    -

    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.

    +

    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.

    -

    Set the aggregation-type to 'implicit list' for the - associations:

    +

    Define the following associations as aggregations (as 'implicit list'):

    set the aggregation-type to 'explicit list' with - 'participations' as tag for the association:
    + Define the following associations as aggregations (as 'explicit list'):
    and set the aggregation-type to 'flat' for the associations: + and the following associations as 'flat' aggregations:
    -
    +


    Export data into a file map column" button or via the context menu of a + "font-style: italic;">Column Mapping ..." button or via the context menu of a table.

    The column mapping template of a - table describes the XML represenation of each exported row:
    + table describes the XML (JSON/YAML) represenation of each exported row:


    +
  • j:assoc elements will be + replaced by the representation of the associated rows.
  • + +
  • An j:if-not-null attribute determines whether an element should be written.
    + The attribute value is an SQL expression (analogous to the expressions after SQL:).
    + If it evaluates to null, the element is omitted. The j:if-null attributes work in the opposite way. +
  • + In addition, parameters can be used here, to which values can then be assigned in the "Export Data" dialog or via CLI.

    We change the mapping in the following way:
    1. Foreign keys should not appear in the XML document as they are redundant.
    2. -
    3. Map primary keys to attributes rather than elements.
    4. +
    5. Map primary keys to attributes rather than elements. (Attributes are not supported in JSON or YAML files!)
    6. Some elements of ROLE and PROJECT should be renamed. Their names are - not unique due to the flat embedment into PROJECT_PARTICIPATION:
      + not unique due to the flat embedding into PROJECT_PARTICIPATION:
      • Rename the ROLE-tag

    - Open the mapping dialog for table EMPLYOEE:
    + Open the Column Mapping dialog for table EMPLYOEE:

    -
    +

    Remove the elements 'empno', 'boss' and Export data into a file
  • Subset By Example
  • -
  • XML Export
  • +
  • JSON/YAML/XML Export
  • diff --git a/docs/preparation.htm b/docs/preparation.htm index a37796d33..8fa195871 100644 --- a/docs/preparation.htm +++ b/docs/preparation.htm @@ -93,7 +93,7 @@ "llink">Filters
  • Subset By Example
  • -
  • XML Export
  • +
  • JSON/YAML/XML Export
  • @@ -119,6 +119,7 @@ +

    Note: If you do not want to prepare a database yourself, you can use the included "Demo-Scott" database instead.


    Step 1. Setup the database

    Create a new database schema and execute Subset By Example -

  • XML Export
  • +
  • JSON/YAML/XML Export
  • diff --git a/docs/xmlt1.gif b/docs/xmlt1.gif index 933338210..93d745f41 100644 Binary files a/docs/xmlt1.gif and b/docs/xmlt1.gif differ diff --git a/docs/xmlt1.png b/docs/xmlt1.png new file mode 100644 index 000000000..a70376267 Binary files /dev/null and b/docs/xmlt1.png differ diff --git a/docs/xmlt2.gif b/docs/xmlt2.gif index 7a0e07bd1..87296b70e 100644 Binary files a/docs/xmlt2.gif and b/docs/xmlt2.gif differ diff --git a/docs/xmlt2.png b/docs/xmlt2.png new file mode 100644 index 000000000..c8be8de2d Binary files /dev/null and b/docs/xmlt2.png differ diff --git a/docs/xmlt3.gif b/docs/xmlt3.gif index edd40ab16..7160fa191 100644 Binary files a/docs/xmlt3.gif and b/docs/xmlt3.gif differ diff --git a/docs/xmlt3.png b/docs/xmlt3.png new file mode 100644 index 000000000..f7db86e9e Binary files /dev/null and b/docs/xmlt3.png differ diff --git a/extractionmodel/Demo-Scott.jm b/extractionmodel/Demo-Scott.jm index 4ca4c3297..62b2ee2cd 100644 --- a/extractionmodel/Demo-Scott.jm +++ b/extractionmodel/Demo-Scott.jm @@ -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 diff --git a/src/main/engine/net/sf/jailer/xml/XmlRowWriter.java b/src/main/engine/net/sf/jailer/xml/XmlRowWriter.java index ca21b0f08..ea5af3254 100644 --- a/src/main/engine/net/sf/jailer/xml/XmlRowWriter.java +++ b/src/main/engine/net/sf/jailer/xml/XmlRowWriter.java @@ -451,6 +451,3 @@ public class XmlRowWriter { } } - -// TODO -// TODO docu about "j:if-not-null"/"j:is-null" in template dialog diff --git a/src/main/gui/net/sf/jailer/ui/ColumnMapperDialog.java b/src/main/gui/net/sf/jailer/ui/ColumnMapperDialog.java index 27ec77a19..78aaa102f 100644 --- a/src/main/gui/net/sf/jailer/ui/ColumnMapperDialog.java +++ b/src/main/gui/net/sf/jailer/ui/ColumnMapperDialog.java @@ -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