Skip to content

Commit 4d1772a

Browse files
committed
CRD Update
1 parent b8fd417 commit 4d1772a

File tree

7 files changed

+110
-34
lines changed

7 files changed

+110
-34
lines changed

api/v2beta1/atom_conversion.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (src *Atom) ConvertTo(dstRaw conversion.Hub) error {
4242
log.Printf("ConvertTo: Converting Atom from Spoke version v2beta1 to Hub version v3;"+
4343
"source: %s/%s, target: %s/%s", src.Namespace, src.Name, dst.Namespace, dst.Name)
4444

45-
host := "https://service.dok.nl/" // Todo read from flag
45+
host := "https://service.pdok.nl/" // Todo read from flag
4646

4747
// ObjectMeta
4848
dst.ObjectMeta = src.ObjectMeta
@@ -57,14 +57,15 @@ func (src *Atom) ConvertTo(dstRaw conversion.Hub) error {
5757
// Service
5858
log.Printf("Start mapping the Service...")
5959
dst.Spec.Service = pdoknlv3.Service{
60-
BaseURL: createBaseURL(host, src.Spec.General),
61-
Lang: "nl",
62-
Stylesheet: "https://service.pdok.nl/atom/style/style.xsl",
63-
Title: src.Spec.Service.Title,
64-
Subtitle: src.Spec.Service.Subtitle,
65-
OwnerInfoRef: "pdok",
66-
Links: []pdoknlv3.Link{},
67-
Rights: src.Spec.Service.Rights,
60+
BaseURL: createBaseURL(host, src.Spec.General),
61+
Lang: "nl",
62+
Stylesheet: "https://service.pdok.nl/atom/style/style.xsl",
63+
Title: src.Spec.Service.Title,
64+
Subtitle: src.Spec.Service.Subtitle,
65+
OwnerInfoRef: "pdok",
66+
Links: []pdoknlv3.Link{},
67+
ServiceMetadataLinks: []pdoknlv3.MetadataLink{}, // Todo
68+
Rights: src.Spec.Service.Rights,
6869
}
6970
log.Printf("Done mapping the Service...")
7071

@@ -75,6 +76,7 @@ func (src *Atom) ConvertTo(dstRaw conversion.Hub) error {
7576
TechnicalName: srcDataset.Name,
7677
Title: srcDataset.Title,
7778
Subtitle: srcDataset.Subtitle,
79+
DatasetMetadataLinks: []pdoknlv3.MetadataLink{}, // Todo
7880
SpatialDatasetIdentifierCode: srcDataset.SourceIdentifier,
7981
SpatialDatasetIdentifierNamespace: "http://www.pdok.nl",
8082
}
@@ -238,7 +240,7 @@ func (dst *Atom) ConvertFrom(srcRaw conversion.Hub) error {
238240
}
239241
log.Printf("Done mapping the Links...")
240242

241-
if len(srcDatasetFeed.Entries) > 0 {
243+
if len(srcDatasetFeed.Entries) > 0 && srcDatasetFeed.Entries[0].Polygon != nil {
242244
// We can assume all entries have the same bbox, so we take the first one
243245
firstBbox := srcDatasetFeed.Entries[0].Polygon.BBox
244246
dstDataset.Bbox = Bbox{

api/v3/atom_types.go

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ type Lifecycle struct {
4242

4343
// Service defines the service configuration for the Atom feed
4444
type Service struct {
45-
BaseURL string `json:"baseUrl"`
46-
Lang string `json:"lang,omitempty"`
47-
Stylesheet string `json:"stylesheet,omitempty"`
48-
Title string `json:"title"`
49-
Subtitle string `json:"subtitle,omitempty"`
50-
OwnerInfoRef string `json:"ownerInfoRef"`
51-
Links []Link `json:"links,omitempty"`
52-
Rights string `json:"rights,omitempty"`
45+
BaseURL string `json:"baseUrl"`
46+
Lang string `json:"lang,omitempty"`
47+
Stylesheet string `json:"stylesheet,omitempty"`
48+
Title string `json:"title"`
49+
Subtitle string `json:"subtitle,omitempty"`
50+
OwnerInfoRef string `json:"ownerInfoRef"`
51+
ServiceMetadataLinks []MetadataLink `json:"serviceMetadataLinks,omitempty"`
52+
Links []Link `json:"links,omitempty"` // Todo kan weg?
53+
Rights string `json:"rights,omitempty"`
5354
}
5455

5556
// Link represents a link in the service or dataset feed
@@ -71,14 +72,21 @@ type Author struct {
7172

7273
// DatasetFeed represents individual dataset feeds within the Atom service
7374
type DatasetFeed struct {
74-
TechnicalName string `json:"technicalName"`
75-
Title string `json:"title"`
76-
Subtitle string `json:"subtitle,omitempty"`
77-
Links []Link `json:"links,omitempty"`
78-
Author Author `json:"author,omitempty"`
79-
SpatialDatasetIdentifierCode string `json:"spatial_dataset_identifier_code,omitempty"`
80-
SpatialDatasetIdentifierNamespace string `json:"spatial_dataset_identifier_namespace,omitempty"`
81-
Entries []Entry `json:"entries,omitempty"`
75+
TechnicalName string `json:"technicalName"`
76+
Title string `json:"title"`
77+
Subtitle string `json:"subtitle,omitempty"`
78+
Links []Link `json:"links,omitempty"` // Todo kan weg?
79+
DatasetMetadataLinks []MetadataLink `json:"datasetMetadataLinks,omitempty"`
80+
Author Author `json:"author,omitempty"`
81+
SpatialDatasetIdentifierCode string `json:"spatial_dataset_identifier_code,omitempty"`
82+
SpatialDatasetIdentifierNamespace string `json:"spatial_dataset_identifier_namespace,omitempty"`
83+
Entries []Entry `json:"entries,omitempty"`
84+
}
85+
86+
// Metadatalink represents a link in the service or dataset feed
87+
type MetadataLink struct {
88+
MetadataIdentifier string `json:"metadataIdentifier"`
89+
Templates []string `json:"templates,omitempty"`
8290
}
8391

8492
// Entry represents an entry within a dataset feed, typically for downloads

api/v3/zz_generated.deepcopy.go

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/pdok.nl_atoms.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,21 @@ spec:
364364
- email
365365
- name
366366
type: object
367+
datasetMetadataLinks:
368+
items:
369+
description: Metadatalink represents a link in the service
370+
or dataset feed
371+
properties:
372+
metadataIdentifier:
373+
type: string
374+
templates:
375+
items:
376+
type: string
377+
type: array
378+
required:
379+
- metadataIdentifier
380+
type: object
381+
type: array
367382
entries:
368383
items:
369384
description: Entry represents an entry within a dataset feed,
@@ -528,6 +543,21 @@ spec:
528543
type: string
529544
rights:
530545
type: string
546+
serviceMetadataLinks:
547+
items:
548+
description: Metadatalink represents a link in the service or
549+
dataset feed
550+
properties:
551+
metadataIdentifier:
552+
type: string
553+
templates:
554+
items:
555+
type: string
556+
type: array
557+
required:
558+
- metadataIdentifier
559+
type: object
560+
type: array
531561
stylesheet:
532562
type: string
533563
subtitle:

config/manager/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
resources:
22
- manager.yaml
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
images:
6+
- name: controller
7+
newName: pdok/atom-operator
8+
newTag: 2.0.7

config/samples/v2beta1_atom.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ spec:
1212
general:
1313
dataset: dataset
1414
datasetOwner: owner
15-
#dataVersion: version
15+
dataVersion:
1616
serviceVersion: v1_0
17-
#theme: theme
17+
theme:
1818
service:
19-
#updated: "2012-03-31T13:45:03Z"
2019
title: Test Dataset ATOM
2120
subtitle: Test Dataset ATOM
2221
metadataIdentifier: 1234-456

config/samples/v3_atom.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ spec:
1212
lifecycle:
1313
ttlInDays:
1414
service:
15-
baseUrl: "http://localhost/owner/dataset"
15+
baseUrl: "https://service.pdok.nl/owner/dataset/atom/index.xml"
1616
lang: nl
17-
stylesheet: "http://localhost/atom/style/style.xsl"
17+
stylesheet: "https://service.pdok.nl/atom/style/style.xsl"
1818
title: Test Dataset ATOM
1919
subtitle: Test Dataset ATOM
2020
ownerInfoRef: pdok
@@ -25,9 +25,6 @@ spec:
2525
- opensearch
2626
- html
2727
rights: https://creativecommons.org/publicdomain/zero/1.0/deed.nl
28-
author:
29-
name: "PDOK Beheer"
30-
3128
datasetFeeds:
3229
- technicalName: dataset-1-name
3330
title: "dataset-1-title \"1\""

0 commit comments

Comments
 (0)