Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
John Edward Platts
JSF 2.0 Portlet Bridge
August 7, 2009 8:15 PM
Answer

John Edward Platts

Rank: New Member

Posts: 3

Join Date: August 7, 2009

Recent Posts

I need a portlet bridge that can take advantage of the features in JSF 2.0. Is there already an implementation that will work with Mojarra 2.0 (the JSF 2.0 RI), or should I adapt the JSF 1.2 Portlet Bridge to work with Liferay and JSF 2.0?
Andreas L Blomqvist
RE: JSF 2.0 Portlet Bridge
August 14, 2009 7:13 AM
Answer

Andreas L Blomqvist

Rank: New Member

Posts: 7

Join Date: March 2, 2009

Recent Posts

Hi

Did you get this working? I also need to use JSF 2.0.

Thanks
/a
Grant King
RE: JSF 2.0 Portlet Bridge
January 27, 2010 12:46 AM
Answer

Grant King

Rank: New Member

Posts: 8

Join Date: January 27, 2010

Recent Posts

Hi,

Does anyone know of a project developing a JSF 2.0 portlet bridge?

Many thanks

Grant
atul patel
RE: JSF 2.0 Portlet Bridge
January 27, 2010 1:21 AM
Answer

atul patel

Rank: Regular Member

Posts: 192

Join Date: November 17, 2006

Recent Posts

Yes.

Its being developed under the portletFaces project.

Neil Griffin has been working on it over the last month or so. It should be ready for alpha next week.

I'm sorry there hasn't been much more awareness around it. Perhaps someone can help us get the word out that it is coming down the pipe.


--Atul


PS. Below is a portion of a recent status update:

I have a sample JSF 2.0 portlet developed that is using the new PortletFaces Bridge. Here's the status:

- HTTP GET of portal page: bridge runs the portlet RENDER_PHASE, which runs the JSF lifecycle+renderResponse and the portlet renders fine in the browser.

- HTTP POST after clicking h:commandButton: bridge runs the portlet ACTION_PHASE, which runs the JSF lifecycle. It then runs the portlet RENDER_PHASE, which runs the JSF renderResponse and the portlet renders fine in the browser.

- RESOURCES: When using the new JSF 2.0 "resource" mechanism (like for downloading the "jsf.js" JavaScript file), the bridge correctly invokes the portlet RESOURCE_PHASE, which invokes the JSF 2.0 ResourceHandler and the contents of the requested resource are correctly delivered back to the browser.

- AJAX: After tabbing-out of a field, the JSF 2.0 "jsf.js" JavaScript code correctly invokes the portlet RESOURCE_PHASE, which runs the JSF lifecycle+renderResponse, and correctly applies the DOM updates in the browser. Currently it uses the new JSF 2.0 <f:ajax /> tag to do Ajax requests. BTW I had to fix a problem in Mojarra to make this work -- I'm in contact with the Mojarra team and they're working on fixing it for the upcoming 2.0.3 release.

What's left: There's a bunch of little things -- loose ends that need to be coded up. Stuff like:
- Testing of ICEfaces 2.0 WITHOUT the <f:ajax /> tag
- Testing of ICEfaces 2.0 components (compatibility components I guess)
- Testing of ICEfaces 2.0 Ajax Push
- After navigation-rules fire, need to compute the next JSF viewId to render
- Detecting portlet mode changes (VIEW MODE, EDIT MODE, HELP MODE)
Grant King
RE: JSF 2.0 Portlet Bridge
January 27, 2010 5:43 AM
Answer

Grant King

Rank: New Member

Posts: 8

Join Date: January 27, 2010

Recent Posts

That's great news - thank you.
Neil Griffin
RE: JSF 2.0 Portlet Bridge
January 27, 2010 10:07 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2351

Join Date: July 26, 2005

Recent Posts

Thanks Atul -- here's the PortletFaces Bridge project announcement.
Grant King
RE: JSF 2.0 Portlet Bridge
March 18, 2010 9:02 AM
Answer

Grant King

Rank: New Member

Posts: 8

Join Date: January 27, 2010

Recent Posts

Hi,

I understand this is probably not the best place to be posting this - unfortunately there seems to be a problem when trying to log into http://www.portletfaces.org.

I have been working with the Alpha version of the JSF 2.0 portlet bridge written by Neil, it is working well - it's great to be able to use JSF 2's functionality within liferay.

I am having an issue when implementing a composite component using the <f:ajax tag. Please could someone help me. The problem is as follows.

I have two composite components - the first one references the second
 1
 2----------first component(name spaces removed for brevity)-------------------
 3
 4<ui:component xmlns="....">
 5    <cc:interface componentType="merced.DataTableComponent"/>
 6    <cc:implementation>
 7        <h:form id="listComponent">
 8            <h:panelGroup id="testPanel">
 9                #{testBacking.time}
10                                <-- NOTE that I have put a space in the render attribute for presentation within the forum -->
11                <f:ajax render=": #{cc.clientId}:listComponent:testPanel">
12                    <merced:demo />
13                </f:ajax>
14            </h:panelGroup>
15        </h:form>
16    </cc:implementation>
17</ui:component>
18
19----------second component-------------------
20
21<ui:component xmlns="....">
22    <cc:interface/>
23    <cc:implementation>
24        <h:commandLink value="test" id="item1" action="#{cc.parent.test}" />
25    </cc:implementation>
26</ui:component>

When running as a standard JSF 2.0 application I get the desired effect (the second composite component's action refreshing the parent components panel). However when running within liferay - no matter what I do to the render attribute within f:ajax I keep getting the error

15:08:51,230 ERROR [jsp:165] javax.faces.FacesException: <f:ajax> contains an unknown id ':658656510:j_idt6:listComponent:dataTable' - cannot locate it in the context of the component item1

Many thanks for any help you may be able to provide.
Grant King
RE: JSF 2.0 Portlet Bridge
March 18, 2010 9:29 AM
Answer

Grant King

Rank: New Member

Posts: 8

Join Date: January 27, 2010

Recent Posts

Having looked further into this - the generated cc.clientId is :658656510:j_idt6:listComponent:dataTable, if I remove the :658656510 - the ajax call works.
It seems that the component lookup is not catering for the portlet's id which is prefixed.

Is this a bug? Or should I be constructing the component id differently.

Thanks

Grant
Andy Z
RE: JSF 2.0 Portlet Bridge
April 5, 2010 3:27 AM
Answer

Andy Z

Rank: New Member

Posts: 3

Join Date: April 5, 2010

Recent Posts

Hello,

I faced a problem using JSF 2.0 portletfaces bridge (http://www.portletfaces.org/projects/portletfaces-bridge).
I am using GlassFish v3 (JSF 2.0) and Liferay Portal 5.2.3.
I've checked out the three SVN projects (api and impl and sample), created a
jsf-2.0-job-application-portlet.war and deployed it.
Deploy was successfull. Then I added it into portal layout and got the following error:


[#|2010-04-05T10:35:32.354+0300|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=31;_ThreadName=Thread-1;|10:35:32,354 ERROR [LiferayLocalePhaseListener:103]
java.lang.NullPointerException
at org.edorasframework.portletfaces.context.impl.PortletFacesContextImpl.getThemeDisplay(PortletFacesContextImpl.java:873)
at org.edorasframework.portletfaces.lifecycle.LiferayLocalePhaseListener.setLocale(LiferayLocalePhaseListener.java:87)
at org.edorasframework.portletfaces.lifecycle.LiferayLocalePhaseListener.afterPhase(LiferayLocalePhaseListener.java:70)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at org.portletfaces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:162)
at org.portletfaces.bridge.GenericFacesPortlet.doView(GenericFacesPortlet.java:194)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:126)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:100)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:618)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:700)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:419)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java from :1445)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:2923)
at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:2844)
at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:885)
at com.liferay.portal.action.RenderPortletAction.execute(RenderPortletAction.java:96)
at com.liferay.portal.action.UpdateLayoutAction.addPortlet(UpdateLayoutAction.java:260)
at com.liferay.portal.action.UpdateLayoutAction.execute(UpdateLayoutAction.java:211)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:157)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:608)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:142)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:140)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:193)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.threadlocalcache.ThreadLocalCacheFilter.processFilter(ThreadLocalCacheFilter.java:55)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org|#]



Can anybody help me?
Any help greatly appreciated.
Neil Griffin
RE: JSF 2.0 Portlet Bridge
April 8, 2010 11:54 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2351

Join Date: July 26, 2005

Recent Posts

Andy, thanks for reposting your message on the www.portletfaces.org forums. Just for the convenience of the rest of the folks here in the Liferay forums, I'm posting the link: http://www.portletfaces.org/community/forums/-/message_boards/message/42477
Neil Griffin
RE: JSF 2.0 Portlet Bridge
April 8, 2010 11:20 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2351

Join Date: July 26, 2005

Recent Posts

Hi Grant,

Now that the login problem is fixed at the www.portletfaces.org website, can you please create a forum entry there for this clientId problem?

Thanks -- Neil
Grant King
RE: JSF 2.0 Portlet Bridge
April 19, 2010 4:04 PM
Answer

Grant King

Rank: New Member

Posts: 8

Join Date: January 27, 2010

Recent Posts

Hi Neil,

Thanks for sorting out the protlet faces forum issues. I have transfered the cc.clientId thread here

Grant