From version < 9.1 >
edited by nlo
on 10.05.2019, 15:33
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,13 +1,16 @@
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  
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}}
13 +
11 11  == Creating a data source ==
12 12  
13 13  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//.
... ... @@ -53,28 +53,39 @@
53 53  
54 54  == CSV ==
55 55  
56 -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}}
57 57  
58 -* Choose the option //CSV// under //type//.
59 -* Assign an explicit name.
60 -* 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.
61 61  
62 -{{figure image="datenquelle_csv_8.png" width="300"}}
63 -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}}.
64 -{{/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"/}}
65 65  
66 -=== Example for a CSV data source ===
70 +=== Editing CSV tables ===
67 67  
68 -{{info}}
69 -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.
70 -{{/info}}
72 +There is a row of buttons beneath the editing area for editing the CSV data table:
71 71  
72 -{{code}}
73 -Value 1.1, value 1.2, value 1.3, value 1.4, ...
74 -{{/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.
75 75  
76 -The readout of the values in the {{designer/}} ensues through the //servlet// with the namen //datenquellecsv//.
79 +=== Header of CSV data sources ===
77 77  
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 +
78 78  === Servlet parameters ===
79 79  
80 80  {{info}}
Copyright 2000-2024