XForms Portlet in Liferay Root.war causes "Orbeon Forms - Page Not Found"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XForms Portlet in Liferay Root.war causes "Orbeon Forms - Page Not Found"

Karolin Heiss
Hello,

This may be off interest for you if you use Orbeon and Liferay 6 with separate deployment.

 I get "Orbeon Forms - Page Not Found" if XForms port lets are directly in Liferay Root.war.
 I debugged Liferay to found out why XForms doesn't get translated properly. A see different behaviour in
 com.liferay.portlet.InvokerPortletImpl.invoke:

Orbeon portlet in Root.war
_portletConfigImpl.isWARFile() is false so requestDispatcher.include(request, response) in line 625 gets called.

=> OrbeonXFormsFilter gets called with
  request = com.liferay.portlet.PortletServletRequest
  response = com.liferay.portlet.PortletServletResponse

Orbeon portlet in Test.war
_portletConfigImpl.isWARFile() is true so PortletFilterUtil.doFilter(portletRequest, portletResponse, lifecycle, filterChain) in line 639 gets called.

=> OrbeonXFormsFilter gets called with
  request = com.liferay.portal.servlet.NamespaceServletRequest
  response = com.liferay.portal.kernel.servlet.StringServletResponse

I overrode OrbeonXFormsFilter and make a fix for Liferay:


public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

  final HttpServletRequest httpRequest;
  final HttpServletResponse httpResponse;

  if (servletRequest instanceof com.liferay.portlet.PortletServletRequest){
    httpRequest = (HttpServletRequest)  ((com.liferay.portlet.PortletServletRequest)servletRequest).getRequest();
    httpResponse = (HttpServletResponse)  ((com.liferay.portlet.PortletServletResponse)servletResponse).getResponse();
  }   else{
    httpRequest = (HttpServletRequest) servletRequest;
    httpResponse = (HttpServletResponse) servletResponse;
  }


For me it works fine now.

Karolin
Reply | Threaded
Open this post in threaded view
|

Re: XForms Portlet in Liferay Root.war causes "Orbeon Forms - Page Not Found"

Erik Bruchez
Administrator
Hi Karolin,

Great, and thanks for sharing.

The only problem I see is that this requires a Liferay JAR to compile
and run OrbeonXFormsFilter.

Could you confirm this?

Also, did you figure what is the difference between what's returned by
the Liferay PortletServletRequest and what's returned by the request
object returned by PortletServletRequest.getRequest()?

Thanks,

-Erik

On Thu, May 27, 2010 at 8:19 AM, Karolin Krieg <[hidden email]> wrote:

>
> Hello,
>
> This may be off interest for you if you use Orbeon and Liferay 6 with
> separate deployment.
>
>  I get "Orbeon Forms - Page Not Found" if XForms port lets are directly in
> Liferay Root.war.
>  I debugged Liferay to found out why XForms doesn't get translated properly.
> A see different behaviour in
>  com.liferay.portlet.InvokerPortletImpl.invoke:
>
> Orbeon portlet in Root.war
> _portletConfigImpl.isWARFile() is false so
> requestDispatcher.include(request, response) in line 625 gets called.
>
> => OrbeonXFormsFilter gets called with
>  request = com.liferay.portlet.PortletServletRequest
>  response = com.liferay.portlet.PortletServletResponse
>
> Orbeon portlet in Test.war
> _portletConfigImpl.isWARFile() is true so
> PortletFilterUtil.doFilter(portletRequest, portletResponse, lifecycle,
> filterChain) in line 639 gets called.
>
> => OrbeonXFormsFilter gets called with
>  request = com.liferay.portal.servlet.NamespaceServletRequest
>  response = com.liferay.portal.kernel.servlet.StringServletResponse
>
> I overrode OrbeonXFormsFilter and make a fix for Liferay:
>
>
> public void doFilter(ServletRequest servletRequest, ServletResponse
> servletResponse, FilterChain filterChain) throws IOException,
> ServletException {
>
>  final HttpServletRequest httpRequest;
>  final HttpServletResponse httpResponse;
>
>  if (servletRequest instanceof com.liferay.portlet.PortletServletRequest){
>    httpRequest = (HttpServletRequest)
> ((com.liferay.portlet.PortletServletRequest)servletRequest).getRequest();
>    httpResponse = (HttpServletResponse)
> ((com.liferay.portlet.PortletServletResponse)servletResponse).getResponse();
>  }   else{
>    httpRequest = (HttpServletRequest) servletRequest;
>    httpResponse = (HttpServletResponse) servletResponse;
>  }
>
>
> For me it works fine now.
>
> Karolin
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/XForms-Portlet-in-Liferay-Root-war-causes-Orbeon-Forms-Page-Not-Found-tp2233312p2233312.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XForms Portlet in Liferay Root.war causes "Orbeon Forms - Page Not Found"

Karolin Heiss
Hey Eric

I made my own OrbeonXFormsFilter anyway and didn't change the Orbeon code directly.

<filter>
  <filter-name>orbeon-xforms-filter</filter-name>               
  <filter-class>ch.abacus.flow.web.servlet.OrbeonXFormsFilter</filter-class>
 
  <init-param>
    <param-name>oxf.xforms.renderer.context</param-name>
    <param-value>/orbeon</param-value>
  </init-param>
</filter>

In case of PortletServletRequest.getRequest()  I have to come back to you, because my old WebApplication is not running any more at the moment.

I have my Orbeon XForms portlets now in an other separate jar not in ROOT.war any more.
When everything else workes fine I try again to include the portlets in ROOT.war again and let you know.

Karolin
Reply | Threaded
Open this post in threaded view
|

Re: Re: XForms Portlet in Liferay Root.war causes "Orbeon Forms - Page Not Found"

Erik Bruchez
Administrator
Karolin,

Thanks. To be clearer, I am wondering what's the difference in values
returned by PortletServletRequest and
PortletServletRequest.getRequest(). Maybe some path is different, etc.
But if we knew, maybe the specific check for Liferay could be avoided
in the future!

-Erik

On Wed, Jun 2, 2010 at 8:47 AM, Karolin Krieg <[hidden email]> wrote:

>
> Hey Eric
>
> I made my own OrbeonXFormsFilter anyway and didn't change the Orbeon code
> directly.
>
> <filter>
>  <filter-name>orbeon-xforms-filter</filter-name>
>  <filter-class>ch.abacus.flow.web.servlet.OrbeonXFormsFilter</filter-class>
>
> <!--filter-class>org.orbeon.oxf.servlet.OrbeonXFormsFilter</filter-class-->
>  <init-param>
>    <param-name>oxf.xforms.renderer.context</param-name>
>    <param-value>/orbeon</param-value>
>  </init-param>
> </filter>
>
> In case of PortletServletRequest.getRequest()  I have to come back to you,
> because my old WebApplication is not running any more at the moment.
>
> I have my Orbeon XForms portlets now in an other separate jar not in
> ROOT.war any more.
> When everything else workes fine I try again to include the portlets in
> ROOT.war again and let you know.
>
> Karolin
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/XForms-Portlet-in-Liferay-Root-war-causes-Orbeon-Forms-Page-Not-Found-tp2233312p2240370.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws