From version < 10.1 >
edited by nlo
on 10.05.2019, 15:43
To version < 11.1 >
edited by nlo
on 10.05.2019, 16:00
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,9 +1,7 @@
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.
... ... @@ -58,28 +58,39 @@
58 58  
59 59  == CSV ==
60 60  
61 -Here you can insert data sets in the CSV format.
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.
61 +{{/figure}}
62 62  
63 -* Choose the option //CSV// under //type//.
64 -* Assign an explicit name.
65 -* Insert the data sperated with a comma in the arrey //value//.
63 +CSV data sources can be viewed in a source code view or in a table view. The view can be switched by clicking the appropriate button {{ficon name="table-large"/}}/{{icon name="code"/}} beneath the editing area.
66 66  
67 -{{figure image="datenquelle_csv_8.png" width="300"}}
68 -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}}.
69 -{{/figure}}
65 +//Source code view of a CSV data source//: ([[CSV file format>>https://en.wikipedia.org/wiki/Comma-separated_values||target="_blank"]])
66 +{{lightbox image="data_source_csv_source.png" title="Source code view of a CSV data source"/}}
67 +//Table view of a CSV data source//:
68 +{{lightbox image="data_source_csv_table.png" title="Table view of a CSV data source"/}}
70 70  
71 -=== Example for a CSV data source ===
70 +=== Editing CSV tables ===
72 72  
73 -{{info}}
74 -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.
75 -{{/info}}
72 +There is a row of buttons beneath the editing area for editing the CSV data table:
76 76  
77 -{{code}}
78 -Value 1.1, value 1.2, value 1.3, value 1.4, ...
79 -{{/code}}
74 +* {{ficon name="plus-circle"/}} **Insert**: Inserts new rows or columns relative to the selected cell.
75 +* {{ficon name="trash-alt2"/}} **Remove**: Removes the selected row(s) or column(s) or empties the selected cell.
76 +* {{icon name="upload"/}} **Import**: Opens up the [[dialog for importing CSV data sources>>||anchor="data_source_import_csv"]].
77 +* {{icon name="code"/}} **Source code view**: Switches to source code view.
80 80  
81 -The readout of the values in the {{designer/}} ensues through the //servlet// with the namen //datenquellecsv//.
79 +=== Header of CSV data sources ===
82 82  
81 +There is an additional option for CSV data sources in the data source settings. The option **First row is header** determines how the values of the data sources are being accessed via its 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 +
83 83  === Servlet parameters ===
84 84  
85 85  {{info}}
Copyright 2000-2024