Facet install delegate child facet mechanism [message #203172] |
Fri, 26 October 2007 14:46  |
Eclipse User |
|
|
|
Is there a way for a facet install delegate to further delegate install
functionality (either directly by getting a list of dependent facets that
are being installed or indirectly by some declarative mechanism) to
dependent facets that are also being installed?
For example, in JSF we want to configure a web.xml context param on facet
install. If only the JSF facet is being installed, then the JSF install
delegate will set it directly. However, if the user is also installing
facets that are directly dependent on the JSF facet, we would like the
option of delegating the setting of this context param to that dependent
facet (probably we the JSF delegate would still do the model change, but
would ask the dependent facet if it had a preferred value).
We could hand-roll this behaviour ourselves if we could get a list of
dependent facets that are being installed when
JSFFacetInstallDelegate.execute() is called, but I can't see a way to do
this.
--Cam
|
|
|
|
Re: Facet install delegate child facet mechanism [message #203244 is a reply to message #203188] |
Sat, 27 October 2007 16:01   |
Eclipse User |
|
|
|
Thanks Konstantin, that makes sense. From a UI perspective though there
is a case where it still may be convenient. An example is the
servlet-mappings. The JSF facet installation UI collects servlet-mapping
url patterns from the user to initialize the web.xml for the Faces
servlet. But if we have a dependent facet that we know will override
these with separate UI in the next page of the new project wizard, this is
confusing to the user. Ideally, if we know a piece of install data will
be overridden, we would hide the UI.
Perhaps there is room for mechanism in the installation data model that
allows facets to say "I will be setting property
'org.eclipse.jst.jsf.SERVLET_MAPPINGS'" which be constructed in such a way
that overrides could be detected and a parent facet could ask "if not
'o.e.j.jsf.S' overridden, then show my UI".
Since the overriden data is overriden hierarchically (dependent facets
override parents in a tree structure), the "install A and B, B->A" case
would still behave the same as "install A and some time later B, B->A".
--Cam
Konstantin Komissarchik wrote:
> I would recommend making the web.xml change that makes sense for the
> JSF-only case in the JSF install delegate. A facet that depends on JSF
> would then override the change in it's own install delegate. This might
> seem less-than-optimal, but this way it is much easier to make sure that
> the right thing happens in all cases. For instance, the "facets A and B
> installed at the same time" case should ideally behave identically to
> the "facet A is installed first, then facet B is installed some time
> later". This approach also makes it easier to figure out what should
> happen on uninstall.
> Hope this helps.
> - Konstantin
|
|
|
Re: Facet install delegate child facet mechanism [message #203259 is a reply to message #203244] |
Sat, 27 October 2007 19:29  |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
If you are only trying to get a solution to optimize the UI, you can
achieve that with the current API. Basically, add a property to JSF
facet's action config that controls whether a particular option should
still be available. The dependent facet (rather than JSF facet) can look
through the wizard context to see if the JSF facet install action is
present. If it is, it can set this property which would disable/hide the
UI on the JSF facet's page.
Does this help?
- Konstantin
|
|
|
Powered by
FUDForum. Page generated in 0.03026 seconds