From dd1db6e7235508cc6eb55c1c86928f002492c8c1 Mon Sep 17 00:00:00 2001 From: "david.blasby" Date: Wed, 18 Sep 2024 11:36:02 -0700 Subject: [PATCH] fixes from joses review --- .../controller/CapabilitiesApiController.java | 31 ++-- .../controller/CollectionApiController.java | 15 +- .../controller/model/CollectionInfo.java | 107 +++++++++++- .../records/controller/model/CrsEnum.java | 5 + .../ogcapi/records/controller/model/Root.java | 8 + .../ogcapi/records/model/OgcApiComponent.java | 18 ++ .../ogcapi/records/model/OgcApiConcept.java | 3 +- .../ogcapi/records/model/OgcApiContact.java | 57 ++++--- .../model/OgcApiExternalDocumentation.java | 58 +++++++ .../ogcapi/records/model/OgcApiInfo.java | 72 ++++++++ .../ogcapi/records/model/OgcApiLicense.java | 58 +++++++ .../ogcapi/records/model/OgcApiLink.java | 15 ++ .../ogcapi/records/model/OgcApiPath.java | 19 +++ .../ogcapi/records/model/OgcApiReference.java | 37 +++++ .../ogcapi/records/model/OgcApiSchema.java | 154 ++++++++++++++++++ .../records/model/OgcApiSchemaContact.java | 76 +++++++++ .../model/OgcApiSecurityRequirement.java | 39 +++++ .../ogcapi/records/model/OgcApiServer.java | 59 +++++++ .../records/model/OgcApiSpatialExtent.java | 31 ++-- .../ogcapi/records/model/OgcApiTag.java | 47 ++++++ .../records/model/OgcApiTemporalExtent.java | 1 - .../ogcapi/records/model/OgcApiTheme.java | 10 +- .../records/util/CollectionInfoBuilder.java | 10 -- .../geonet/ogcapi/records/util/JsonUtils.java | 1 + 24 files changed, 838 insertions(+), 93 deletions(-) create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiComponent.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiExternalDocumentation.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiInfo.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLicense.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiPath.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiReference.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchema.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchemaContact.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSecurityRequirement.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiServer.java create mode 100644 modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTag.java diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CapabilitiesApiController.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CapabilitiesApiController.java index 0a4a7099..02b97305 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CapabilitiesApiController.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CapabilitiesApiController.java @@ -22,7 +22,6 @@ import org.fao.geonet.ogcapi.records.controller.model.Root; import org.fao.geonet.ogcapi.records.model.OgcApiLink; import org.fao.geonet.ogcapi.records.model.XsltModel; -import org.fao.geonet.ogcapi.records.service.RecordService; import org.fao.geonet.ogcapi.records.util.CollectionInfoBuilder; import org.fao.geonet.ogcapi.records.util.LinksItemsBuilder; import org.fao.geonet.ogcapi.records.util.MediaTypeUtil; @@ -69,25 +68,17 @@ public class CapabilitiesApiController { @Autowired ConcurrentMapCacheManager cacheManager; - - @Autowired - private SourceRepository sourceRepository; - - @Autowired - private SearchConfiguration configuration; - @Autowired MediaTypeUtil mediaTypeUtil; - @Autowired CollectionInfoBuilder collectionInfoBuilder; - @Autowired - RecordService recordService; + private SourceRepository sourceRepository; + @Autowired + private SearchConfiguration configuration; /** * Landing page end-point. - * */ @io.swagger.v3.oas.annotations.Operation( summary = "Landing page.", @@ -126,7 +117,7 @@ public ResponseEntity getLandingPage(@ApiIgnore HttpServletRequest request CollectionInfo collectionInfo = collectionInfoBuilder .buildFromSource(source, language, requestBaseUrl, - configuration.getFormat(mediaType), configuration,request); + configuration.getFormat(mediaType), configuration, request); root.setSystemInfo(collectionInfo); } @@ -137,10 +128,10 @@ public ResponseEntity getLandingPage(@ApiIgnore HttpServletRequest request configuration.getFormats(Operations.root).forEach(f -> root.addLinksItem(new OgcApiLink() - .href(requestBaseUrl + "collections?f=" + f.getName()) - .type("Catalogue collections") - .rel("self") - .type(f.getMimeType()))); + .href(requestBaseUrl + "collections?f=" + f.getName()) + .type("Catalogue collections") + .rel("self") + .type(f.getMimeType()))); addOpenApiLinks(root, requestBaseUrl); addConformanceLinks(root, requestBaseUrl); @@ -185,7 +176,6 @@ private void addConformanceLinks(Root root, String baseUrl) { .rel(CONFORMANCE_REL) .type(MediaType.TEXT_HTML_VALUE)); - root.addLinksItem(new OgcApiLink() .href(baseUrl + CONFORMANCE_REL + "?f=json") .title(title + " as JSON") @@ -226,7 +216,7 @@ public ResponseEntity conformanceDeclaration(@ApiIgnore HttpServlet "http://www.opengis.net/spec/ogcapi-records-1/1.0/conf/html", "http://www.opengis.net/spec/ogcapi-records-1/1.0/conf/json", "http://www.opengis.net/spec/ogcapi-records-1/1.0/conf/sorting" - )); + )); if (!mediaType.equals(MediaType.TEXT_HTML)) { return ResponseEntity.ok(conformance); @@ -248,7 +238,6 @@ public ResponseEntity conformanceDeclaration(@ApiIgnore HttpServlet /** * Collections information end-point. - * */ @io.swagger.v3.oas.annotations.Operation( summary = "Collections available from this API.", @@ -282,7 +271,7 @@ public ResponseEntity describeCollections(@ApiIgnore HttpServletRequest sources.forEach(s -> content.addCollectionsItem( collectionInfoBuilder.buildFromSource( s, language, requestBaseUrl, configuration.getFormat(mediaType), - configuration,request))); + configuration, request))); // TODO: Accept format parameter. List linkList = LinksItemsBuilder.build( diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CollectionApiController.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CollectionApiController.java index d1355a64..096ae997 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CollectionApiController.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/CollectionApiController.java @@ -67,21 +67,16 @@ public class CollectionApiController { @Autowired @Qualifier("xsltViewResolver") ViewResolver viewResolver; - - @Autowired - private CollectionService collectionService; - @Autowired MessageSource messages; - - @Autowired - private SearchConfiguration configuration; - @Autowired MediaTypeUtil mediaTypeUtil; - @Autowired CollectionInfoBuilder collectionInfoBuilder; + @Autowired + private CollectionService collectionService; + @Autowired + private SearchConfiguration configuration; /** * Describe a collection. @@ -136,7 +131,7 @@ public ResponseEntity describeCollection( CollectionInfo collectionInfo = collectionInfoBuilder .buildFromSource(source, language, requestBaseUrl, - configuration.getFormat(mediaType), configuration,request); + configuration.getFormat(mediaType), configuration, request); return ResponseEntity.ok(collectionInfo); diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CollectionInfo.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CollectionInfo.java index a7609f8a..35a29957 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CollectionInfo.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CollectionInfo.java @@ -21,6 +21,7 @@ import org.fao.geonet.ogcapi.records.model.OgcApiExtent; import org.fao.geonet.ogcapi.records.model.OgcApiLanguage; import org.fao.geonet.ogcapi.records.model.OgcApiLink; +import org.fao.geonet.ogcapi.records.model.OgcApiSchema; import org.fao.geonet.ogcapi.records.model.OgcApiTheme; /** @@ -33,52 +34,70 @@ @XmlAccessorType(XmlAccessType.FIELD) public class CollectionInfo { + /** + * Fixed value of "Catalog". + */ //required cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/catalog.yaml @JsonProperty("type") @JacksonXmlProperty(localName = "type") private String type = "catalog"; - //cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/catalog.yaml + // cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/catalog.yaml // NOTE: spec says this should be "record" or ["record","catalog"]. + /**Fixed value of "record", "catalog" or both.*/ @JsonProperty("itemType") @JacksonXmlProperty(localName = "itemType") private String itemType = "record"; - /**The identifier of the catalog.*/ + /** + * The identifier of the catalog. + */ @JsonProperty("id") @JacksonXmlProperty(localName = "id") private String id; - /**A human-readable name given to the resource.*/ + /** + * A human-readable name given to the resource. + */ @JsonProperty("title") @JacksonXmlProperty(localName = "title") private String title; - /**A free-text account of the resource.*/ + /** + * A free-text account of the resource. + */ @JsonProperty("description") @JacksonXmlProperty(localName = "description") private String description; - /**links for this object.*/ + /** + * links for this object. + */ @JsonProperty("links") @JacksonXmlProperty(localName = "links") @JsonInclude(Include.NON_EMPTY) private List links = new ArrayList<>(); - /**The spatiotemporal coverage of this catalog.*/ + /** + * The spatiotemporal coverage of this catalog. + */ @JsonProperty("extent") @JacksonXmlProperty(localName = "extent") private OgcApiExtent extent; - /**The list of supported coordinate reference systems.*/ + /** + * The list of supported coordinate reference systems. + */ @JsonProperty("crs") @JacksonXmlProperty(localName = "crs") @JsonInclude(Include.NON_EMPTY) private List crs = null; - /** A list of contacts qualified by their role(s) in association - * to the record or the resource described by the record. */ + /** + * A list of contacts qualified by their role(s) in association to the record or the resource + * described by the record. + */ @JsonProperty("contacts") @JacksonXmlProperty(localName = "contacts") @JsonInclude(Include.NON_EMPTY) @@ -171,6 +190,76 @@ public class CollectionInfo { private List defaultSortOrder = null; + //-------------------------------------------------------------------------- + // these are properties in the written spec, but not in the .yaml definition + //-------------------------------------------------------------------------- + + /** + * The extensions/conformance classes used in this catalog object. + */ + @JsonProperty("conformsTo") + @JacksonXmlProperty(localName = "conformsTo") + @JsonInclude(Include.NON_EMPTY) + private String conformsTo = null; + + /**The list of languages in which records from the collection can be represented.*/ + @JsonProperty("recordLanguages") + @JacksonXmlProperty(localName = "recordLanguages") + @JsonInclude(Include.NON_EMPTY) + private List recordLanguages = null; + + + /** + * The name of the array property in the catalog used to encode records in-line. + * The default value is records. + */ + @JsonProperty("recordsArrayName") + @JacksonXmlProperty(localName = "recordsArrayName") + @JsonInclude(Include.NON_EMPTY) + private String recordsArrayName = null; + + /**A list of schemes related to this catalog.*/ + @JsonProperty("schemes") + @JacksonXmlProperty(localName = "schemes") + @JsonInclude(Include.NON_EMPTY) + private List schemes = null; + + + //-------------------------------------------------------------------------- + + + public String getConformsTo() { + return conformsTo; + } + + public void setConformsTo(String conformsTo) { + this.conformsTo = conformsTo; + } + + public List getRecordLanguages() { + return recordLanguages; + } + + public void setRecordLanguages(List recordLanguages) { + this.recordLanguages = recordLanguages; + } + + public String getRecordsArrayName() { + return recordsArrayName; + } + + public void setRecordsArrayName(String recordsArrayName) { + this.recordsArrayName = recordsArrayName; + } + + public List getSchemes() { + return schemes; + } + + public void setSchemes(List schemes) { + this.schemes = schemes; + } + public List getDefaultSortOrder() { return defaultSortOrder; } diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CrsEnum.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CrsEnum.java index bf59e2f8..cc2dfe11 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CrsEnum.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/CrsEnum.java @@ -1,3 +1,8 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + package org.fao.geonet.ogcapi.records.controller.model; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/Root.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/Root.java index 518f9148..0c1d4bf5 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/Root.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/controller/model/Root.java @@ -26,6 +26,14 @@ public class Root { /** * This is the collection info for the main-portal. + * + *

THIS IS NON-STANDARD (not in the ogcapi spec)! + * + *

The landing page JSON also includes a new property systemInfo which contains a catalog.yaml + * object in it. + * I'm not sure if this is allowed in the spec, but it allows for more metadata about the + * entire GN system ("ogcapi-records" server). This is useful for making a nicer landing page + * (cf. pygeoapi's landing page). */ @JsonProperty("systemInfo") @JacksonXmlProperty(localName = "systemInfo") diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiComponent.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiComponent.java new file mode 100644 index 00000000..ed0e4be7 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiComponent.java @@ -0,0 +1,18 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +/** + * OgcApiComponent. + * + *

cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

TODO - This is a very complex object with many pattern properties. I've left this empty + * for now. When this is needed, please fill in (also, include the x-* properties used elsewhere). + */ +public class OgcApiComponent { + +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiConcept.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiConcept.java index 7b508525..7d8f1918 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiConcept.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiConcept.java @@ -15,8 +15,7 @@ * cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/theme.yaml * *

Entity/concept identifiers from this knowledge - * system. it is recommended that a resolvable URI be used for - * each entity/concept identifier. + * system. it is recommended that a resolvable URI be used for each entity/concept identifier. */ public class OgcApiConcept { diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiContact.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiContact.java index f52dd7b7..27b1cbeb 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiContact.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiContact.java @@ -15,7 +15,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.fao.geonet.ogcapi.records.util.CollectionInfoBuilder; import org.fao.geonet.ogcapi.records.util.JsonUtils; import org.springframework.util.StringUtils; @@ -23,63 +22,81 @@ * https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/contact.yaml * *

Identification of, and means of communication with, person responsible - * for the resource. + * for the resource. */ @XmlRootElement(name = "contact") @XmlAccessorType(XmlAccessType.FIELD) public class OgcApiContact { - /**A value uniquely identifying a contact.*/ + /** + * A value uniquely identifying a contact. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "identifier") @XmlElement(name = "identifier") private String identifier; - /**The name of the responsible person.*/ + /** + * The name of the responsible person. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "name") @XmlElement(name = "name") private String name; - /** The name of the role or position of the responsible person taken - from the organization's formal organizational hierarchy or chart.*/ + /** + * The name of the role or position of the responsible person taken from the organization's formal + * organizational hierarchy or chart. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "position") @XmlElement(name = "position") private String position; - /**Organization/affiliation of the contact.*/ + /** + * Organization/affiliation of the contact. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "organization") @XmlElement(name = "organization") private String organization; - /**Graphic identifying a contact. The link relation should be `icon` - and the media type should be an image media type.*/ + /** + * Graphic identifying a contact. The link relation should be `icon` and the media type should be + * an image media type. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "logo") @XmlElement(name = "logo") private OgcApiLink logo; - /**Telephone numbers at which contact can be made.*/ + /** + * Telephone numbers at which contact can be made. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "phones") @XmlElement(name = "phones") private List phones = new ArrayList<>(); - /**Email addresses at which contact can be made.*/ + /** + * Email addresses at which contact can be made. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "emails") @XmlElement(name = "emails") private List emails = new ArrayList<>(); - /**Physical location at which contact can be made.*/ + /** + * Physical location at which contact can be made. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "addresses") @XmlElement(name = "addresses") private List addresses = new ArrayList<>(); - /** On-line information about the contact.*/ + /** + * On-line information about the contact. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "links") @XmlElement(name = "links") @@ -89,22 +106,24 @@ public class OgcApiContact { * Time period when the contact can be contacted. * *

example: "Hours: Mo-Fr 10am-7pm Sa 10am-22pm Su 10am-21pm" - * */ + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "hoursOfService") @XmlElement(name = "hoursOfService") private String hoursOfService; - /** Supplemental instructions on how or when to contact the - responsible party.*/ + /** + * Supplemental instructions on how or when to contact the responsible party. + */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "contactInstructions") @XmlElement(name = "contactInstructions") private String contactInstructions; - /** The set of named duties, job functions and/or permissions - associated with this contact. - (e.g. developer, administrator, etc.).*/ + /** + * The set of named duties, job functions and/or permissions associated with this contact. (e.g. + * developer, administrator, etc.). + */ @JsonInclude(JsonInclude.Include.NON_NULL) @XmlElementWrapper(name = "roles") @XmlElement(name = "roles") diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiExternalDocumentation.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiExternalDocumentation.java new file mode 100644 index 00000000..8ce6ae23 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiExternalDocumentation.java @@ -0,0 +1,58 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiExternalDocumentation. + * + *

cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + */ +public class OgcApiExternalDocumentation { + + /** + * undefined in spec. + * + *

format: uri-reference + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "url") + @XmlElement(name = "url") + private String url; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "description") + @XmlElement(name = "description") + private String description; + + //------------------------------------------ + + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiInfo.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiInfo.java new file mode 100644 index 00000000..66197701 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiInfo.java @@ -0,0 +1,72 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + + +/** + * cf https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + */ +public class OgcApiInfo { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "title") + @XmlElement(name = "title") + private String title; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "description") + @XmlElement(name = "description") + private String description; + + /** + * undefined in spec. + * + *

format: uri-reference + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "termsOfService") + @XmlElement(name = "termsOfService") + private String termsOfService; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "contact") + @XmlElement(name = "contact") + private OgcApiSchemaContact contact; + + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "license") + @XmlElement(name = "license") + private OgcApiLicense license; + + /** + * undefined in spec. + * + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "version") + @XmlElement(name = "version") + private String version; +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLicense.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLicense.java new file mode 100644 index 00000000..8ead1968 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLicense.java @@ -0,0 +1,58 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiLicense. + * + *

cf https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + */ +public class OgcApiLicense { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "name") + @XmlElement(name = "name") + private String name; + + + /** + * undefined in spec. + * + *

format: uri-reference + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "url") + @XmlElement(name = "url") + private String url; + + //----------------------------------------------------- + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLink.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLink.java index 750af456..69897aac 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLink.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiLink.java @@ -17,6 +17,15 @@ /** * https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/linkBase.yaml * + *

also see: https://schemas.opengis.net/ogcapi/features/part1/1.0/openapi/schemas/link.yaml + * + *

NOTE: + * These specs aren't really consistent. The first: + * a) doesn't have a href (this is obviously a mistake). + * b) has a created/updated field (not in the other spec). Recommend not using this. + * + *

Note - there is a length field, but its value isn't defined. Recommend not using this. + * *

Represents a link. */ @XmlRootElement(name = "link") @@ -60,6 +69,8 @@ public class OgcApiLink { /** * undocumented in spec. + * + *

This probably shouldn't be used because its not defined. */ @JsonInclude(Include.NON_DEFAULT) @XmlElementWrapper(name = "length") @@ -68,6 +79,8 @@ public class OgcApiLink { /** * Date of creation of the resource pointed to by the link. format: date-time + * + *

This is only is one of the link specifications. This probably shouldn't be used. */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "created") @@ -77,6 +90,8 @@ public class OgcApiLink { /** * description: Most recent date on which the resource pointed to by the link was changed. format: * date-time + * + *

This is only is one of the link specifications. This probably shouldn't be used. */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "updated") diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiPath.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiPath.java new file mode 100644 index 00000000..21d50493 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiPath.java @@ -0,0 +1,19 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + + +/** + * OgcApiPath. + * + *

https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

TODO -This is a very complex object with many pattern properties. I've left this empty for + * now. When this is needed, please fill in (also, include the x-* properties used elsewhere). + */ +public class OgcApiPath { + +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiReference.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiReference.java new file mode 100644 index 00000000..95574c6b --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiReference.java @@ -0,0 +1,37 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiReference. + * cf https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + */ +public class OgcApiReference { + + /** + * format: uri-reference. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "ref") + @XmlElement(name = "ref$") + public String ref; + + //------------------------------------------------ + + + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchema.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchema.java new file mode 100644 index 00000000..6d149c5b --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchema.java @@ -0,0 +1,154 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

A scheme related to this catalog. + * + *

The description of OpenAPI v3.0.x documents, as defined by + * https://spec.openapis.org/oas/v3.0.3 + * + *

NOTE - THIS ISN'T WELL DEFINED IN THE SPECIFICATION (OR .yaml). + * I've done my best. + * + *

I haven't included the "x-*" pattern properties + * + *

NOTE - THE SCHEMA OBJECT ISN'T FULLY DESCRIBED IN THE SUB-PROPERTIES SINCE THEY CONTAIN + * DIFFERENT TYPES OF PATTERN PROPERTIES + * + *

TODO - when these objects are needed (currently not). Please go through the spec and + * .yaml to determine what's needed and that all the objects are fully filled out. + */ +@XmlRootElement(name = "schema") +@XmlAccessorType(XmlAccessType.FIELD) +public class OgcApiSchema { + + /** + * Undefined in the spec. Likely the openapi version number. + * + *

pattern: ^3\.0\.\d(-.+)?$ + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "openapi") + @XmlElement(name = "openapi") + private String openapi; + + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "info") + @XmlElement(name = "info") + private OgcApiInfo info; + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "externalDocs") + @XmlElement(name = "externalDocs") + private OgcApiExternalDocumentation externalDocs; + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "servers") + @XmlElement(name = "servers") + private List servers; + + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "security") + @XmlElement(name = "security") + private List security; + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "tags") + @XmlElement(name = "tags") + private List tags; + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "paths") + @XmlElement(name = "paths") + private OgcApiPath paths; + + + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "components") + @XmlElement(name = "components") + private OgcApiComponent components; + + //--------------------------------------------------------------------- + + + public String getOpenapi() { + return openapi; + } + + public void setOpenapi(String openapi) { + this.openapi = openapi; + } + + public OgcApiInfo getInfo() { + return info; + } + + public void setInfo(OgcApiInfo info) { + this.info = info; + } + + public OgcApiExternalDocumentation getExternalDocs() { + return externalDocs; + } + + public void setExternalDocs(OgcApiExternalDocumentation externalDocs) { + this.externalDocs = externalDocs; + } + + public List getServers() { + return servers; + } + + public void setServers(List servers) { + this.servers = servers; + } + + public List getSecurity() { + return security; + } + + public void setSecurity(List security) { + this.security = security; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public OgcApiPath getPaths() { + return paths; + } + + public void setPaths(OgcApiPath paths) { + this.paths = paths; + } + + public OgcApiComponent getComponents() { + return components; + } + + public void setComponents(OgcApiComponent components) { + this.components = components; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchemaContact.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchemaContact.java new file mode 100644 index 00000000..c2a425e3 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSchemaContact.java @@ -0,0 +1,76 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * This is different (simpler) from the "normal" OgcApiContact. + * + *

cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + */ +public class OgcApiSchemaContact { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "name") + @XmlElement(name = "name") + private String name; + + /** + * undefined in spec. + * + *

format: uri-reference + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "url") + @XmlElement(name = "url") + private String url; + + /** + * undefined in spec. + * + *

format: email + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "email") + @XmlElement(name = "email") + private String email; + + //----------------------------------------------------- + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSecurityRequirement.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSecurityRequirement.java new file mode 100644 index 00000000..bb8bafdb --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSecurityRequirement.java @@ -0,0 +1,39 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiSecurityRequirement. + * + *

https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + */ +public class OgcApiSecurityRequirement { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "items") + @XmlElement(name = "items") + private List items; + + //------------------------------------------ + + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiServer.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiServer.java new file mode 100644 index 00000000..f21f24b5 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiServer.java @@ -0,0 +1,59 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiServer. + * + *

https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + * + *

I haven't included the variables ("ServerVariable") additional properties. + */ +public class OgcApiServer { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "url") + @XmlElement(name = "url") + private String url; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "description") + @XmlElement(name = "description") + private String description; + + + //---------------------------------------------------------- + + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSpatialExtent.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSpatialExtent.java index b74afc61..35d62da5 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSpatialExtent.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiSpatialExtent.java @@ -31,10 +31,10 @@ public class OgcApiSpatialExtent { * One or more bounding boxes that describe the spatial extent of the dataset. In the Core only a * single bounding box is supported. * - *

Extensions may support additional areas. The first bounding box describes the overall - * spatial extent of the data. All subsequent bounding boxes describe more precise bounding - * boxes, e.g.,to identify clusters of data. Clients only interested in the overall spatial - * extent will only need to access the first bounding box in the array. + *

Extensions may support additional areas. The first bounding box describes the overall + * spatial extent of the data. All subsequent bounding boxes describe more precise bounding boxes, + * e.g.,to identify clusters of data. Clients only interested in the overall spatial extent will + * only need to access the first bounding box in the array. * *

---- * @@ -53,17 +53,17 @@ public class OgcApiSpatialExtent { * longitude/latitude/ellipsoidal height (http://www.opengis.net/def/crs/OGC/0/CRS84h) unless a * different coordinate reference system is specified in `crs`. * - *

For WGS 84 longitude/latitude the values are in most cases the sequence of minimum - * longitude, minimum latitude, maximum longitude and maximum latitude. However, in cases where - * the box spans the antimeridian the first value (west-most box edge) is larger than the third + *

For WGS 84 longitude/latitude the values are in most cases the sequence of minimum + * longitude, minimum latitude, maximum longitude and maximum latitude. However, in cases where + * the box spans the antimeridian the first value (west-most box edge) is larger than the third * value (east-most box edge). * *

If the vertical axis is included, the third and the sixth number are the bottom and the * top of the 3-dimensional bounding box. * *

If a feature has multiple spatial geometry properties, it is the decision of the server - * whether only a single spatial geometry property is used to determine the extent or all - * relevant geometries. + * whether only a single spatial geometry property is used to determine the extent or all relevant + * geometries. */ @JsonInclude(Include.NON_EMPTY) @XmlElementWrapper(name = "bbox") @@ -75,7 +75,7 @@ public class OgcApiSpatialExtent { * coordinate reference system is WGS 84 longitude/latitude/ellipsoidal height for coordinates * with height. Extensions may support additional coordinate reference systems and add additional * enum values. - * + * *

enum: - 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' - 'http://www.opengis.net/def/crs/OGC/0/CRS84h' * default: 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' */ @@ -87,13 +87,12 @@ public class OgcApiSpatialExtent { /** * Create OgcApiSpatialExtent from the "geom" section of the GN Index record. Typically this is a * polygon: - * + * *

"geom":[{"type":"Polygon","coordinates": - * [[[37.0,-3.0],[156.0,-3.0],[156.0,83.0],[37.0,83.0],[37.0,-3.0]]]}] - * + * [[[37.0,-3.0],[156.0,-3.0],[156.0,83.0],[37.0,83.0],[37.0,-3.0]]]}] + * *

you should call this method with the {"type":"Polygon", - * "coordinates":[[[37.0,-3.0],[156.0,-3.0],[156.0,83.0],[37.0,83.0],[37.0,-3.0]]]} - * object + * "coordinates":[[[37.0,-3.0],[156.0,-3.0],[156.0,83.0],[37.0,83.0],[37.0,-3.0]]]} object * * @param map from the GN Index Record JSON * @return parsed OgcApiSpatialExtent @@ -116,7 +115,7 @@ public static OgcApiSpatialExtent fromGnIndexRecord(Map map) { for (var myCoord : coords) { var coord = (List) myCoord; var x = getAsDouble(coord.get(0)); - var y = getAsDouble(coord.get(1)); + var y = getAsDouble(coord.get(1)); if (x < xmin) { xmin = x; } diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTag.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTag.java new file mode 100644 index 00000000..ed7eac15 --- /dev/null +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTag.java @@ -0,0 +1,47 @@ +/** + * (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the + * GPL 2.0 license, available at the root application directory. + */ + +package org.fao.geonet.ogcapi.records.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; + +/** + * OgcApiTag. + * + *

cf. https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/schema.yaml + * + *

I haven't included the "x-*" pattern properties. + */ +public class OgcApiTag { + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "name") + @XmlElement(name = "name") + private String name; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "description") + @XmlElement(name = "description") + private String description; + + /** + * undefined in spec. + */ + @JsonInclude(Include.NON_EMPTY) + @XmlElementWrapper(name = "externalDocs") + @XmlElement(name = "externalDocs") + private OgcApiExternalDocumentation externalDocs; + +} diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTemporalExtent.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTemporalExtent.java index 37617423..48a90f0d 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTemporalExtent.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTemporalExtent.java @@ -18,7 +18,6 @@ * cf. https://github.com/opengeospatial/ogcapi-features/blob/master/core/openapi/schemas/extent.yaml * *

The temporal extent of the features in the collection. - * */ public class OgcApiTemporalExtent { diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTheme.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTheme.java index 97cb7e08..d1f3cd38 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTheme.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/model/OgcApiTheme.java @@ -18,14 +18,14 @@ import org.springframework.util.StringUtils; /** - * cf https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/theme.yaml + * cf https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/theme.yaml * - *

This is the ogcapi "theme" object model. + *

This is the ogcapi "theme" object model. * - *

From ogcapi-records spec: + *

From ogcapi-records spec: * - *

Themes are concepts associated with the resource(s) that a record describes taken from - * one or more formal knowledge organization systems or schemes. + *

Themes are concepts associated with the resource(s) that a record describes taken from + * one or more formal knowledge organization systems or schemes. */ public class OgcApiTheme { diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/CollectionInfoBuilder.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/CollectionInfoBuilder.java index 8c88118c..31319318 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/CollectionInfoBuilder.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/CollectionInfoBuilder.java @@ -35,13 +35,6 @@ public class CollectionInfoBuilder { @Autowired RecordService recordService; - - @Autowired - private SourceRepository sourceRepository; - - @Autowired - private SettingRepository settingRepository; - @Autowired ElasticIndexJson2CollectionInfo elasticIndexJson2CollectionInfo; @@ -50,8 +43,6 @@ public CollectionInfoBuilder() { } - - /** * Build Collection info from source table. * @@ -119,5 +110,4 @@ public CollectionInfo buildFromSource(Source source, } - } diff --git a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/JsonUtils.java b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/JsonUtils.java index b3bd7e58..fa4c5481 100644 --- a/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/JsonUtils.java +++ b/modules/services/ogc-api-records/src/main/java/org/fao/geonet/ogcapi/records/util/JsonUtils.java @@ -8,6 +8,7 @@ import java.util.Map; public class JsonUtils { + /** * todo - be language aware (send in desired language). Move to utility class. *