plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 73 forks source link

@aliases endpoint should allow to upload/download all aliases and allow to download filtered aliases as CSV file #1793

Open tisto opened 2 weeks ago

tisto commented 2 weeks ago

PR for adding aliases: https://github.com/plone/plone.restapi/pull/1398

The @aliases should allow to upload aliases as CSV files and to download all existing aliases as CSV file. I am guessing there is a browser view in ClassicUI that does this already. Therefore it should be pretty straight forward to add this to the existing controlpanel.

However, it would be nice if we would allow to download a CSV file based on any filter criterion of the @aliases endpoint:

http://localhost:8080/Plone/++api++/@aliases&q=/de/ft/my-path&manual=true&from=2021-01-01&to=2023-01-01

We could use content negotiation for this and send the "Accept" HTTP header "text/csv". Then REST API would return the CSV file.

Code

Download method of the redirects control panel:

https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/controlpanel/browser/redirects.py#L457

There is not a single unit/integration test for the aliases service. :(