users@glassfish.java.net

Re: JSF 2 pages spread over multiple OSGi bundles

From: Robert Anderson <ranomail_at_gmail.com>
Date: Wed, 3 Aug 2011 12:39:35 -0300

Hi Jason and Sahoo,

Thank you very much for the answers and suggestions. I'll make some
experiments with bundles, fragments and JSF 2.

"It's not completely dynamic, as the fragment attachment requires the host
bundle to be re-resolved, so you have to somehow update (Bundle.update) the
WAB after installing new fragments in the system."

Exactly! For this reason I'm trying to resolve this without bundles
fragments. It's being a big challenge to me. :)

"I will add this to my TODO list to experiment."

I'm anxious to see the result!

Thanks.

Best regards,

Robert

On Wed, Aug 3, 2011 at 12:26 PM, Sahoo <sanjeeb.sahoo_at_oracle.com> wrote:

> Hi Robert,
>
> Use WAB fragments as described in section #4.5 of [1]. You can package
> additional JSF pages, static pages and classes in bundle fragments and
> attach them to the host WAB. The fragment contents will be made available as
> if they are part of the same WAB. The host WAB file is not modified any way.
> It's not completely dynamic, as the fragment attachment requires the host
> bundle to be re-resolved, so you have to somehow update (Bundle.update) the
> WAB after installing new fragments in the system. If you are using
> FileInstall, you can touch the WAB file to get the effect.
>
> I was not aware of the specific extensibility capability of JSF that Jason
> has nicely explained in his blog, so obviously I have never experimented the
> same. A quick look at it tells me one should be able to use it to provide
> additional JSF content served by a WAB. I will add this to my TODO list to
> experiment. Thanks, Jason.
>
> Thanks,
> Sahoo
>
> [1] http://glassfish.java.net/**public/GF-OSGi-Features.pdf<http://glassfish.java.net/public/GF-OSGi-Features.pdf>
>
>
> On Wednesday 03 August 2011 08:25 PM, Jason Lee wrote:
>
>> perhaps my blog entry on that can help get you started:
>> http://blogs.steeplesoft.com/**2010/05/putting-facelets-in-a-**jar/<http://blogs.steeplesoft.com/2010/05/putting-facelets-in-a-jar/>
>>
>> It doesn't cover OSGI specifically, so you're still left with making sure
>> your bundles are started, but that blog should help solve the JSF side.
>>
>> On 8/3/11 7:00 AM, ranomail_at_gmail.com wrote:
>>
>>> Hi,
>>>
>>> I'm researching about WAB and I've found this amazing screencast:
>>> http://blogs.oracle.com/**arungupta/entry/screencast_32_**
>>> osgi_enabled_java<http://blogs.oracle.com/arungupta/entry/screencast_32_osgi_enabled_java>
>>> .
>>>
>>> Is there a way to spread UI pages/components over multiple OSGi
>>> bundles? For instance:
>>>
>>> --- mainapp.war
>>> ------page1.xhtml
>>> .... (other resources, libs)
>>>
>>> ---module1.jar
>>> ------page_module1.xhtml
>>> .... (other resources, libs)
>>>
>>> How can I access UI resources in module1 from the context of mainapp?
>>>
>>> http://localhost:8080/mainapp/**page1.jsf<http://localhost:8080/mainapp/page1.jsf>(OK)
>>> http://localhost:8080/mainapp/**page_module1.xhtml<http://localhost:8080/mainapp/page_module1.xhtml>(???)
>>>
>>>
>>> I wanna to be able install/update/remove "JSF 2 UI modules" in runtime
>>> using OSGi for that.
>>>
>>> Thanks in advance,
>>>
>>> Robert
>>>
>>
>>
>>
>