1 2 Previous Next 26 Replies Latest reply on Apr 13, 2010 10:20 AM by vadlamudijboss

    JBoss WSRP consumer and file uploads

    superfilin

      Hello, JBoss Community!

      We are developing a portlet on BEA WebLogic Portal that is supposed to be consumed later by JBoss Portal. This portlet is used for file data upload. The thing is that portlet contains a form that has enctype attribute set to multipart/form-data to enable file sending. When the form is submitted on the consumer (JBoss) no form parameters are passed to producer. Looking in the WSRP request sent to BEA Portal by JBoss only action name is seen. If enctype attribute is removed from the form then when form is submitted all parameters are sent to producer except file content.

      Is it JBoss WSRP implementation bug? Or is it possble to add some configuration settings on consumer part?

      Thanks in advance!

      Best regards,
      Andrey

        • 1. Re: JBoss WSRP consumer and file uploads
          superfilin

          Just some details:

          JBoss Portal: 2.6.0-CR2-bundled

          • 2. Re: JBoss WSRP consumer and file uploads
            claprun

            This is not yet supported. Please open a JIRA task for it, I'll try to implement it before we go GA with 2.6.

            • 3. Re: JBoss WSRP consumer and file uploads
              superfilin
              • 4. Re: JBoss WSRP consumer and file uploads
                superfilin

                Hello, Chris!

                And what about HTTP GET support? Currently the only way we can submit data from JBoss consumed portlet to a producer is using a from. Correctly encoded links with parameters do not work. What are the plans to support that?

                Best regards,
                Andrey

                • 5. Re: JBoss WSRP consumer and file uploads

                  JSR 168 disallow form GET support and currently JBoss Portal could not support it because we encode parameters in the URL.

                  Why do you need that feature ?

                  • 6. Re: JBoss WSRP consumer and file uploads
                    superfilin

                    Hello, Julien!

                    Why do you need that feature ?


                    The question is not about what method to use to submit the form. It is fine that all forms are using POST method. But sometimes it is needed to create a link to change portlet state instead of a form. I assume when you press the link then HTTP GET method is used, correct? This is basically a styling issue as I do not want to have form buttons everywhere where it should be a link (anchor).

                    As I see the following 2 ways should work equally:

                    <a href="/portal/portal/default/Test/SENDEMAIL/SENDEMAIL?
                    action=1d
                    &
                    windowstate=
                    &
                    mode=
                    &
                    ns=
                    &
                    is=_action=%2Fcom%2Fportal%2Ffront%2Fportlets%2FsendEmail%2FchangeStep
                    &
                    jbpns_2fdefault_2fTest_2fSENDEMAIL_2fSENDEMAILsnpbjstep=1">
                    ....</a>
                    


                    and

                    <form action="/portal/portal/default/Test/SENDEMAIL/SENDEMAIL?
                    action=1d
                    &
                    windowstate=
                    &
                    mode=
                    &
                    ns=
                    &
                    is=_action=%2Fcom%2Fportal%2Ffront%2Fportlets%2FsendEmail%2FreceiveTopic"
                    
                     method="POST">
                     ....
                    
                    <input type="hidden" name="jbpns_2fdefault_2fTest_2fSENDEMAIL_2fSENDEMAILsnpbjstep"
                    value="2" />
                    
                     ...
                    
                     <input type="submit">
                    </form>
                    

                    Am I missing something here? Is it possible to make the anchor above working? Currently when this kind of anchor is clicked on consumed portlet JBoss sends a message to the action specified but without "step" parameter.

                    Best regards,
                    Andrey

                    P.S. the form and link examples are taken from the markup shown on the consumer.

                    • 7. Re: JBoss WSRP consumer and file uploads
                      superfilin

                      Hello, Chris and Julien!

                      Can you comment on the previous post? Should the link actually work or is it not part of specification (WSRP or JSR168)?

                      We have tried to consume BEA Portlets by BEA WSRP consumer (with all BEA extentions disabled) and links like that work just fine. The same consumed portlet on JBoss does not send the parameters on the link to the producer when the link is pressed.

                      Best regards,
                      Andrey

                      • 8. Re: JBoss WSRP consumer and file uploads
                        claprun

                        How do you create the URLs?

                        • 9. Re: JBoss WSRP consumer and file uploads
                          superfilin

                          Hello, Chris!

                          Links are created using Apache Beehive NetUI tags on BEA producer part. The forms are created using the same tags. But it is not really important here.

                          When consumer calls WSRP getMarkup method, as far as I understand WSRP, the link is rewritten by BEA WSRP Producer using the URL template provided by JBoss WSRP consumer.

                          As far as I see the links are created in similar way as form parameters e.g. encoded using JBoss namespace prefix.

                          Best regards,
                          Andrey

                          • 10. Re: JBoss WSRP consumer and file uploads
                            claprun

                            Could you precise how the NetUI tags are integrated with the producer? More precisely, do they use PortletURL to generate the URLs?

                            As far as rewriting goes, there is no token for arbitrary parameters provided in the WSRP specification so I don't see how these parameters end up in the URL.

                            Could you provide the SOAP message exchange between BEA Producer and BEA Consumer in the case that you are interested in and doesn't work between JBoss Portal as a Consumer to BEA's producer so that I can see what's going on, please?

                            • 11. Re: JBoss WSRP consumer and file uploads
                              superfilin

                              Hello, Chris!

                              Give me some time. I'll prepare you the requests/responses.

                              Best regards,
                              Andrey

                              • 12. Re: JBoss WSRP consumer and file uploads
                                superfilin

                                BTW. NetUI tags are tightly integrated with BEA because it was originally their product, but then they opened the source and donated it to Apache. NetUI is always part of BEA Portal installation.

                                • 13. Re: JBoss WSRP consumer and file uploads
                                  superfilin

                                  Hello, Chris!

                                  I have sent to your e-mail zipped requests/responses as well as view of consumed portlet both on JBoss and BEA consumer. There is a very simple portlet that has one link with one parameter and one form with one field.

                                  I performed extacly the same actions on both consumers:

                                  1) Entered name "Andrey" in the field and pressed submit
                                  2) Clicked "Go to begin" link
                                  3) Clicked "Press to use default name" link that has a parameter encoded

                                  First 2 steps worked fine on both consumers, but the last step does not pass the parameter.

                                  Best regards,
                                  Andrey

                                  • 14. Re: JBoss WSRP consumer and file uploads
                                    claprun

                                    I'm not sure how current that is but according to this: http://issues.apache.org/jira/browse/BEEHIVE-979, it doesn't seem that Portlets are supported with NetUI. I don't know anything about NetUI so I'll try to figure things out but it might just be that there is a problem with using NetUI when writing JSR-168 compliant portlets.
                                    That said I will look at the SOAP messages and see if there's anything interesting going on.

                                    1 2 Previous Next