Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the CSW filter configurable #6886

Closed
1 of 10 tasks
offtherailz opened this issue May 19, 2021 · 1 comment · Fixed by #7220
Closed
1 of 10 tasks

Make the CSW filter configurable #6886

offtherailz opened this issue May 19, 2021 · 1 comment · Fixed by #7220

Comments

@offtherailz
Copy link
Member

offtherailz commented May 19, 2021

Description

For some services we need to customize the search request accordingly to specific catalogs.

Acceptance Criteria

  • We should be able by configuration to set up the request filter.
  • Empty search should work reporting all the results with the base filter applied.
  • A text search should be used in combination with the base filter to filter more the results.
  • The filter be applied on certain attributes, to satisfy geOrchestra requirement @tdipisa note the complexity of the filter proposed by GeOrchstra, that includes the text in many places, somethimes with '', sometimes without ''.
  • The same options for the filter can be configured with advanced settings of the edit catalog UI, and they should work for both the map catalog or all the compact catalogs in the application (dashboards, geostory...)

References:

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Other useful information

Here the current filter generation function. There is an if to discriminate between empty search and search with text. It is requierd because of some errors that can occour in certain services when And containing tag only one chidlren, while the minimum is two (GeoServer should be one that fails, if I remember well) .
We should check if it is possible find a way to use only one template for all, passing a value that can be a jolly text for all the services, so empty search and text search can use the same model.
This could allow to fully customize the request template, adding the text as a parameter and so allowing the geOrchstra use case.

The current implementation includes the limitation for for dc:type. to dataset. This should not be the default or should be customizable, because the catalog should be usable also for consultation, not only to add layers.

Suggestion

In configuration you can set two different filters. One is staticFilter, one is dynamicFilter.

By default staticFilter is always applied, even in empty search.

    <ogc:Or>
    <ogc:PropertyIsEqualTo>
        <ogc:PropertyName>dc:type</ogc:PropertyName>
        <ogc:Literal>dataset</ogc:Literal>
    </ogc:PropertyIsEqualTo>
    <ogc:PropertyIsEqualTo>
        <ogc:PropertyName>dc:type</ogc:PropertyName>
        <ogc:Literal>http://purl.org/dc/dcmitype/Dataset</ogc:Literal>
    </ogc:PropertyIsEqualTo>
   </ogc:Or>

dynamicFilter is applied in AND with static Fiter, and is a template where to place the search text.

<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\\">
      <ogc:PropertyName>csw:AnyText</ogc:PropertyName>
      <ogc:Literal>%${searchText}%</ogc:Literal>
  </ogc:PropertyIsLike>

The two fillter will be put in "AND" if the text is present, otherwise use only static one as actually done here by using two different templates.

  • The user can customize in the serice configuration one or both this values. (From JSON configuration or from UI, Advanced Options of Service configuration, if the serice is CSW).

  • The template will be a lodash template format and saved with the other configurations of the service.
    This should already allow to configure it both from plugin cfg or in map.

  • Handle possible errors (e.g. invalid xml, failures).

  • The two properties should be documented for CSW services.

@tdipisa tdipisa self-assigned this May 19, 2021
@tdipisa tdipisa added this to the 2021.02.00 milestone Jul 8, 2021
@tdipisa tdipisa removed this from the 2021.02.00 milestone Aug 3, 2021
@tdipisa tdipisa assigned dsuren1 and unassigned tdipisa Aug 3, 2021
@tdipisa tdipisa added this to the 2021.02.00 milestone Aug 3, 2021
dsuren1 added a commit to dsuren1/MapStore2 that referenced this issue Aug 20, 2021
dsuren1 added a commit to dsuren1/MapStore2 that referenced this issue Sep 23, 2021
@ElenaGallo ElenaGallo self-assigned this Sep 23, 2021
@tdipisa tdipisa linked a pull request Sep 27, 2021 that will close this issue
6 tasks
@tdipisa
Copy link
Member

tdipisa commented Sep 27, 2021

@ElenaGallo this issue is covered by

#7220 (see linked issue)
#7352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment