>>>>> On Fri, 9 Nov 2012 14:11:32 -0800, Edward Burns <edward.burns_at_oracle.com> said:
EB> CONDITIONALLY_RESOLVED: Modify 7.7.2.1 createView() to require calling
EB> VDL.calculateResourceLibraryContracts() so that the read-only
EB> resourceLibraryContracts property is correctly set when the UIViewRoot is
EB> returned from that method. As I said above, the impl of
EB> calculateResourceLibraryContracts() is in another email. How you set the
EB> property on UIViewRoot before returning it from createView() is an
EB> implementation detail.
LU> If calculateResourceLibraryContracts(FacesContext) is defined in
LU> ViewHandler, there is no reason to prevent resourceLibraryContracts
LU> to be defined using f:view tag, but if it is not, we can allow it
LU> later if the need arises. Please note if it is not set using f:view,
LU> it is not possible to use EL to define it, which in my opinion it is
LU> very straighforward, given than locale can be set in this way too.
The big problem with putting it on <f:view>: there is no enforcing that
<f:view> resides in the outer-most XML file in the Facelet inclusion.
This is the core reason why we need an external config concept.
Leo, how do you suggest we calculateResourceLibraryContracts() works
without having a viewId? We need the viewId to determine which
contracts apply, based on the <resource-library-contracts><mappings>.
However, I do see the value in allowing <f:view contracts="foo,bar">,
not least that you can drop the whole
<resource-library-contracts><mappings> business in that case. But it
only works if you have the <f:view> in the outer-most XML file of the
Facelet inclusion. To accomodate this use case, I'm going to change the
resolution to allow the resourceLibraryContracts property to be "mostly"
read-only. There will still only be a getter on the property, but the
the property can be set, in an implementation private manner, only in
VDL.createView() and the tag handler for <f:view>.
A question arises: if you have <resource-library-contracts><mappings>
*and* <f:view contracts=""> who wins in the case of duplicates? Answer:
<f:view contracts="foo,bar"> unconditionally overwrites whatever value
was set by createView().
Ed
--
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage: | http://ridingthecrest.com/