Custom exporter logic - #2101
Conversation
|
@gforcada would you please request a review from whoever can provide a technical review? I've already requested two folks, based on the linked PR and the related training author. |
|
@stevepiercy thanks for doing that, I will try to remember next time. I will add another one, just to have higher chances of one actually reviewing it |
|
I'll do an editorial review, after the technical parts are verified. Thanks for your collaboration. |
davisagli
left a comment
There was a problem hiding this comment.
This looks accurate for the proposed implementation in plone/plone.exportimport#86, but I also asked a question there to confirm whether @gforcada has confirmed this does what he needs.
| With this, the default `plone-exporter` will no longer export **all content**. | ||
|
|
||
| ```{warning} | ||
| As soon as you override the export be aware that other parts of the export might not work. |
There was a problem hiding this comment.
I was more worried about whether the import works. For example if 10% of content is exported by the content step but 100% of relations are exported by the relations step, then the import might fail when there is a relation that refers to one of the content items that was not included. Can you at least do a sanity check that this works in your case?
There was a problem hiding this comment.
Yes, this is working for us, there are quite a lot of messages mentioning that, but either plone.exportimport or the underlying relation machinery handles it gracefully 🎉
| # custom logic to select which specific content gets exported | ||
| ``` | ||
|
|
||
| With this, the default `plone-exporter` will no longer export **all content**. |
There was a problem hiding this comment.
That's a bit of a limitation. Maybe you want all of the content sometimes, and different subsets at other times. This makes me wonder whether we should have named IObjectsExporter adapters, and make it possible to specify which one to use in the CLI
There was a problem hiding this comment.
I had quite a few ideas to improve what gets exported:
- add a control panel that lists what gets exported (a fancy
printof whatIObjectsExporterreturns) - add dexterity behavior that allows to mark objects to be always/never exported
- thinking about privacy or mandatory objects
- on that control panel add a checkbox to use either the full or subset export
I'm not sure if there are enough users for such use cases, that's why we started with first allowing to customize the logic, and then we can expand further if there is a need for it
9df2778 to
69f3325
Compare
|
@davisagli thanks for the review, all points are either addressed or commented 😄 |
Description
This is part of plone/plone.exportimport#86
Where an easy way to customize the default content exporter is added.