Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-14

Make possible to set a SaveHandler for a dialog.

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 1.2
    • None
    • None
    • Yes

    Description

      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-3299 because 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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                tmattsson Tobias Mattsson
                dfghi Danilo Ghirardelli
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: