-
New Feature
-
Resolution: Fixed
-
Major
-
None
-
None
-
-
Yes
-
Empty show more show less
It would be nice to have the possibility to set a saveHandler class also for Blossom-instantiated paragraphs.
I didn't found a way to use a method of the controller as saveHandler, because the SaveHandler class seems to require a bit of initialization and settings, but maybe I just can't see an easy way to do it.
Instead, the attached patch adds the @SaveHandler(class) annotation to the Blossom ones, making possible to set the SaveHandler class for the paragraph/dialogFactory.
A few notes:
- I don't know if it's preferrable to have a new annotation or add a field in the existing ones. My preference would have been to add a field, but I thought you'd prefer the new annotation.
- I'm not sure that the saveHandler is strictly needed also in the ParagraphDescription, but I added it anyway.
- Setting the saveHandler in the dialog seems either buggy or incomprehensible to me: even forcing it in the dialog config (in the DefaultDialogCreator) would not have effect because configNode is null, so I had to override the getSaveHandler() method.
- Ovveride the getSaveHandler() as it is was really an ugly pacth. I opened
MAGNOLIA-3299because as it is now, the only way to set a saveHandler with fallback to the default be using reflections. - Patch works fine for me but honestly I didn't test it with all use cases.
Acceptance criteria
- is related to
-
MAGNOLIA-3299 Make "saveHandler" property properly overridable.
- Closed