Hello,
This is about selecting a Form- and BindingManager in Woody.
I want to use my own CustomFormManager instead of
"org.apache.cocoon.woody.DefaultFormManager".
And I want to use my own CustomBindingManager.
So I need the Avalon selector mechanism in the Woody framework for selecting
a formmanager and a bindingmanager.
In case somebody asks why I need this: I implemented a template/subform
framework. I 'll post about this later.
These are the required changes for making the selector work (these are
changes to be made by the Woody developers, not by the end-users. This is
transparent for end-users):
1) in woody2.js you have to get your formmanager with one line of additional
code:
var selector =
cocoon.getComponent(Packages.org.apache.cocoon.woody.FormManager.ROLE+"Selec
tor");
var formManager = selector.select("default");
2) Almost the same applies for the createBinding function.
3) In the actions you have to make the same changes as in the flow script.
4) In woody.*.xroles you have to define a "default" hint
5) In woody.*.xconf you must define the widgets for this hint.
I made these changes to -HEAD and tested the Woody samples. Everything seems
to be working as before.
I created a patch. If the Woody committers think this is something that can
make it to HEAD, I will submit it to Bugzilla.
If there are better/easier solutions for switching between different
FormManagers, please let me know.
Hugo Burm