Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
2.1.5
-
None
Description
If you use selections in magnolia dialogs, the options must be static defined in the dialog properties. Though this is straight forward, it has serious limitations:
- when using the same options in multiple dialogs, you must copy and paste, and if one option changes, you have to start over
- you cant provide "dynamic" options, for instance:
o select a user from the repository
o select a page with a specific template below a certain content tree
o retrieve options from elsewhere (filesystem, jdbc, ...)
I could not solve this without changing magnolia. If someone knows a better way, please tell me. Otherwise i would suggest to build my (or a similiar solution) into the product. The source is attached to this page and in the wiki.
The solution works like this:
- if a "options" contentnode in a select field is found, its static options will be used
- if "options" contentnode is missing, it will look for a nodedata called "optionClass"
- if this nodedata is found, it will instantiate this class
- this class must implement the interface OptionHook and provides a single method "getOptions(...)"
Using this pattern, you are fully backward compatible to existing dialog definitions, with the ability to create dynamic options.
The code is ready and can be found ready here:
http://www.magnolia.info/wiki/Wiki.jsp?page=DynamicOptions
If there are some supporters for this issue, i would like to see it integrated into the magnolia source tree.