Skip to content

Map viewer / WFS filter / remove unused SLD API endpoints#9343

Merged
josegar74 merged 2 commits into
geonetwork:mainfrom
GeoCat:fix/remove-unused-api-endpoints
Jun 18, 2026
Merged

Map viewer / WFS filter / remove unused SLD API endpoints#9343
josegar74 merged 2 commits into
geonetwork:mainfrom
GeoCat:fix/remove-unused-api-endpoints

Conversation

@juanluisrp

@juanluisrp juanluisrp commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

The SLD-based WMS filtering strategies (SLD and SLD_BODY) were never
the active path in production: the default filterStrategy was always
FILTER, the SLD/SLD_BODY options were commented out in the viewer config,
and the SLD_BODY path is documented as returning 414 Request-URI Too Large.

  • Remove dead endpoints POST /sld, GET /sld, DELETE /sld, GET /sld/{id}.xml, GET /sldform from SldApi, keeping only POST /filter.
  • Remove SLD-only helpers from SLDUtil (parseSLD, getGetStyleRequest, insertFilter) and their associated imports (Apache HttpClient, IOUtils, javax.mail, JDOM, etc.).
  • Remove TextFile JPA entity and TextFileRepository (existed solely to persist generated SLD documents); add a v4412 migration to drop the files table and sequence.
  • Simplify WfsFilterService to always POST to /api/tools/ogc/filter and apply the result as a WMS FILTER parameter; remove the isSld/SLD_BODY branches, both pollSldUrl copies, and the $timeout/gnWfsFilterConfig injections.
  • Remove the filterStrategy property from the gnWfsFilterConfig constant and the dead var isSld line in filterWMS in WfsFilterDirective.
  • Remove stale generateSLD/getSLD Jeeves security mappings.
  • Update user guide to reflect that filters are applied via the WMS FILTER parameter.

Test plan

  • POST /geonetwork/srv/api/tools/ogc/filter returns HTTP 201 with a valid <ogc:Filter> XML body
  • GET /sldform, GET /sld, GET /sld/1.xml, POST /sld, DELETE /sld all return HTTP 404
  • wfsFilterService.pollSldUrl no longer exists on the service
  • wfsFilterService.getFilterapplyFilter sets FILTER param on WMS layer source; SLD and SLD_BODY params are not set
  • Tested end-to-end with real data
  • No console errors in the map viewer

The SLD-based WMS filtering strategies (SLD and SLD_BODY) were never
the active path in production: the default filterStrategy was always
FILTER, the SLD/SLD_BODY options were commented out in the config, and
the SLD_BODY path is documented as returning 414 Request-URI Too Large.

Remove the dead endpoints (POST /sld, GET /sld, DELETE /sld,
GET /sld/{id}.xml, GET /sldform) from SldApi, keeping only
POST /filter which is still in use.

Remove the methods only used by the SLD endpoints from SLDUtil
(parseSLD, getGetStyleRequest, insertFilter) and their associated
imports (Apache HttpClient, IOUtils, javax.mail, JDOM Element/Content,
ServiceException, URI/URISyntaxException).

Remove the TextFile JPA entity and TextFileRepository, which existed
solely to persist generated SLD documents, and add a v4412 migration
to drop the now-unused files table and sequence.

Simplify WfsFilterService to always POST to /api/tools/ogc/filter and
apply the result as a WMS FILTER parameter. Remove the isSld/SLD_BODY
branches, both pollSldUrl copies, and the $timeout and gnWfsFilterConfig
injections that only served those paths.

Remove the filterStrategy property from the gnWfsFilterConfig constant
in WfsFilterDirective and the dead var isSld line in filterWMS.

Remove the stale generateSLD/getSLD Jeeves security mappings.

Update the user guide to reflect that filters are applied via the WMS
FILTER parameter rather than SLD.
- Add file headers and minor code improvements.
- Add unit tests for SLDUtil
@josegar74 josegar74 merged commit 17fdae2 into geonetwork:main Jun 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Indicate a change in the API changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants