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

Is it possible to search for registry keys? #1852

Closed
gforcada opened this issue Jan 7, 2025 · 3 comments
Closed

Is it possible to search for registry keys? #1852

gforcada opened this issue Jan 7, 2025 · 3 comments

Comments

@gforcada
Copy link
Member

gforcada commented Jan 7, 2025

Our use case:

We have plenty of SVG icons that are stored in the registry (this way we can upload more on demand) and we want to display a gallery of those icons via the frontend.

For that we need a way, with the plone.restapi, to query the registry for certain keys that start with a given prefix.

The search form that shows on the Classic UI control panel but powered via the plone.restapi.

On the docs it only mentions how to get one specific registry record, list all of them, or update a registry record.

We are missing the search and creating new registry records endpoints.

With some code pointers, we could provide them ourselves if, as I'm gathering, they don't exist.

@davisagli
Copy link
Member

@gforcada The registry endpoints are in https://github.com/plone/plone.restapi/tree/main/src/plone/restapi/services/registry and use serialization adapters in https://github.com/plone/plone.restapi/blob/main/src/plone/restapi/serializer/registry.py

I think it'd make sense to add support for filtering the listing using a prefix passed in the querystring (similar to https://6.docs.plone.org/plone.restapi/docs/source/endpoints/aliases.html#filter-aliases in the aliases endpoint).

@gforcada
Copy link
Member Author

@davisagli oh, thanks, a code example is great 👍🏾 as I will need it for a project at work, I hope I can contribute this enhancement soon ™

@davisagli
Copy link
Member

A way to filter the registry keys in the GET endpoint was added in #1861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants