From version < 8.3 >
edited by nlo
on 10.05.2019, 15:29
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,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//.
... ... @@ -45,37 +45,47 @@
45 45  Opens up a dialog for configuring the import:
46 46  ** **Sheets to import**: Determines which worksheets/tables should be imported from the file.
47 47  
48 -{{lightbox image="data_source_import_excel_de.png" title="Importdialog für Excel-Dateien"/}}
51 +{{lightbox image="data_source_import_excel_en.png" title="Importdialog für Excel-Dateien"/}}
49 49  
50 50  __Drag&Drop__
51 51  
52 -Data sources can be imported by Drag&Drop as well.
53 -Datenquellen können auch per Drag&Drop importiert werden. Wird eine Datei über die Liste (grüner Bereich gezogen), so wird eine neue Datenquelle vom entsprechenden Typ angelegt (bei Excel-Dateien wird eine Datenquelle pro Arbeitsblatt angelegt). Wird die Datenquelle allerdings über den Editierbereich einer bereits existierenden Datenquelle gezogen, so wird diese aktualisiert. Die Änderungen werden allerdings erst mit einem Klick auf "Speichern" {{icon name="save"/}} übernommen.
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.
54 54  
55 55  == CSV ==
56 56  
57 -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}}
58 58  
59 -* Choose the option //CSV// under //type//.
60 -* Assign an explicit name.
61 -* Insert the data sperated with a comma in the arrey //value//.
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.
62 62  
63 -{{figure image="datenquelle_csv_8.png" width="300"}}
64 -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}}.
65 -{{/figure}}
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"/}}
66 66  
67 -=== Example for a CSV data source ===
70 +=== Bearbeitung von CSV-Tabellen ===
68 68  
69 -{{info}}
70 -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.
71 -{{/info}}
72 +Zum Bearbeitung einer CSV-Tabelle befinden sich unterhalb des Editierbereichs eine Reihe von Schaltflächen:
72 72  
73 -{{code}}
74 -Value 1.1, value 1.2, value 1.3, value 1.4, ...
75 -{{/code}}
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.
76 76  
77 -The readout of the values in the {{designer/}} ensues through the //servlet// with the namen //datenquellecsv//.
79 +=== Header von CSV-Datenquellen ===
78 78  
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 +
79 79  === Servlet parameters ===
80 80  
81 81  {{info}}
Copyright 2000-2024