From version < 8.1 >
edited by nlo
on 09.05.2019, 16:58
To version < 10.2 >
edited by nlo
on 10.05.2019, 15:48
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,37 +1,94 @@
1 1  {{content/}}
2 2  
3 3  {{id name="fig_data_source"/}}
4 -{{figure image="data_source_en.png" }}
5 -Configuration screen for creating data sources: (1) list of existing data sources, (2) area for editing the selected data source, (3) settings panel of the data source, (4) servlet URL for accessing the data source.
6 -{{/figure}}
4 +{{figure image="data_source_en.png"}}Configuration screen for creating data sources: (1) list of existing data sources, (2) area for editing the selected data source, (3) settings panel of the data source, (4) servlet URL for accessing the data source.{{/figure}}
7 7  
8 8  The sources or rather data sources are lodged as text in the format CSV, JSON or XML and can be worked up through the {{designer/}}/the form.
9 9  To have an access to data sources in the script area via javascript too, all data sources are converted into a JSON structure and customized in the object {{code}}XFC_METADATA.urls.datasource_[csv|json|xml]{{/code}}. The structure of this JSON structure for the different data sources is expounded in the respective section.
10 10  
11 -== CSV ==
9 +{{info}}
10 +**Servlet URL**
11 +The servlet URL of a data source will be displayed on the configuration screen (see point 4 in [[figure>>||anchor="fig_data_source"]]) and is provided in the JS object {{code}}XFC_METADATA.urls.datasource_[csv|json|xml]{{/code}}.
12 +{{/info}}
12 12  
13 -Here you can insert data sets in the CSV format.
14 +== Creating a data source ==
14 14  
15 -* Choose the option //CSV// under //type//.
16 -* Assign an explicit name.
17 -* Insert the data sperated with a comma in the arrey //value//.
16 +Open the module "Data > Sources" and click the button "New" {{ficon name="plus-circle-outline"/}} in the header of the list (see point 1 in [[figure>>||anchor="fig_data_source"]]). After that you will be prompted to either create an empty data source or import one from a file. Three types of data sources can be created: //XML//, //CSV// und //JSON//.
18 18  
19 -{{figure image="datenquelle_csv_8.png" width="300"}}
20 -The JSON structure of the CSV data source. To this JSON structure can only be accessed via {{code}}XFC_METADATA.urls.datasource_[csv|json|xml]{{/code}}.
18 +{{lightbox image="data_source_new_en.png" title="Data sources can be imported or created from scratch."/}}
19 +
20 +Every data source needs:
21 +
22 +* a unique name (in the settings panel: see point 3 in [[figure>>||anchor="fig_data_source"]])
23 +* the actual data in the editing area (see point 2 in [[figure>>||anchor="fig_data_source"]])
24 +
25 +=== Import of data sources from files ===
26 +
27 +The following Data types can be used to import data sources:
28 +
29 +* **XML**: //.xml//
30 +* **CSV**: //.csv//, //.xls//, //.xlsx// (Excel)
31 +* **JSON**: //.json//
32 +
33 +{{id name="data_source_import_csv"/}}
34 +__CSV data sources__
35 +
36 +CSV data sources can be imported from different file types:
37 +
38 +* //.csv//
39 +Opens up a dialog for configuring the import:
40 +** **Delimiter**: Determines which symbol is used in the file for separating data fields/ colunms (typically: comma).
41 +** **Text qualifier**: Determines the text qualifier. This symbol is used to support special characters inside data fields (e.g. comma in numbers with decimal places).
42 +** **Start at line**: Determines where to start importing the data source from.
43 +** **Ignore empty lines**: When activated ignores empty lines during import.
44 +
45 +{{lightbox image="data_source_import_csv_en.png" title="Import dialog for CSV files"/}}
46 +
47 +* //.xls//, //.xlsx//
48 +Opens up a dialog for configuring the import:
49 +** **Sheets to import**: Determines which worksheets/tables should be imported from the file.
50 +
51 +{{lightbox image="data_source_import_excel_en.png" title="Importdialog für Excel-Dateien"/}}
52 +
53 +__Drag&Drop__
54 +
55 +Data sources can be imported by Drag&Drop as well. If a file is being dropped over the list (green area) than a new data source of the corresponding type will be created (for Excel files: one data source per worksheet will be created). If a file is being dropped over an existing data source than it will be updated. Changes will only take effect after the "Save" {{icon name="save"/}} button is clicked.
56 +
57 +== CSV ==
58 +
59 +{{figure image="data_source_csv_servlet_json_comparison.png"}}
60 +The JSON structure of a CSV data source. This JSON structure can be accessed through JavaScript via {{code}}XFC_METADATA.urls.datasource_csv{{/code}}. (1) On the left there is the JSON structure of the data source with out using the first row as a header. Instead the headers are of the form: {{code}}colX{{/code}}. (2) On the right there is the data source where the first row is being used as the header.
21 21  {{/figure}}
22 22  
23 -=== Example for a CSV data source ===
63 +CSV-Datenquellen können in einer Quellcode-Ansicht oder in einer Tabellenansicht dargestellt werden. Die Ansicht kann mit einem Klick auf die entsprechende Schaltfläche {{ficon name="table-large"/}}/{{icon name="code"/}} in der Fußzeile unterhalb des Editierbereichs geändert werden.
24 24  
25 -{{info}}
26 -The CSV data are converted to a JSON object internally, so that the first line of the //CSV data// always defines the object names for the later access.
27 -{{/info}}
65 +//Quellcode-Ansicht einer CSV-Datenquelle//: ([[CSV Dateiformat>>https://de.wikipedia.org/wiki/CSV_(Dateiformat)||target="_blank"]])
66 +{{lightbox image="data_source_csv_source.png" title="Quellcode-Ansicht einer CSV-Datenquelle"/}}
67 +//Tabellenansicht einer CSV-Datenquelle//:
68 +{{lightbox image="data_source_csv_table.png" title="Tabellenansicht einer CSV-Datenquelle"/}}
28 28  
29 -{{code}}
30 -Value 1.1, value 1.2, value 1.3, value 1.4, ...
31 -{{/code}}
70 +=== Bearbeitung von CSV-Tabellen ===
32 32  
33 -The readout of the values in the {{designer/}} ensues through the //servlet// with the namen //datenquellecsv//.
72 +Zum Bearbeitung einer CSV-Tabelle befinden sich unterhalb des Editierbereichs eine Reihe von Schaltflächen:
34 34  
74 +* {{ficon name="plus-circle"/}} **Einfügen**: Fügt neue Zeilen oder Spalten relativ zur derzeit selektierten Zelle ein.
75 +* {{ficon name="trash-alt2"/}} **Entfernen**: Entfernt die selektierte Zeile oder Spalte oder leert die selektierte Zelle.
76 +* {{icon name="upload"/}} **Importieren**: Öffnet den [[Dialog zum Importieren von CSV-Datenquellen>>||anchor="data_source_import_csv"]].
77 +* {{icon name="code"/}} **Quellcode-Ansicht**: Wechselt in die Quellcode-Ansicht.
78 +
79 +=== Header von CSV-Datenquellen ===
80 +
81 +Für CSV-Datenquellen gibt es eine zusätzliche Option in den Datenquelleinstellungen. Die Option **Erste Zeile ist Header** regelt den Zugriff auf die Werte der Datenquelle über das entsprechende Servlet ({{code}}XFC_METADATA.urls.datasource_csv{{/code}}):
82 +
83 +* **Aktiviert**:
84 +Die Zellen der erste Zeile werden als Schlüssel bzw. {{code}}keys{{/code}} für den Zugriff auf die Werte der jeweiligen Spalte verwendet (siehe [[Anwendungsbeispiel>>||anchor="data_source_csv_example"]]).
85 +* **Deaktiviert**:
86 +Die Schlüssel bzw. {{code}}keys{{/code}} für den Zugriff auf die Werte der einzelnen Datensätze/Zeilen sind durchnummeriert, beginnend mit {{code}}0{{/code}}. Diese Schlüssel haben folgende Form: {{code}}colX{{/code}}, wobei {{code}}X{{/code}} für den Index der Spalte steht.
87 +
88 +{{lightbox image="data_source_csv_settings_de.png" title="Die Option **Erste Zeile ist Header** regelt den Zugriff auf die Werte der Datenquelle über das entsprechende Servlet"/}}
89 +
90 +CSV-Datenquellen können im {{designer case="dat"/}} über das //Servlet// mit Namen {{code}}XFC_METADATA.urls.datasource_csv{{/code}} ausgelsen werden.
91 +
35 35  === Servlet parameters ===
36 36  
37 37  {{info}}
Copyright 2000-2024