1 2 Previous Next 15 Replies Latest reply on Dec 26, 2012 12:26 PM by Krr1sh

    Facing problem when Integration of configurator with ADF application

    Krr1sh
      Hello,

      Integration of conifigurator with custom application is not returing to "return_url" after clicking on Finish button in conifgurator.

      We have developed a custom ADF application which integrates a configurator.

      We have follwed the below url on developing this.

      http://www.oracle.com/technetwork/topics/newtojava/overview/ofm-ebs-blog-postings-096286.html


      After completeing the configurator process, but the page is still showing as loading and not returning the return_url parameter mentioned in initialization parameters

      So we are unable to get the FacesContext of calling application as it always returns null.

      Please hlep on this, it is bit urgent.

      Thank you
      kali
        • 1. Re: Facing problem when Integration of configurator with ADF application
          Pankaj
          I think you are missing to replace top.location in your return servlet using java script. If you don't do this, you will see clock icon running forever even though your servlet would have got control.
          Refer Implementation guide example "Example Return URL Servlet (Checkout.java)"
          You will get details along with code.

          Thanks,
          Pankaj
          • 2. Re: Facing problem when Integration of configurator with ADF application
            Krr1sh
            Hi pankaj,

            Thanks for your response, I have added that top.location in the checkout.jsp , Still it's showing the clock , it's not coming out side of EBS , May be that causes the FacesContext leading to null.

            Thanks,
            Kali
            • 3. Re: Facing problem when Integration of configurator with ADF application
              Pankaj
              Kali,
              Do you have some logging on your return_url page as soon as you get control in it?
              I seen such issue in past numerous times and its resolved by correct implementation of servlet.
              May be you can share your code? What's return_url? Servlet or any Task Flow? I suggest you keep it simple - use servlet or jsp and then redirect to your required ADF page.

              Thanks,
              Pankaj
              • 4. Re: Facing problem when Integration of configurator with ADF application
                Krr1sh
                Hi pankaj,

                Yeah, Actullay i am trying to call this Configurator part from a ADF application ( I am testing in jdeveloper it self) , I am triggering this EBS page in inline frame and mentioned the return_url as a jsp in the current ADF application , Below is the code of Checkout.jsp

                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd">
                <%@ page contentType="text/html;charset=windows-1252"%>
                <%@ page import="java.io.*" %>
                <%@ page import="javax.servlet.*" %>
                <%@ page import="javax.servlet.http.*" %>
                <%@ page import="oracle.apps.cz.common.XmlUtil" %>
                <%@ page import="oracle.xml.parser.v2.XMLDocument" %>
                <%@ page import="org.xml.sax.SAXException" %>
                <%@ page import="org.w3c.dom.Node" %>
                <%@ page import="org.w3c.dom.NodeList" %>
                <%@ page import="javax.naming.*"%>


                <html>
                <head>
                <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
                <title>checkout</title>
                </head>
                <body>
                <%
                System.out.println("hai");

                %>



                <%!
                String getValidConfig(XMLDocument doc) {
                return getTagValue(doc, "valid_configuration", null); // get configuration element from termination msg
                }
                String getValidConfigHeaderId(XMLDocument doc) {
                return getTagValue(doc, "config_header_id", null); // get element from termination msg
                }
                String getValidRevisionId(XMLDocument doc) {
                return getTagValue(doc, "config_rev_nbr", null); // get element from termination msg
                }


                String getTagValue(XMLDocument doc, String tagName, String defaultValue) {    Node n = doc.getDocumentElement();
                if (n != null) {
                NodeList nl = n.getChildNodes();
                if (nl != null) {
                for (int i = 0; i < nl.getLength(); i++) {
                Node cn = nl.item(i);
                if (cn.getNodeName().equals(tagName)) {
                NodeList cnl = cn.getChildNodes();
                if (cnl != null) {
                return cnl.item(0).getNodeValue();
                }
                }
                }
                }
                }
                return defaultValue;
                }
                %>

                <%

                String terminateString = request.getParameter("XMLmsg");
                XMLDocument terminateDoc;
                try {
                terminateDoc = XmlUtil.parseXmlString(terminateString);
                } catch (SAXException se) {
                throw new ServletException(se.getMessage());
                }
                String validConfig = getValidConfig(terminateDoc);
                String validConfigHeaderId = getValidConfigHeaderId(terminateDoc);
                System.err.println("configuration valid?: " + validConfig);
                System.err.println("configuration valid?: " + validConfigHeaderId);
                System.out.println("Inside of checkout.jsp");

                // ge = new ();
                //ge.getResponseXMLContent(terminateString);

                // view.backing.ConfigTest.getMessage(terminateString);


                response.setContentType("text/html");
                out.println("<html>");
                out.println("<script language=\"javascript\">");
                out.println("top.location = \"http://localhost:7101//ConfigTest-ViewController-context-root//CheckoutTest.jsp");
                out.println("</script>");
                out.println("<body>");
                out.println("Hai how are you </body>");
                out.println("</html>");
                System.out.println("before going to google");
                // response.sendRedirect("http://www.google.com");
                %>


                </body>
                </html>


                Actually i am able to see the SOP statements in my jdeveloper console but still the EBS page is showin the running clock in inline frame , And in CheckoutTest.jsp jst i am showing a static message.

                Any thing wrong in that code ?

                Thanks,
                Kali
                • 5. Re: Facing problem when Integration of configurator with ADF application
                  Pankaj
                  Kali,

                  I think the problem can be with your JSP code.
                  To debug further, you can open that waiting window (Displayed when Configurator is finished) and see "View Source". You should observe a iframe in it and your jsp output in it. It may not be accurate to replace top.location properly, because you have multiple html tags in the output (one part of jsp and one coming from out.println())
                  You can try two things:
                  1. You can remove all html code from jsp and keep html output only from out.println() as required.
                  2. Use Servlet, safer and better way.

                  Some code snippet from Implementation guide example:
                  String terminateString = request.getParameter("XMLmsg");
                  XMLDocument terminateDoc;
                  try {
                  terminateDoc = XmlUtil.parseXmlString(terminateString);
                  } catch (SAXException se) {
                  throw new ServletException(se.getMessage());
                  }
                  String validConfig = getValidConfig(terminateDoc);
                  System.err.println("configuration valid?: " + validConfig);
                  response.setContentType("text/html");
                  PrintWriter out = response.getWriter();
                  out.println("<html>");
                  out.println("<script language=\"javascript\">");
                  out.println("top.location = \"/servlets/Checkout?ValidConfig=" + validConfig + "\"");
                  out.println("</script>");
                  out.println("</html>");

                  HTH!

                  Thanks
                  Pankaj
                  • 6. Re: Facing problem when Integration of configurator with ADF application
                    Krr1sh
                    Hi pankaj,

                    I tried the approach you suggested, Still it's getting stuck at that point it self, Below is the simple servlet code which is the return_url,

                    package view;

                    import java.io.IOException;
                    import java.io.PrintWriter;

                    import javax.servlet.*;
                    import javax.servlet.http.*;

                    public class configurator extends HttpServlet {
                    private static final String CONTENT_TYPE = "text/html; charset=UTF-8";

                    public void init(ServletConfig config) throws ServletException {
                    super.init(config);
                    }

                    public void service(HttpServletRequest request,
                    HttpServletResponse response) throws ServletException,
                    IOException {
                    response.setContentType(CONTENT_TYPE);
                    PrintWriter out = response.getWriter();
                    System.out.println("Hi how are you");
                    out.println("<html>");
                    out.println("<head><title>configurator</title></head>");
                    out.println("<body>");
                    out.println("<p>The servlet has received a POST or GET. This is the reply.</p>");
                    out.println("top.location = \"http://localhost:7101//ConfigTest-ViewController-context-root//CheckoutTest.jsp");
                    out.println("</body></html>");
                    out.close();
                    }
                    }


                    Below is the view source of clock rotating page , where i can't find any thing from the above servlet,


















                    <!-- $Header: czContainer.jsp 120.0 2005/05/25 07:12:55 appldev noship $ -->
                    <!doctype html public "-//W3C//DTD HTML 3.2 Transitional//EN">

                    <html>
                    <head>
                    </head>
                    <body>
                    <form name="_FormXYZ" method=POST>
                    <input type=hidden name="_Field123">
                    </form>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                    <td>
                    <!-- <img src="/OA_MEDIA/czLogo.gif"> -->
                    </td>
                    </tr>
                    <tr>
                    <td>
                    <!-- $Header: czEmbed.jsp 120.0 2005/05/25 05:18:08 appldev noship $ -->














                    <link rel="stylesheet" charset="UTF-8" type="text/css" href="/OA_HTML/cabo/styles/cache/swan-desktop-custom-2_3_6_9-en-gecko.css"><script>var _UixWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.'</script><script src="/OA_HTML/cabo/jsLibs/Common2_3_6_9.js"></script><iframe id="_pprIFrame" name="_pprIFrame" frameborder="0" longdesc="#" title="" src="/OA_HTML/cabo/images/swan/t.htm" style="position:absolute;top:-100;visibility:hidden" width="0" height="0"></iframe><div id="_pprBlockingDiv" onclick="return pprConsumeClick(event);" style="position:absolute;left:0;top:0;width:0;height:0;cursor:wait;" onkeyup="return false;" onkeydown="return false;" onkeypress="return false;"></div><script>var cachedLibs;</script><script>var pprFirstClickPass=true;</script><form id="DefaultFormName" name="DefaultFormName" style="margin:0px" method="POST" action="/OAHTML/czContainer.jsp?akRegionCode=FNDDIALOGPAGE&akRegionApplicationId=0&sessionid=A13TXog2ZwLsgdQNg07KHaLJka&transactionid=null&retainAM=N&addBreadCrumb=S&oapc=6"><input id="_AM_TX_ID_FIELD" type="hidden" value="2" name="_AM_TX_ID_FIELD"><input id="_FORM" type="hidden" value="DefaultFormName" name="_FORM"><span id="lovHFCId"></span><span id="_OAEmbeddedModePageLayoutReplacement__"><table id="FwkErrorBeanId" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td></td></tr></table><div></div><script language="javascript" src="/OA_HTML/cabo/oajsLibs/oafcoreR121.js"></script><div></div><div><div class="x69"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="bottom"><td><img src="/OA_HTML/cabo/images/swan/infol.gif" width="18" height="18" border="0" alt=""></td><td><img src="/OA_HTML/cabo/images/swan/t.gif" width="5" height="0"></td><td width="100%"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="100%"><h1 class="x7c">Information</h1></td></tr></table></td></tr></table></div><div class="x78"><noscript>JavaScript enabled browser required.</noscript><div></div><div></div><span id="TerminationInformationRegion"><table id="_czt1103-CSMsgTopRow" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><img id="_czt1103-HorizontalSpacer1" src="/OA_HTML/cabo/images/swan/t.gif" width="25" height="1"></td><td id="_czt1103-CSMsgTopCell" align="left"><span id="_czt1103-CSMsgContainer"><span id="_czt1103-CSHeaderMsg" class="x2">Your configuration is being processed. Please wait ......</span><div></div><img id="_czt1103-VerticalSpacer1" src="/OA_HTML/cabo/images/swan/t.gif" width="1" height="50"><div></div><table id="_czt1103-ClockImageRow" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><img id="_czt1103-ClockImage" name="_czt1103-ClockImage" src="/OA_MEDIA/process_animation.gif" title="Processing" border="0"></td></tr></table></span></td></tr></table><div></div>
                    <IFRAME HEIGHT="0" WIDTH="0" SRC="CZInitialize.jsp?XMLmsg=<client-event session-id='JRAD1'><terminateSession/></client-event>" NAME="BackToCallingApplication" Id="BackToCallingApplication" title=""></IFRAME></span><input id="_fwkAbsolutePageName" type="hidden" value="/oracle/apps/fnd/framework/webui/OADialogPage:::" name="_fwkAbsolutePageName"><script language="javascript" src="/OA_HTML/cabo/oajsLibs/oafcoreR121.js"></script></div></div></span><span id="_DefaultFormName_Postscript"><input type="hidden" name="_FORMEVENT"><input type="hidden" name="serverValidate"><input type="hidden" name="evtSrcRowIdx"><input type="hidden" name="evtSrcRowId"><script>var _resetDefaultFormNameNames=["_FORMEVENT","serverValidate","evtSrcRowIdx","evtSrcRowId"];</script><script>function _DefaultFormNameValidater(form){return true;}</script></span><script>_submitFormCheck();</script></form><iframe name=formsLauncher src="http://ebs-tst.hologic.com:80/OA_HTML/blank.html" title="Forms Launcher" height=5px width=5px scrolling=no frameborder=no></iframe>





                    </td>
                    </tr>
                    </table>
                    </body>
                    </html>

                    I am not sure where i have done a mistake, Can u please correct me if i am wrong..:)

                    Thanks,
                    Kali

                    Edited by: sai on Dec 24, 2012 2:42 AM
                    • 7. Re: Facing problem when Integration of configurator with ADF application
                      Pankaj
                      Looks like you are having issue with javascript. First I would suggest you develop a standalone jsp/servlet page which will change top.location for itself and go to some site like google.com and test it fully that it works.

                      I tried following thing for html and it works for me.
                      <BODY>
                      <script>
                      top.location='http://www.google.com'
                      </script>
                      </BODY>

                      What you are missing in your code is <script> tag wrapping around top.location. Try this.
                      • 8. Re: Facing problem when Integration of configurator with ADF application
                        Krr1sh
                        Hi pankaj,

                        Thanks for your suggestion, Here is the problem, When i use the same code in servlet as below

                        out.println("<html>");
                        out.println("<head><title>configurator</title></head>");
                        out.println("<body>");
                        out.println("<script type=\"text/javascript\">");
                        out.println("top.location=\"http://www.google.com");
                        out.println("</script></body></html>");

                        it's not redirecting to google.com, But same code when i give in jsp as below

                        <script type="text/javascript">
                        top.location="http://localhost:7101/ConfigTest-ViewController-context-root/checkoutTest.jsp";
                        </script>
                        </body>

                        Its' working..:) , Earlier we have other out.println statements in scriptlet(in jsp), That preventing the redirection, Now i have removed those things, and Successfully redirecting to the top.location page....:) , Thanks for your suggestions , But now one more problem is how can we get those values to Calling ADF application?



                        I have followed the below approach to launch this process

                        1) In ADF created a Iframe with the source if a html file which interacts with EBS ,

                        2) And when i click on the finish button , The top.location URL is opening in new browser not in the Iframe, May be top.location property leading to open new browser window.., Can't we open that page in Iframe itself ?

                        Thank you very much,
                        Kalikrishna
                        • 9. Re: Facing problem when Integration of configurator with ADF application
                          Pankaj
                          ts' working..:) , Earlier we have other out.println statements in scriptlet(in jsp), That preventing the redirection, Now i have removed those things, and Successfully redirecting to the top.location page....:) , Thanks for your suggestions , But now one more problem is how can we get those values to Calling ADF application?

                          You can save values in session before sending response to client for changing top.location.

                          I have followed the below approach to launch this process

                          1) In ADF created a Iframe with the source if a html file which interacts with EBS ,

                          2) And when i click on the finish button , The top.location URL is opening in new browser not in the Iframe, May be top.location property leading to open new browser window.., Can't we open that page in Iframe itself ?

                          No, you cannot open the page in iframe itself because iframe will be invisible, it will be only for internal processing.
                          • 10. Re: Facing problem when Integration of configurator with ADF application
                            Krr1sh
                            Hi pankaj,

                            I am setting those values in session , but when i tried to retreive it's giving null.

                            Here is the sample code in Checkout.jsp which is a return_url

                            session.setAttribute("configId", "1000");

                            And in top.location i specified the another jsp which is in ADF application Retrieve.jsp

                            System.out.println("inside checkoutTest.jsp"+session.getAttribute("configId"));

                            Which returns null value.

                            when we launch the EBS page is it EBS session or still ADF session remains in EBS pages also ? In this entire scenario only one session is there or each one for ADF and EBS ?

                            Thanks,
                            Kali
                            • 11. Re: Facing problem when Integration of configurator with ADF application
                              Krr1sh
                              Hi pankaj,

                              And we are not getting the FacesContext back when i complete this procedure and calling one metod in backing bean , There i am getting the FacesContext null .

                              Thanks,
                              Kali
                              • 12. Re: Facing problem when Integration of configurator with ADF application
                                Pankaj
                                On which instance, your Checkout.jsp and Retrieve.jsp are located?
                                If both are on EBS or both on Weblogic, then it should work fine. If both are on different server, then it will not work for sure because server session will be different.
                                • 13. Re: Facing problem when Integration of configurator with ADF application
                                  Krr1sh
                                  Hi pankaj,

                                  Yes both are in two different servers, My ADF application is located in weblogic server.

                                  Can't we do with two different servers ?

                                  Thanks,
                                  Kali
                                  • 14. Re: Facing problem when Integration of configurator with ADF application
                                    Pankaj
                                    Kali,
                                    You should brush up your basics first about session management.
                                    Session is managed by web/application server and is specific to that server. Different servers do not share sessions. If you keep both of your JSP on the same instances/server, it should work fine.
                                    I suggest you should keep both JSP on weblogic server because I guess that is the server where you want all configuration session info. You may want to make it available to ADF calling application which is invoking configurator.

                                    HTH!
                                    1 2 Previous Next