As a refresher, we have introduced a special facet in JSF 2 called the
metadata facet. This facet is built during an initial request, prior to when
the remainder of the view is created and built. So far the only officially
recognized child components are UIViewParameters, which map HTTP request
parameters onto model values and export these values back to bookmarkable
and redirect URLs.
My expectation is that frameworks creators are going to want to make use of
the metadata facet to host other components oriented towards the initial
request. For instance, in Seam we want to prototype view actions for JSF 2.1
and also define security restrictions on the page. Currently, however, the
ViewMetadata only offers a single method for access the contents of the
metadata facet:
Collection<UIViewParameter> ViewMetadata#getViewParameters(UIViewRoot)
This method simply advances to the metadata facet and iterates its children
looking for UIViewParameter components.
I'm concerned that the ViewMetadata does not offer a convenience method for
accessing general contents of the metadata facet. I have two proposed
methods, one of which I think we definitely need to provide.
Collection<UIComponent> ViewMetadata#getChildComponents(UIViewRoot)
Collection<UIComponent> ViewMetadata#getChildComponents(UIViewRoot, Class<?
extends UIComponent>[]);
Feel free to suggest alternate signatures. As it is now, I can see everyone
wanting to extend this feature as needing to provide a utility method to
extract the contents.
I also think the term "view parameter" should be removed from the JavaDoc
"ViewMetadata is reponsible for extracting and providing view
parametermetadata from VDL views" to make it clear that any metadata
can be
supported. Perhaps just cite that the only recognized metadata are view
parameters.
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.