Skip to content

Commit 3ca35da

Browse files
authored
Merge pull request #37 from PDOK/PDOK-17717-renamed-capabilities
Pdok 17717 renamed capabilities
2 parents cc1911a + e86b9b1 commit 3ca35da

23 files changed

+234
-215
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/pdok/ogc-specifications
22

3-
go 1.16
3+
go 1.24
44

5-
require gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
5+
require gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
22
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
33
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
44
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
5+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
6+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

pkg/common/exception.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package common
2+
3+
type ExceptionDetails struct {
4+
ExceptionText string `xml:",chardata" yaml:"exception"`
5+
ExceptionCode string `xml:"code,attr" yaml:"exceptionCode"`
6+
LocatorCode string `xml:"locator,attr,omitempty" yaml:"locatorCode"`
7+
}

pkg/wcs201/getcapabilities_response.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ func (gc GetCapabilitiesResponse) ToXML() []byte {
3131

3232
// GetCapabilitiesResponse base struct
3333
type GetCapabilitiesResponse struct {
34-
XMLName xml.Name `xml:"wcs:Capabilities" yaml:"capabilities"`
35-
Namespaces `yaml:"namespaces"`
34+
XMLName xml.Name `xml:"wcs:Capabilities" yaml:"wcsCapabilities"`
35+
Namespaces
3636
ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceIdentification"`
3737
ServiceProvider ServiceProvider `xml:"ows:ServiceProvider" yaml:"serviceProvider"`
38-
Capabilities
38+
OperationsMetadata OperationsMetadata `xml:"ows:OperationsMetadata" yaml:"operationsMetadata"`
39+
ServiceMetadata ServiceMetadata `xml:"wcs:ServiceMetadata" yaml:"serviceMetadata"`
40+
Contents Contents `xml:"wcs:Contents" yaml:"contents"`
3941
}
4042

4143
// Namespaces struct containing the namespaces needed for the XML document
@@ -63,8 +65,8 @@ type ServiceIdentification struct {
6365
Keywords *wsc200.Keywords `xml:"ows:Keywords" yaml:"keywords"`
6466
ServiceType struct {
6567
Text string `xml:",chardata" yaml:"text"`
66-
CodeSpace string `xml:"codeSpace,attr" yaml:"codespace"`
67-
} `xml:"ows:ServiceType" yaml:"servicetype"`
68+
CodeSpace string `xml:"codeSpace,attr" yaml:"codeSpace"`
69+
} `xml:"ows:ServiceType" yaml:"serviceType"`
6870
ServiceTypeVersion []string `xml:"ows:ServiceTypeVersion" yaml:"serviceTypeVersion"`
6971
Profile []string `xml:"ows:Profile" yaml:"profile"`
7072
Fees string `xml:"ows:Fees" yaml:"fees"`
@@ -77,7 +79,7 @@ type ServiceProvider struct {
7779
ProviderSite struct {
7880
Type string `xml:"xlink:type,attr" yaml:"type"`
7981
Href string `xml:"xlink:href,attr" yaml:"href"`
80-
} `xml:"ows:ProviderSite" yaml:"providersite"`
82+
} `xml:"ows:ProviderSite" yaml:"providerSite"`
8183
ServiceContact struct {
8284
IndividualName string `xml:"ows:IndividualName" yaml:"individualName"`
8385
PositionName string `xml:"ows:PositionName" yaml:"positionName"`

pkg/wfs200/capabilities.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ type Operation struct {
8080
} `xml:"ows:Parameter" yaml:"parameter"`
8181
Constraints []struct {
8282
Name string `xml:"name,attr" yaml:"name"`
83-
NoValues string `xml:"ows:NoValues" yaml:"novalues"`
84-
DefaultValue string `xml:"ows:DefaultValue" yaml:"defaultvalue"`
83+
NoValues string `xml:"ows:NoValues" yaml:"noValues"`
84+
DefaultValue string `xml:"ows:DefaultValue" yaml:"defaultValue"`
8585
} `xml:"ows:Constraint" yaml:"constraint"`
8686
}
8787

@@ -97,7 +97,7 @@ type ExtendedCapabilities struct {
9797
MetadataURL struct {
9898
URL string `xml:"inspire_common:URL" yaml:"url"`
9999
MediaType string `xml:"inspire_common:MediaType" yaml:"mediaType"`
100-
} `xml:"inspire_common:MetadataUrl" yaml:"metadataurl"`
100+
} `xml:"inspire_common:MetadataUrl" yaml:"metadataUrl"`
101101
SupportedLanguages struct {
102102
DefaultLanguage struct {
103103
Language string `xml:"inspire_common:Language" yaml:"language"`

pkg/wfs200/describefeaturetype_request_pv.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
)
99

1010
type describeFeatureTypeRequestParameterValue struct {
11-
service string `yaml:"service"`
11+
service string `yaml:"service" json:"service"`
1212
baseParameterValueRequest
1313

14-
typeName *string `yaml:"typeName"` // [0..*]
15-
outputFormat *string `yaml:"outputFormat"` // default: "text/xml; subtype=gml/3.2"
14+
typeName *string `yaml:"typeName" json:"typeName"` // [0..*]
15+
outputFormat *string `yaml:"outputFormat" json:"outputFormat"` // default: "text/xml; subtype=gml/3.2"
1616
}
1717

1818
func (dpv *describeFeatureTypeRequestParameterValue) parseQueryParameters(query url.Values) []wsc110.Exception {

pkg/wfs200/describefeaturetype_response.go

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@ import "encoding/xml"
55
// Schema struct
66
// TODO build struct based on the capabilities and additional featureinfo
77
type Schema struct {
8-
XMLName xml.Name `xml:"schema"`
9-
Text string `xml:",chardata"`
10-
Xsd string `xml:"xsd,attr"`
11-
Digitaaltopografischbestand string `xml:"digitaaltopografischbestand,attr"`
12-
Gml string `xml:"gml,attr"`
13-
Wfs string `xml:"wfs,attr"`
14-
ElementFormDefault string `xml:"elementFormDefault,attr"`
15-
TargetNamespace string `xml:"targetNamespace,attr"`
8+
XMLName xml.Name `xml:"schema" json:"schema"`
9+
Text string `xml:",chardata" json:"text"`
10+
Xsd string `xml:"xsd,attr" json:"xsd"`
11+
Digitaaltopografischbestand string `xml:"digitaaltopografischbestand,attr" json:"digitaaltopografischbestand"`
12+
Gml string `xml:"gml,attr" json:"gml"`
13+
Wfs string `xml:"wfs,attr" json:"wfs"`
14+
ElementFormDefault string `xml:"elementFormDefault,attr" json:"elementFormDefault"`
15+
TargetNamespace string `xml:"targetNamespace,attr" json:"targetNamespace"`
1616
Import struct {
17-
Text string `xml:",chardata"`
18-
Namespace string `xml:"namespace,attr"`
19-
SchemaLocation string `xml:"schemaLocation,attr"`
20-
} `xml:"import"`
17+
Text string `xml:",chardata" json:"text"`
18+
Namespace string `xml:"namespace,attr" json:"namespace"`
19+
SchemaLocation string `xml:"schemaLocation,attr" json:"schemaLocation"`
20+
} `xml:"import" json:"import"`
2121
ComplexType []struct {
22-
Text string `xml:",chardata"`
23-
Name string `xml:"name,attr"`
22+
Text string `xml:",chardata" json:"text"`
23+
Name string `xml:"name,attr" json:"name"`
2424
ComplexContent struct {
25-
Text string `xml:",chardata"`
25+
Text string `xml:",chardata" json:"text"`
2626
Extension struct {
27-
Text string `xml:",chardata"`
28-
Base string `xml:"base,attr"`
27+
Text string `xml:",chardata" json:"text"`
28+
Base string `xml:"base,attr" json:"base"`
2929
Sequence struct {
30-
Text string `xml:",chardata"`
30+
Text string `xml:",chardata" json:"text"`
3131
Element []struct {
32-
Text string `xml:",chardata"`
33-
MaxOccurs string `xml:"maxOccurs,attr"`
34-
MinOccurs string `xml:"minOccurs,attr"`
35-
Name string `xml:"name,attr"`
36-
Nillable string `xml:"nillable,attr"`
37-
Type string `xml:"type,attr"`
38-
} `xml:"element"`
39-
} `xml:"sequence"`
40-
} `xml:"extension"`
41-
} `xml:"complexContent"`
42-
} `xml:"complexType"`
32+
Text string `xml:",chardata" json:"text"`
33+
MaxOccurs string `xml:"maxOccurs,attr" json:"maxOccurs"`
34+
MinOccurs string `xml:"minOccurs,attr" json:"minOccurs"`
35+
Name string `xml:"name,attr" json:"name"`
36+
Nillable string `xml:"nillable,attr" json:"nillable"`
37+
Type string `xml:"type,attr" json:"type"`
38+
} `xml:"element" json:"element"`
39+
} `xml:"sequence" json:"sequence"`
40+
} `xml:"extension" json:"extension"`
41+
} `xml:"complexContent" json:"complexContent"`
42+
} `xml:"complexType" json:"complexType"`
4343
Element []struct {
44-
Text string `xml:",chardata"`
45-
Name string `xml:"name,attr"`
46-
SubstitutionGroup string `xml:"substitutionGroup,attr"`
47-
Type string `xml:"type,attr"`
48-
} `xml:"element"`
44+
Text string `xml:",chardata" json:"text"`
45+
Name string `xml:"name,attr" json:"name"`
46+
SubstitutionGroup string `xml:"substitutionGroup,attr" json:"substitutionGroup"`
47+
Type string `xml:"type,attr" json:"type"`
48+
} `xml:"element" json:"element"`
4949
}

pkg/wfs200/exception.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ package wfs200
22

33
import (
44
"encoding/xml"
5-
65
"github.com/pdok/ogc-specifications/pkg/wsc110"
76
)
87

98
type exception struct {
10-
XMLName xml.Name `xml:"ows:Exception"`
9+
XMLName xml.Name `xml:"ows:Exception" yaml:"owsException"`
1110
ExceptionText string `xml:",chardata" yaml:"exception"`
1211
ExceptionCode string `xml:"exceptionCode,attr" yaml:"exceptionCode"`
1312
LocatorCode string `xml:"locator,attr,omitempty" yaml:"locatorCode"`

pkg/wfs200/getcapabilities_response.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ func (gc GetCapabilitiesResponse) ToXML() []byte {
4040
type GetCapabilitiesResponse struct {
4141
XMLName xml.Name `xml:"WFS_Capabilities"`
4242
Namespaces `yaml:"namespaces"`
43-
ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceidentification"`
44-
ServiceProvider ServiceProvider `xml:"ows:ServiceProvider" yaml:"serviceprovider"`
45-
Capabilities
43+
ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceIdentification"`
44+
ServiceProvider ServiceProvider `xml:"ows:ServiceProvider" yaml:"serviceProvider"`
45+
Capabilities `yaml:"capabilities"`
4646
}
4747

4848
// Namespaces struct containing the namespaces needed for the XML document
@@ -53,11 +53,11 @@ type Namespaces struct {
5353
XmlnsXlink string `xml:"xmlns:xlink,attr" yaml:"xlink"` //http://www.w3.org/1999/xlink
5454
XmlnsXSI string `xml:"xmlns:xsi,attr" yaml:"xsi"` //http://www.w3.org/2001/XMLSchema-instance
5555
XmlnsFes string `xml:"xmlns:fes,attr" yaml:"fes"` //http://www.opengis.net/fes/2.0
56-
XmlnsInspireCommon string `xml:"xmlns:inspire_common,attr,omitempty" yaml:"inspirecommon,omitempty"` //http://inspire.ec.europa.eu/schemas/common/1.0
57-
XmlnsInspireDls string `xml:"xmlns:inspire_dls,attr,omitempty" yaml:"inspiredls,omitempty"` //http://inspire.ec.europa.eu/schemas/inspire_dls/1.0
56+
XmlnsInspireCommon string `xml:"xmlns:inspire_common,attr,omitempty" yaml:"inspireCommon,omitempty"` //http://inspire.ec.europa.eu/schemas/common/1.0
57+
XmlnsInspireDls string `xml:"xmlns:inspire_dls,attr,omitempty" yaml:"inspireDls,omitempty"` //http://inspire.ec.europa.eu/schemas/inspire_dls/1.0
5858
XmlnsPrefix string `xml:"xmlns:{{.Prefix}},attr" yaml:"prefix"` //namespace_uri placeholder
5959
Version string `xml:"version,attr" yaml:"version"`
60-
SchemaLocation string `xml:"xsi:schemaLocation,attr" yaml:"schemalocation"`
60+
SchemaLocation string `xml:"xsi:schemaLocation,attr" yaml:"schemaLocation"`
6161
}
6262

6363
// ServiceIdentification struct should only be fill by the "template" configuration wfs200.yaml
@@ -68,45 +68,45 @@ type ServiceIdentification struct {
6868
Keywords *wsc110.Keywords `xml:"ows:Keywords" yaml:"keywords"`
6969
ServiceType struct {
7070
Text string `xml:",chardata" yaml:"text"`
71-
CodeSpace string `xml:"codeSpace,attr" yaml:"codespace"`
72-
} `xml:"ows:ServiceType"`
73-
ServiceTypeVersion string `xml:"ows:ServiceTypeVersion" yaml:"servicetypeversion"`
71+
CodeSpace string `xml:"codeSpace,attr" yaml:"codeSpace"`
72+
} `xml:"ows:ServiceType" yaml:"serviceType"`
73+
ServiceTypeVersion string `xml:"ows:ServiceTypeVersion" yaml:"serviceTypeVersion"`
7474
Fees string `xml:"ows:Fees" yaml:"fees"`
75-
AccessConstraints string `xml:"ows:AccessConstraints" yaml:"accessconstraints"`
75+
AccessConstraints string `xml:"ows:AccessConstraints" yaml:"accessConstraints"`
7676
}
7777

7878
// ServiceProvider struct containing the provider/organization information should only be fill by the "template" configuration wfs200.yaml
7979
type ServiceProvider struct {
8080
XMLName xml.Name `xml:"ows:ServiceProvider"`
81-
ProviderName string `xml:"ows:ProviderName" yaml:"providername"`
81+
ProviderName string `xml:"ows:ProviderName" yaml:"providerName"`
8282
ProviderSite struct {
8383
Type string `xml:"xlink:type,attr" yaml:"type"`
8484
Href string `xml:"xlink:href,attr" yaml:"href"`
85-
} `xml:"ows:ProviderSite" yaml:"providersite"`
85+
} `xml:"ows:ProviderSite" yaml:"providerSite"`
8686
ServiceContact struct {
87-
IndividualName string `xml:"ows:IndividualName" yaml:"individualname"`
88-
PositionName string `xml:"ows:PositionName" yaml:"positionname"`
87+
IndividualName string `xml:"ows:IndividualName" yaml:"individualName"`
88+
PositionName string `xml:"ows:PositionName" yaml:"positionName"`
8989
ContactInfo struct {
9090
Text string `xml:",chardata"`
9191
Phone struct {
9292
Voice string `xml:"ows:Voice" yaml:"voice"`
9393
Facsimile string `xml:"ows:Facsimile" yaml:"facsimile"`
9494
} `xml:"ows:Phone" yaml:"phone"`
9595
Address struct {
96-
DeliveryPoint string `xml:"ows:DeliveryPoint" yaml:"deliverypoint"`
96+
DeliveryPoint string `xml:"ows:DeliveryPoint" yaml:"deliveryPoint"`
9797
City string `xml:"ows:City" yaml:"city"`
98-
AdministrativeArea string `xml:"ows:AdministrativeArea" yaml:"administrativearea"`
99-
PostalCode string `xml:"ows:PostalCode" yaml:"postalcode"`
98+
AdministrativeArea string `xml:"ows:AdministrativeArea" yaml:"administrativeArea"`
99+
PostalCode string `xml:"ows:PostalCode" yaml:"postalCode"`
100100
Country string `xml:"ows:Country" yaml:"country"`
101-
ElectronicMailAddress string `xml:"ows:ElectronicMailAddress" yaml:"electronicmailaddress"`
101+
ElectronicMailAddress string `xml:"ows:ElectronicMailAddress" yaml:"electronicMailAddress"`
102102
} `xml:"ows:Address" yaml:"address"`
103103
OnlineResource struct {
104104
Type string `xml:"xlink:type,attr" yaml:"type"`
105105
Href string `xml:"xlink:href,attr" yaml:"href"`
106-
} `xml:"ows:OnlineResource" yaml:"onlineresource"`
107-
HoursOfService string `xml:"ows:HoursOfService" yaml:"hoursofservice"`
108-
ContactInstructions string `xml:"ows:ContactInstructions" yaml:"contactinstructions"`
109-
} `xml:"ows:ContactInfo" yaml:"contactinfo"`
106+
} `xml:"ows:OnlineResource" yaml:"onlineResource"`
107+
HoursOfService string `xml:"ows:HoursOfService" yaml:"hoursOfService"`
108+
ContactInstructions string `xml:"ows:ContactInstructions" yaml:"contactInstructions"`
109+
} `xml:"ows:ContactInfo" yaml:"contactInfo"`
110110
Role string `xml:"ows:Role" yaml:"role"`
111-
} `xml:"ows:ServiceContact" yaml:"servicecontact"`
111+
} `xml:"ows:ServiceContact" yaml:"serviceContact"`
112112
}

0 commit comments

Comments
 (0)