Make possible to set a SaveHandler for a dialog.
------------------------------------------------

                 Key: BLOSSOM-14
                 URL: http://jira.magnolia-cms.com/browse/BLOSSOM-14
             Project: Magnolia Blossom Module
          Issue Type: New Feature
    Affects Versions: 1.1.1
            Reporter: Danilo Ghirardelli
            Assignee: Tobias Mattsson
         Attachments: saveHandler.patch

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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to