Problem with File attachment and Orbeon Proxy portlet in liferay

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

Problem with File attachment and Orbeon Proxy portlet in liferay

inanda.menezes
Hi,

I've been facing a problem when clicking the download button after attach a file in a form created by form builder.
Note: It happens only if I use Orbeon Proxy portlet in liferay.

Orbeon Version: orbeon-3.9.0.201105152053-PE
Liferay Version: 6.0.5

Steps to reproduce it:
1 - Deploy Orbeon proxy portlet to Liferay 6.0.5.
2 - Deploy orbeon to another tomcat.
3 - Create a form that has a file attachment component in form builder.
4 - Add Form Runner portlet to a liferay page and configure it to show the form that you have created in Form Builder.
5 - Attach one file to the form.
6 - Close the form.
7 - Open the same form data again to edit it, and click the download button to download the file that you have attached.

Expected: Dialog to download the file (It works fine if I call from "stand-alone" form runner, but using proxy portlet it does not.)
Result: It throws a exception and the Form Runner portlet shows the message "Form Runner is temporarily unavailable."

It shows the following exception in liferay log:
16:15:22,413 ERROR [jsp:154] javax.portlet.PortletException: Unsupported path: /xforms-server/dynamic/6b63618a8a2ed2861cc95b16fb2c66fa
        at org.orbeon.oxf.portlet.OrbeonProxyPortlet.doView(OrbeonProxyPortlet.scala:69)
        at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:638)
        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:723)
        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:425)
        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1440)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)



Reply | Threaded
Open this post in threaded view
|

Re: Problem with File attachment and Orbeon Proxy portlet in liferay

Erik Bruchez
Administrator
Hi,

Unfortunately that might be a limitation of the proxy portlet as of
Orbeon Forms 3.9. There has been more work on it since then, but that
is only available in nightly builds at the moment.

-Erik

On Thu, Dec 8, 2011 at 7:54 AM, inanda.menezes <[hidden email]> wrote:

> Hi,
>
> I've been facing a problem when clicking the download button after attach a
> file in a form created by form builder.
> Note: It happens only if I use Orbeon Proxy portlet in liferay.
>
> Orbeon Version: orbeon-3.9.0.201105152053-PE
> Liferay Version: 6.0.5
>
> Steps to reproduce it:
> 1 - Deploy Orbeon proxy portlet to Liferay 6.0.5.
> 2 - Deploy orbeon to another tomcat.
> 3 - Create a form that has a file attachment component in form builder.
> 4 - Add Form Runner portlet to a liferay page and configure it to show the
> form that you have created in Form Builder.
> 5 - Attach one file to the form.
> 6 - Close the form.
> 7 - Open the same form data again to edit it, and click the download button
> to download the file that you have attached.
>
> Expected: Dialog to download the file (It works fine if I call from
> "stand-alone" form runner, but using proxy portlet it does not.)
> Result: It throws a exception and the Form Runner portlet shows the message
> "Form Runner is temporarily unavailable."
>
> It shows the following exception in liferay log:
> 16:15:22,413 ERROR [jsp:154] javax.portlet.PortletException: Unsupported
> path: /xforms-server/dynamic/6b63618a8a2ed2861cc95b16fb2c66fa
>        at
> org.orbeon.oxf.portlet.OrbeonProxyPortlet.doView(OrbeonProxyPortlet.scala:69)
>        at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
>        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
>        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
>        at
> com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
>        at
> com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
>        at
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
>        at
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
>        at
> com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:638)
>        at
> com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:723)
>        at
> com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:425)
>        at
> org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1440)
>        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>        at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
>        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>
>
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-File-attachment-and-Orbeon-Proxy-portlet-in-liferay-tp4173173p4173173.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: Problem with File attachment and Orbeon Proxy portlet in liferay

inanda.menezes
This post was updated on .
Hi Erik,

I've checked also the nightly build. And I got the same problem. It has this same bug.

After save the attachment, save the form, open the form and try to download the file, the proxy portlet calls a wrong URL.
I was looking into OrbeonProxyPortlet.scala and it has a pattern for "orbeon.path". It expects the form metadata information or null (in this case, it gets metadata from portlet preferences) and the orbeon proxy portlet sends:
"orbeon.path=%2Fxforms-server%2Fdynamic%2F99876a1ea522cc7bb3675b5b99c74909"

 It calls the following URL:
1)http://localhost:8080/web/guest/test?p_p_id=orbeonformsproxyportlet_WAR_orbeonPEproxyportlet_INSTANCE_w0KL&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_orbeonformsproxyportlet_WAR_orbeonPEproxyportlet_INSTANCE_w0KL_orbeon.path=%2Fxforms-server%2Fdynamic%2F99876a1ea522cc7bb3675b5b99c74909

That's why I'm getting this exception. And it happens only after close the form and open it again.

The correct URL to download the file would be, for example:
2)http://localhost:8080/web/guest/test?p_p_id=orbeonformsproxyportlet_WAR_orbeonPEproxyportlet_INSTANCE_w0KL&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=%2Fxforms-server%2Fdynamic%2F99876a1ea522cc7bb3675b5b99c74909&p_p_cacheability=cacheLevelPage&_orbeonformsproxyportlet_WAR_orbeonPEproxyportlet_INSTANCE_w0KL_orbeon.path=%2Ffr%2Ftest%2Ftest%2Fedit



Note: If we attach the file and try to download it without close and open the form again, it would use the correct URL.




Reply | Threaded
Open this post in threaded view
|

Re: Problem with File attachment and Orbeon Proxy portlet in liferay

inanda.menezes
When is this download link URL generated?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with File attachment and Orbeon Proxy portlet in liferay

WillemV
Hi Inanda,

Did you ever find a solution for this problem? We are facing the exact same situation and would be very interested in a workaround or a fix.

Thanks,
Willem
The Netherlands
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

Erik Bruchez
Administrator
It looks like a bug, and we need to look at it:

https://github.com/orbeon/orbeon-forms/issues/559

-Erik

On Tue, Nov 6, 2012 at 2:02 AM, WillemV <[hidden email]> wrote:

> Hi Inanda,
>
> Did you ever find a solution for this problem? We are facing the exact same
> situation and would be very interested in a workaround or a fix.
>
> Thanks,
> Willem
> The Netherlands
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-File-attachment-and-Orbeon-Proxy-portlet-in-liferay-tp4173173p4655969.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: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

WillemV
Thanks Erik, it would be great if someone could take a look at it.

In the meantime we have written a javascript workaround which is almost too ugly to post here.

Needlees to say we'd much prefer a structural solution somewhere inside the orbeon form proxy portlet.

Regards,
Willem

=== in main.js of a portlet on the same page as the orbeon form proxy portlet ===

// work around the following bug in the orbeon proxy portlet: after uploading a document on an
// Orbeon form it can't be downloaded again
$(function() {
        jQuery("div.fr-attachment a").attr('href', function(index, old) {
                return repairResource(this.href);
        });
       
        function repairResource(href) {
                var parts = href.split("&");
                var newhref = parts[0];
                for (var i = 1; i < parts.length; i++) {
                        var p = parts[i];
                        if (p.indexOf('p_p_lifecycle') == 0) {
                                newhref += '&p_p_lifecycle=2';
                        } else if (p.indexOf('p_p_col_id') == 0) {
                        } else if (p.indexOf('p_p_col_pos') == 0) {
                        } else if (p.indexOf('p_p_col_count') == 0) {
                        } else if (p.indexOf('_orbeonformsproxyportlet_WAR_orbeonproxyportlet') == 0) {
                                newhref += '&p_p_resource_id=';
                                newhref += p.substring(p.indexOf('orbeon.path=') + 'orbeon.path='.length);
                        } else {
                                newhref += '&' + p;
                        }
                }
                return newhref;
        }
});
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

inanda.menezes
Hi WillemV,

I did not look much into the solution for it.
I just hide this link using CSS temporarily, but we have to find a solution at some time.
For sure it would be good to have it solved.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

Erik Bruchez
Administrator
This issue is now fixed.

-Erik

On Thu, Nov 8, 2012 at 10:08 AM, inanda.menezes <[hidden email]> wrote:

> Hi WillemV,
>
> I did not look much into the solution for it.
> I just hide this link using CSS temporarily, but we have to find a solution
> at some time.
> For sure it would be good to have it solved.
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-File-attachment-and-Orbeon-Proxy-portlet-in-liferay-tp4173173p4655977.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: Re: Re: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

WillemV
That's great news Erik, thanks. I guess we need to download the nightly build to test it's working?
Thanks,
Willem

On Wed, Dec 19, 2012 at 12:13 AM, Erik Bruchez <[hidden email]> wrote:
This issue is now fixed.

-Erik

On Thu, Nov 8, 2012 at 10:08 AM, inanda.menezes <[hidden email]> wrote:
> Hi WillemV,
>
> I did not look much into the solution for it.
> I just hide this link using CSS temporarily, but we have to find a solution
> at some time.
> For sure it would be good to have it solved.
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-File-attachment-and-Orbeon-Proxy-portlet-in-liferay-tp4173173p4655977.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




--
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: Re: Re: Re: Re: Problem with File attachment and Orbeon Proxy portlet in liferay

Erik Bruchez
Administrator
Willem,

Yes you can use a nightly or wait for the next milestone/RC build.

-Erik

On Thu, Dec 20, 2012 at 4:13 AM, Willem Vermeer
<[hidden email]> wrote:

> That's great news Erik, thanks. I guess we need to download the nightly
> build to test it's working?
> Thanks,
> Willem
>
>
> On Wed, Dec 19, 2012 at 12:13 AM, Erik Bruchez <[hidden email]> wrote:
>>
>> This issue is now fixed.
>>
>> -Erik
>>
>> On Thu, Nov 8, 2012 at 10:08 AM, inanda.menezes <[hidden email]>
>> wrote:
>> > Hi WillemV,
>> >
>> > I did not look much into the solution for it.
>> > I just hide this link using CSS temporarily, but we have to find a
>> > solution
>> > at some time.
>> > For sure it would be good to have it solved.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-File-attachment-and-Orbeon-Proxy-portlet-in-liferay-tp4173173p4655977.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
>>
>
>
>
> --
> 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