geonetwork-ui 2.4.3 → 2.4.4-dev.9094d472a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +7 -4
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +8 -8
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +7 -4
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +4 -3
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -2
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +8 -1
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
- package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -4
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base-cache.mjs +12 -0
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base-file.mjs +3 -3
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base.mjs +1 -1
- package/esm2022/libs/util/data-fetcher/src/lib/readers/csv.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/excel.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/geojson.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/gml.mjs +5 -3
- package/esm2022/libs/util/data-fetcher/src/lib/readers/json.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +19 -11
- package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +13 -9
- package/esm2022/translations/de.json +0 -1
- package/esm2022/translations/en.json +0 -1
- package/esm2022/translations/es.json +0 -1
- package/esm2022/translations/fr.json +0 -1
- package/esm2022/translations/nl.json +0 -1
- package/esm2022/translations/pt.json +0 -1
- package/fesm2022/geonetwork-ui.mjs +145 -111
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +2 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +2 -2
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +2 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +1 -0
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +1 -0
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts +8 -0
- package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts.map +1 -0
- package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/base.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/readers/base.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/gml.d.ts +5 -3
- package/libs/util/data-fetcher/src/lib/readers/gml.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +7 -4
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/utils.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +4 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +22 -9
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +2 -1
- package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +3 -0
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +2 -1
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +13 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +2 -2
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +13 -4
- package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +14 -0
- package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +2 -1
- package/src/libs/util/data-fetcher/src/lib/readers/base.ts +2 -2
- package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +7 -7
- package/src/libs/util/data-fetcher/src/lib/readers/json.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +34 -11
- package/src/libs/util/data-fetcher/src/lib/utils.ts +38 -32
- package/translations/de.json +0 -1
- package/translations/en.json +0 -1
- package/translations/es.json +0 -1
- package/translations/fr.json +0 -1
- package/translations/nl.json +0 -1
- package/translations/pt.json +0 -1
- package/translations/sk.json +0 -1
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
|
|
2
2
|
import { DataItem, DatasetInfo, PropertyInfo } from '../model'
|
|
3
3
|
import { fetchDataAsText } from '../utils'
|
|
4
|
-
import { BaseReader } from './base'
|
|
5
4
|
import { GmlReader, parseGml } from './gml'
|
|
6
5
|
import { GeojsonReader, parseGeojson } from './geojson'
|
|
7
|
-
import {
|
|
6
|
+
import { BaseCacheReader } from './base-cache'
|
|
7
|
+
import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
|
|
8
|
+
import { generateSqlQuery } from '../sql-utils'
|
|
8
9
|
|
|
9
|
-
export class WfsReader extends
|
|
10
|
+
export class WfsReader extends BaseCacheReader {
|
|
10
11
|
endpoint: WfsEndpoint
|
|
11
12
|
featureTypeName: string
|
|
12
13
|
version: WfsVersion
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
15
|
+
constructor(
|
|
16
|
+
url: string,
|
|
17
|
+
wfsEndpoint: WfsEndpoint,
|
|
18
|
+
featureTypeName: string,
|
|
19
|
+
cacheActive?: boolean
|
|
20
|
+
) {
|
|
21
|
+
super(url, cacheActive)
|
|
16
22
|
this.endpoint = wfsEndpoint
|
|
17
23
|
this.featureTypeName = featureTypeName
|
|
18
24
|
this.version = this.endpoint.getVersion()
|
|
@@ -90,11 +96,10 @@ export class WfsReader extends BaseReader {
|
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
99
|
+
public async getData(aggregation?, groupedBy?) {
|
|
100
|
+
if (aggregation || groupedBy) {
|
|
101
|
+
return { items: await this.getQueryData() }
|
|
96
102
|
}
|
|
97
|
-
|
|
98
103
|
const asJson = this.endpoint.supportsJson(this.featureTypeName)
|
|
99
104
|
const attributes = this.selected ?? undefined
|
|
100
105
|
let url = this.endpoint.getFeatureUrl(this.featureTypeName, {
|
|
@@ -117,18 +122,36 @@ export class WfsReader extends BaseReader {
|
|
|
117
122
|
url = `${url}${finalUrl.search ? '&' : ''}SORTBY=${sorts}`
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
return fetchDataAsText(url).then((text) =>
|
|
125
|
+
return fetchDataAsText(url, this.cacheActive).then((text) =>
|
|
121
126
|
asJson
|
|
122
127
|
? parseGeojson(text)
|
|
123
128
|
: parseGml(text, this.featureTypeName, this.version)
|
|
124
129
|
)
|
|
125
130
|
}
|
|
126
131
|
|
|
132
|
+
public async getQueryData() {
|
|
133
|
+
const items = (await this.getData()).items
|
|
134
|
+
const jsonItems = getJsonDataItemsProxy(items)
|
|
135
|
+
const query = generateSqlQuery(
|
|
136
|
+
this.selected,
|
|
137
|
+
this.filter,
|
|
138
|
+
this.sort,
|
|
139
|
+
this.startIndex,
|
|
140
|
+
this.count,
|
|
141
|
+
this.groupedBy,
|
|
142
|
+
this.aggregations
|
|
143
|
+
)
|
|
144
|
+
const result = await import('alasql').then((module) =>
|
|
145
|
+
module.default(query, [jsonItems])
|
|
146
|
+
)
|
|
147
|
+
return result.map(jsonToGeojsonFeature)
|
|
148
|
+
}
|
|
149
|
+
|
|
127
150
|
load() {
|
|
128
151
|
// Nothing to load for Wfs
|
|
129
152
|
}
|
|
130
153
|
|
|
131
154
|
async read(): Promise<DataItem[]> {
|
|
132
|
-
return (await this.getData()).items
|
|
155
|
+
return (await this.getData(this.aggregations, this.groupedBy)).items
|
|
133
156
|
}
|
|
134
157
|
}
|
|
@@ -51,39 +51,45 @@ export function fetchHeaders(url: string): Promise<DatasetHeaders> {
|
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function fetchDataAsText(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
export function fetchDataAsText(
|
|
55
|
+
url: string,
|
|
56
|
+
cacheActive: boolean
|
|
57
|
+
): Promise<string> {
|
|
58
|
+
const fetchFactory = () =>
|
|
59
|
+
sharedFetch(url)
|
|
60
|
+
.catch((error) => {
|
|
61
|
+
throw FetchError.corsOrNetwork(error.message)
|
|
62
|
+
})
|
|
63
|
+
.then(async (response) => {
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
const clonedResponse = response.clone()
|
|
66
|
+
throw FetchError.http(response.status, await clonedResponse.text())
|
|
67
|
+
}
|
|
68
|
+
const clonedResponse = response.clone()
|
|
69
|
+
return clonedResponse.text()
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return cacheActive ? useCache(fetchFactory, url, 'asText') : fetchFactory()
|
|
70
73
|
}
|
|
71
|
-
export function fetchDataAsArrayBuffer(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
export function fetchDataAsArrayBuffer(
|
|
75
|
+
url: string,
|
|
76
|
+
cacheActive: boolean
|
|
77
|
+
): Promise<ArrayBuffer> {
|
|
78
|
+
const fetchFactory = () =>
|
|
79
|
+
sharedFetch(url)
|
|
80
|
+
.catch((error) => {
|
|
81
|
+
throw FetchError.corsOrNetwork(error.message)
|
|
82
|
+
})
|
|
83
|
+
.then(async (response) => {
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
throw FetchError.http(response.status, await response.text())
|
|
86
|
+
}
|
|
87
|
+
// convert to a numeric array so that we can store the response in cache
|
|
88
|
+
return Array.from(new Uint8Array(await response.arrayBuffer()))
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
cacheActive ? useCache(fetchFactory, url, 'asArrayBuffer') : fetchFactory()
|
|
87
93
|
).then((array) => {
|
|
88
94
|
return new Uint8Array(array).buffer
|
|
89
95
|
})
|
package/translations/de.json
CHANGED
|
@@ -602,7 +602,6 @@
|
|
|
602
602
|
"tooltip.url.open": "URL öffnen",
|
|
603
603
|
"ui.readLess": "Weniger lesen",
|
|
604
604
|
"ui.readMore": "Weiterlesen",
|
|
605
|
-
"wfs.aggregations.notsupported": "",
|
|
606
605
|
"wfs.feature.limit": "Zu viele Features, um den WFS-Layer anzuzeigen!",
|
|
607
606
|
"wfs.featuretype.notfound": "Kein passender Feature-Typ wurde im Dienst gefunden",
|
|
608
607
|
"wfs.geojsongml.notsupported": "Dieser Dienst unterstützt das GeoJSON- oder GML-Format nicht",
|
package/translations/en.json
CHANGED
|
@@ -602,7 +602,6 @@
|
|
|
602
602
|
"tooltip.url.open": "Open URL",
|
|
603
603
|
"ui.readLess": "Read less",
|
|
604
604
|
"ui.readMore": "Read more",
|
|
605
|
-
"wfs.aggregations.notsupported": "Aggregations are currently not supported for WFS services",
|
|
606
605
|
"wfs.feature.limit": "Too many features to display the WFS layer!",
|
|
607
606
|
"wfs.featuretype.notfound": "No matching feature type was found in the service",
|
|
608
607
|
"wfs.geojsongml.notsupported": "This service does not support the GeoJSON or GML format",
|
package/translations/es.json
CHANGED
package/translations/fr.json
CHANGED
|
@@ -602,7 +602,6 @@
|
|
|
602
602
|
"tooltip.url.open": "Ouvrir l'URL",
|
|
603
603
|
"ui.readLess": "Réduire",
|
|
604
604
|
"ui.readMore": "Lire la suite",
|
|
605
|
-
"wfs.aggregations.notsupported": "Agrégations non supportées pour les services WFS",
|
|
606
605
|
"wfs.feature.limit": "Trop d'objets pour afficher la couche WFS !",
|
|
607
606
|
"wfs.featuretype.notfound": "La classe d'objets n'a pas été trouvée dans le service",
|
|
608
607
|
"wfs.geojsongml.notsupported": "Le service ne supporte pas le format GeoJSON ou GML",
|
package/translations/nl.json
CHANGED
package/translations/pt.json
CHANGED
package/translations/sk.json
CHANGED
|
@@ -602,7 +602,6 @@
|
|
|
602
602
|
"tooltip.url.open": "Otvoriť URL",
|
|
603
603
|
"ui.readLess": "Čítať menej",
|
|
604
604
|
"ui.readMore": "Čítať viac",
|
|
605
|
-
"wfs.aggregations.notsupported": "",
|
|
606
605
|
"wfs.feature.limit": "",
|
|
607
606
|
"wfs.featuretype.notfound": "V službe nebol nájdený žiadny zodpovedajúci typ funkcie",
|
|
608
607
|
"wfs.geojsongml.notsupported": "Táto služba nepodporuje formát GeoJSON alebo GML",
|