From a978ff196abc6e02fcb09666f3f1a5cab4c16078 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Wed, 13 Oct 2021 12:22:36 +0200 Subject: [PATCH] added posibility for setting content on datafeed entry --- feeds/feeds.go | 1 + feeds/feeds_test.go | 99 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) diff --git a/feeds/feeds.go b/feeds/feeds.go index 4f715aa..8323c78 100644 --- a/feeds/feeds.go +++ b/feeds/feeds.go @@ -122,6 +122,7 @@ func (f *Feed) Valid() error { type Entry struct { ID string `xml:"id" yaml:"id"` Title string `xml:"title,omitempty" yaml:"title"` + Content string `xml:"content,omitempty" yaml:"content"` Summary string `xml:"summary,omitempty" yaml:"summary"` Link []Link `xml:"link" yaml:"link"` Rights string `xml:"rights,omitempty" yaml:"rights"` diff --git a/feeds/feeds_test.go b/feeds/feeds_test.go index 2e4e0af..7a61bae 100644 --- a/feeds/feeds_test.go +++ b/feeds/feeds_test.go @@ -147,6 +147,105 @@ func TestGenerateATOM(t *testing.T) { wn_id1 http://xyz.org/ +`}, + 2: {input: Feed{InspireDls: "http://inspire.ec.europa.eu/schemas/inspire_dls/1.0", + Lang: sp("nl"), + ID: "https://service.pdok.nl/kadaster/plu/atom/v1_0/plu.xml", + Title: "INSPIRE Download Service van Ruimtelijke plannen", + Subtitle: "Voorgedefinieerde dataset INSPIRE download service", + Link: []Link{ + { + Rel: "self", + Href: "https://service.pdok.nl/kadaster/plu/atom/v1_0/plu.xml", + }, + { + Rel: "up", + Href: "https://service.pdok.nl/kadaster/plu/atom/v1_0/index.xml", + Type: "application/atom+xml", + Title: "Top Atom Download Service Feed", + }, + { + Rel: "describedby", + Href: "https://www.nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/metadata/17716ed7-ce0d-4bfd-8868-a398e5578a36", + Type: "text/html", + }, + { + Rel: "related", + Href: "https://www.nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/metadata/17716ed7-ce0d-4bfd-8868-a398e5578a36", + Type: "text/html", + Title: "NGR pagina voor deze dataset", + }, + }, + Rights: "http://creativecommons.org/publicdomain/zero/1.0/deed.nl", + Updated: "2021-10-01T00:00:00Z", + Author: Author{ + Name: "PDOK Beheer", + Email: "beheerPDOK@kadaster.nl", + }, + Entry: []Entry{ + { + ID: "https://service.pdok.nl/kadaster/plu/atom/v1_0/plu.xml", + Rights: "http://creativecommons.org/publicdomain/zero/1.0/deed.nl", + Updated: "2021-10-01T00:00:00Z", + Polygon: "50.6 3.1 50.6 7.3 53.7 7.3 53.7 3.1 50.6 3.1", + Title: "INSPIRE Download Service van Ruimtelijke plannen", + Content: "Bestand is opgesplitst per featuretype, elk featuretype heeft een eigen download bestand", + Link: []Link{ + { + Rel: "section", + Href: "https://service.pdok.nl/kadaster/plu/atom/v1_0/downloads/Besluitgebied_A.gml.gz", + Type: "application/x-gmz", + Length: "3547244", + }, + { + Rel: "section", + Href: "https://service.pdok.nl/kadaster/plu/atom/v1_0/downloads/Besluitgebied_P.gml.gz", + Type: "application/x-gmz", + Length: "15714976", + }, + { + Rel: "section", + Href: "https://service.pdok.nl/kadaster/plu/atom/v1_0/downloads/Besluitgebied_X.gml.gz", + Type: "application/x-gmz", + Length: "45621084", + }, + }, + Category: []Category{ + { + Term: "https://www.opengis.net/def/crs/EPSG/0/28992", + Label: "Amersfoort / RD New", + }, + }, + }, + }, + }, + expected: ` + + https://service.pdok.nl/kadaster/plu/atom/v1_0/plu.xml + INSPIRE Download Service van Ruimtelijke plannen + Voorgedefinieerde dataset INSPIRE download service + + + + + http://creativecommons.org/publicdomain/zero/1.0/deed.nl + 2021-10-01T00:00:00Z + + PDOK Beheer + beheerPDOK@kadaster.nl + + + https://service.pdok.nl/kadaster/plu/atom/v1_0/plu.xml + INSPIRE Download Service van Ruimtelijke plannen + Bestand is opgesplitst per featuretype, elk featuretype heeft een eigen download bestand + + + + http://creativecommons.org/publicdomain/zero/1.0/deed.nl + 2021-10-01T00:00:00Z + 50.6 3.1 50.6 7.3 53.7 7.3 53.7 3.1 50.6 3.1 + + `}, }