Topic
17 replies Latest Post - ‏2014-05-28T14:04:25Z by mburati
XWHK_Joe_DeLutis
XWHK_Joe_DeLutis
78 Posts
ACCEPTED ANSWER

Pinned topic Receiving URL Parameters from External sites

‏2013-09-30T00:51:43Z |

I have a WEF Application that needs to receive parameters from an external url.  Can anyone lead me to any examples or documentation on how a WEF application can be invoked via a non-portal site/URL and receive parameters?

  • mburati
    mburati
    2466 Posts
    ACCEPTED ANSWER

    Re: Receiving URL Parameters from External sites

    ‏2013-09-30T14:33:59Z  in response to XWHK_Joe_DeLutis

    Kevin appears to have answered this question in earlier threads in this forum, referring to a developerWorks article by a portal architect on how to create portal URLs targetting portlets with params:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014621357&ps=25

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014446112&ps=25

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    • This reply was deleted by XWHK_Joe_DeLutis 2013-10-01T13:40:10Z. Reason for deletion: want to explain my issue in more detail
    • XWHK_Joe_DeLutis
      XWHK_Joe_DeLutis
      78 Posts
      ACCEPTED ANSWER

      Re: Receiving URL Parameters from External sites

      ‏2013-10-01T13:50:13Z  in response to mburati

      I'm having a real hard time following the documentation. I understand that when the URL is http://server:port/wps/poc?uri=deeplink: linkname that the XML configuration "associates" predefined (known values)  link values to pages.  It then appears to me that if you want to pass a value into your page to read a database and show results you must hard code that value in the XML configuration.  That will not work for what I need to do. I need to be able to receive a "dynamic" key value from the URL and use it to read a database table and display a result set. 

      I don't see this capability in the example provided in your response.

  • jbooth
    jbooth
    76 Posts
    ACCEPTED ANSWER

    Re: Receiving URL Parameters from External sites

    ‏2013-10-01T14:44:06Z  in response to XWHK_Joe_DeLutis

    Hi,

    This sample shows the use of a "POC Resolver" to get URL parameters from an external site into a WEF portlet:

    http://www-10.lotus.com/ldd/pfwiki.nsf/dx/Receiving_a_URL_parameter_from_an_external_application

    Hope that helps,

    Jonathan

    • XWHK_Joe_DeLutis
      XWHK_Joe_DeLutis
      78 Posts
      ACCEPTED ANSWER

      Re: Receiving URL Parameters from External sites

      ‏2013-10-08T15:37:45Z  in response to jbooth

      We downloaded the zip file and installed but cannot make the solution work. The one thing that we are wondering about is that you state "The plugin.xml file contains one entry for the sample resolver. The "id" attribute value matches the resolver ID specified in portlet.xml. The "class" attribute value is the name of the sample resolver class."  Where do you specify the resolver ID in the portlet.xml? 

      Is there xml code we need to add to do this? If you need me to send our portlet.xml file I can.

      Right now we are able to get to the page but the passed parameter never appears to make it.

      • jbooth
        jbooth
        76 Posts
        ACCEPTED ANSWER

        Re: Receiving URL Parameters from External sites

        ‏2013-10-08T16:17:59Z  in response to XWHK_Joe_DeLutis

        Hi,

        Regarding the portlet.xml file, this file is generated by WEF when you publish a project or export a portlet WAR.   The resolver ID piece comes from the portlet_base.standard286 file.   After publishing your project (or exporting portlet WAR), you should see entries like this in your portlet.xml:

            <init-param>
              <name>com.ibm.portal.resolver.ResolutionService</name>
              <value>com.ibm.portal.resolver.portlet.RenderEventListener</value>
            </init-param>
            <init-param>
              <name>com.ibm.portal.resolver.portlet.RenderEventListener</name>
              <value>sample.poc.resolver.id</value>
            </init-param>

        The portlet_base.standard286 file with those entries should be in your WEB-INF/bin/deployment folder from the sample archive.   The sample archive should be imported into your project using the Import / Web Experience Factory Archive command.  If you can check these things out and post what you find we can take it from there.   Also, could you mention what WEF version and Portal version you're using in case that's significant.

        I realized there's also a sample builder someone has posted that implements a solution to this.  I haven't downloaded the other sample but it's linked from here: https://www.ibm.com/developerworks/community/blogs/b75d3ff5-8534-43ff-8eb0-8e33fc67f50e/entry/using_the_direct_portal_link_builder6?lang=en

         

        • XWHK_Joe_DeLutis
          XWHK_Joe_DeLutis
          78 Posts
          ACCEPTED ANSWER

          Re: Receiving URL Parameters from External sites

          ‏2013-10-08T17:39:13Z  in response to jbooth

          We needed to add those 2 parameters in (the ones you referenced in your reply). We redployed and received the following error:

          Error 503: EJCBD0006E: The resolution of a URI failed. Refer to the SystemOut.log for more detailed information.

          We cannot find testscheme anywhere.  Seems that is our problem now.

          • XWHK_Joe_DeLutis
            XWHK_Joe_DeLutis
            78 Posts
            ACCEPTED ANSWER

            Re: Receiving URL Parameters from External sites

            ‏2013-10-08T17:51:25Z  in response to XWHK_Joe_DeLutis

            ALso...we are on Portal 7.0

            • XWHK_Joe_DeLutis
              XWHK_Joe_DeLutis
              78 Posts
              ACCEPTED ANSWER

              Re: Receiving URL Parameters from External sites

              ‏2013-10-08T18:11:23Z  in response to XWHK_Joe_DeLutis

              Versions are Portal 7.002 and WEF 8.  Could we be missing a configuration XML that references the attribute testscheme?

              • jbooth
                jbooth
                76 Posts
                ACCEPTED ANSWER

                Re: Receiving URL Parameters from External sites

                ‏2013-10-09T13:31:19Z  in response to XWHK_Joe_DeLutis

                On my system I don't have any additional configuration files defining that "testscheme".   Is the SystemOut showing the println output from the onRenderEvent method in PocResolverSample getting hit?  And are there exceptions or messages in the SystemOut log that may indicate something going wrong? 

                The com.ibm.portal.resolver.portlet.RenderEventListener interface has been in Portal since 6.1.0 but unfortunately is missing from the published documentation.

                 

          • mburati
            mburati
            2466 Posts
            ACCEPTED ANSWER

            Re: Receiving URL Parameters from External sites

            ‏2013-10-08T18:29:52Z  in response to XWHK_Joe_DeLutis

            Joe,

            Did you look in SystemOut log as it suggests, and if so, was there any additional info there?

            Note,  the zip with the sample that Jonathan posted above contains the class under WEB-INF/classes/...    which is critical since Portal/WAS only knows about WEB-INF/lib and WEB-INF/classes  (in its classloader) not about the WEF specific WEB-INF/work/classes/...   that WEF typically compiles LJOs into.    Be sure your deployed WAR has that class under WEB-INF/classes/... where portal can find it.

             

            I hope that info helps,
            ..Mike Burati 
            The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
            • XWHK_Joe_DeLutis
              XWHK_Joe_DeLutis
              78 Posts
              ACCEPTED ANSWER

              Re: Receiving URL Parameters from External sites

              ‏2013-10-09T16:21:37Z  in response to mburati

              We have done (or at least we thing we have) everything you guys stated and we are getting an error. The log info is as follows:

              [10/9/13 11:38:56:130 EDT] 00000055 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[portal]: com.ibm.ws.webcontainer.webapp.WebAppErrorRepo

              rt: EJCBD0006E: The resolution of a URI failed. Refer to the SystemOut.log for more detailed information.

                      at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:637)

                      at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1187)

                      at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:131)

                      at com.ibm.ws.cache.servlet.CacheProxyResponse.sendError(CacheProxyResponse.java:555)

                      at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:131)

                      at com.ibm.wps.state.phases.PhaseManagerImpl.next(PhaseManagerImpl.java:705)

                      at com.ibm.wps.state.phases.AbstractPhaseManager.next(AbstractPhaseManager.java:125)

                      at com.ibm.wps.engine.phases.WPInitPhase.next(WPInitPhase.java:533)

                      at com.ibm.wps.engine.Servlet.doGet(Servlet.java:574)

                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)

                      at com.ibm.wps.engine.Servlet.doFilter(Servlet.java:1429)

                      at com.ibm.wps.resolver.servlet.ContentHandlerCleanup.doFilter(ContentHandlerCleanup.java:672)

                      at com.ibm.wps.resolver.servlet.AbstractFilter.doFilter(AbstractFilter.java:93)

                      at com.ibm.wps.engine.Servlet.service(Servlet.java:1417)

                      at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)

                      at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:576)

                      at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:250)

                      at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)

                      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1658)

                      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1598)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)

                      at com.ibm.wps.engine.ExtensionFilter$ExtendedFilterChain.doFilter(ExtensionFilter.java:91)

                      at com.ibm.wps.engine.ExtensionFilter.doFilter(ExtensionFilter.java:178)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.wps.engine.ExtendedLocaleFilter.doFilter(ExtendedLocaleFilter.java:113)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.wps.resolver.friendly.servlet.FriendlySelectionFilter.doFilter(FriendlySelectionFilter.java:191)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.wps.mappingurl.impl.URLAnalyzer.doFilter(URLAnalyzer.java:448)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.wps.engine.VirtualPortalFilter.doFilter(VirtualPortalFilter.java:88)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:95)

                      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:80)

                      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)

                      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:935)

                      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:503)

                      at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)

                      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)

                      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)

                      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:942)

                      at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)

                      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)

                      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)

                      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)

                      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)

                      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)

                      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

                      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

                      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

                      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

                      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

                      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

                      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

                      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)

              • jbooth
                jbooth
                76 Posts
                ACCEPTED ANSWER

                Re: Receiving URL Parameters from External sites

                ‏2013-10-10T16:39:28Z  in response to XWHK_Joe_DeLutis

                Hi,

                Can you check in the deployed portlet WAR to make sure these pieces are in place?

                1. In the portlet.xml file you should have entries like these:

                    <init-param>
                      <name>com.ibm.portal.resolver.ResolutionService</name>
                      <value>com.ibm.portal.resolver.portlet.RenderEventListener</value>
                    </init-param>
                    <init-param>
                      <name>com.ibm.portal.resolver.portlet.RenderEventListener</name>
                      <value>sample.poc.resolver.id</value>
                    </init-param>
                 

                2. In the plugin.xml file you should have this:

                <?xml version="1.0" encoding="UTF-8"?>
                <?eclipse version="3.0"?>
                 
                <plugin id="sample.poc.resolver.id"
                name="sample.poc.resolver.plugin" version="1.0.0"
                provider-name="wef_sample_poc_resolver">
                 
                <extension
                point="com.ibm.content.operations.registry.locationServiceHandler">
                 
                <serviceHandler class="com.ibm.samples.wef.poc_resolver.PocResolverSample"
                locationTypeId="com.ibm.portal.resolver.portlet" id="sample.poc.resolver.id" />
                </extension>
                 
                </plugin>
                 

                3. In WEB-INF/classes/com/ibm/samples/wef/poc_resolver you should have PocResolverSample.class.

                If all those pieces are in place, I'm not sure what's going wrong and you might need to submit a PMR with Portal.   It's possible that the portal version difference is significant (you're on Portal 7 and I'm on Portal 8).   The other sample that I mentioned above I think uses some different Portal interfaces.

                 

                • Sem11211
                  Sem11211
                  17 Posts
                  ACCEPTED ANSWER

                  Re: Receiving URL Parameters from External sites

                  ‏2013-11-20T19:31:43Z  in response to jbooth

                  Hi,

                  I am using WebSphere portal 6.1 in my project and I added  com.ibm.content.operations.registry.jar in the class path to get PocResolverSample compiled. But still PocResolverSample.java is not getting complied. My question is are the following dependant files added in the jar file in higher version of WebSphere Portal if there is some other jar file in the lower version of I can refer to. Files not reachable are:

                  importcom.ibm.portal.resolver.ResolutionService;

                  importcom.ibm.portal.resolver.exceptions.ResolutionException;

                  importcom.ibm.portal.resolver.portlet.RenderEventListener;

                  importcom.ibm.portal.resolver.portlet.RenderEventRequest;

                  importcom.ibm.portal.resolver.portlet.RenderEventResponse;

                  importcom.ibm.portal.state.exceptions.StateException;

                  -Thanks

                  • mburati
                    mburati
                    2466 Posts
                    ACCEPTED ANSWER

                    Re: Receiving URL Parameters from External sites

                    ‏2013-11-20T20:55:36Z  in response to Sem11211

                    I haven't used that sample myself, but I believe Jonathan said that the person he got the sample code from said those APIs existed in Portal 6.1.

                    Portal 6.1 is fairly old to be developing new applications for, so you may want to look into upgrading to a more recent/current version of portal (current version is 800x) at some point.

                    Jonathan's wiki article (Receiving a URL parameter from an external application) referenced above in his post on Oct 1  appears to mention several other jars too, so you may want to try those.since they're included with the instructions for his sample using the PoC resolver.

                     

                    I hope that info helps,
                    ..Mike Burati 
                    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
                    • Sem11211
                      Sem11211
                      17 Posts
                      ACCEPTED ANSWER

                      Re: Receiving URL Parameters from External sites

                      ‏2013-11-21T00:02:24Z  in response to mburati

                      Mike,

                      I extracted the com.ibm.content.operations.registry.jar file and found none of the classes in the jar taken from portal 6.1. And when I click on the link of Jonathan's article I find 404 error on the page.

                      http://www.ibm.com/developerworks/websphere/library/techarticles/0710_koeth/0710_koeth.html

                      Though I got the sample from this forum only. And this sample is done in portal 8. So curious to see if Jonathan's approach deviates from this sample. Could you please provide a proper url of that article.

                       

                      -Thanks

                      Updated on 2013-11-21T00:08:04Z at 2013-11-21T00:08:04Z by Sem11211
                      • Sem11211
                        Sem11211
                        17 Posts
                        ACCEPTED ANSWER

                        Re: Receiving URL Parameters from External sites

                        ‏2013-12-06T19:15:12Z  in response to Sem11211

                        Hi Mike,

                        I resolved all the issues in portal 6.1 except one,"import com.ibm.portal.state.exceptions.StateException". Any idea which is the jar or possible jar file for the above class.

                        -Thanks

                        • mburati
                          mburati
                          2466 Posts
                          ACCEPTED ANSWER

                          Re: Receiving URL Parameters from External sites

                          ‏2014-05-28T14:04:25Z  in response to Sem11211

                          I'm sorry, I didn't get a notification of this followup question earlier.   I haven't used this particular sample myself, so I have not had to find the jar that particular class is in, and I don't personally have a Portal 6.1 to check with at the moment, maybe someone else monitoring the forum does.    For new development, it's really best to be on a more recent (if not the most recent) release, as opposed to one that's several releases / years back.    If you still cannot locate the class for this particular use case, and it's blocking your work, then you may want to contact customer support or try the Portal forum where there are more experts on such Portal API jars monitoring the threads.

                          Since you haven't reposted the question or followup asking for help here, it's possible that you've resolved this, in which case it may be good to followup and describe what your final resolution (with the 6.1 API jar) was so that others still on that older release may benefit.

                           

                          I hope that info helps,
                          ..Mike Burati 
                          The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.