8 Replies Latest reply on Aug 24, 2010 7:40 AM by MacLeod7222

    Question about embedding flex portlets in WLP

    MacLeod7222 Level 1

      I need to use a different wrapper jsp other then portlet-view.jsp The LiveCyle documents states I need to set the "view_jsp" attribute to my jsp that is located in the wsrp-jsp folder. I updated my portlet.xml file with the following code:

       

      <init-param>
              <name>view_jsp</name>
              <value>/wsrp-jsp/test-view.jsp</value>
          </init-param>

       

      The portlet cannot find the test-view.jsp. My wsrp-jsp folder is at the root of my web content. Is there something else that needs to be set?

       

      thanks

      Dan

       

      WLP 103.2

      ES 2.6.1

        • 1. Re: Question about embedding flex portlets in WLP
          Rohit . Kumar Adobe Employee

          Hi Dan,

           

          Can you instead try putting the view_jsp as a portlet preference e.g.

           

           

                  <portlet-preferences>

                      <preference>

                          <name>view_jsp</name>

                          <value>/wsrp-jsp/portlet-view.jsp</value>      // This folder is relative to WebContent, in this case WebContent/wsrp-jsp/portlet-view.jsp

                          <read-only>true</read-only>

                  </portlet-preferences>

           

          Let me know if this works for you.

          Thanks,

          Rohit

           

          • 2. Re: Question about embedding flex portlets in WLP
            Rohit . Kumar Adobe Employee

            Hi Dan,

             

            Did the above suggestion work for you?

             

            Rohit

            • 3. Re: Question about embedding flex portlets in WLP
              MacLeod7222 Level 1

              I'll give it a try but I'd like to know why you're suggesting that approach. I found one example of setting the view_jsp and it's set as an init-param. Should it be a pereference instead?

               

              thanks

              Dan

              • 4. Re: Question about embedding flex portlets in WLP
                MacLeod7222 Level 1

                Rohit,

                     Thanks, setting view_jsp as a portlet pereference instead of an init-param worked. Can you tell me where you found this information? All the info I've found says to set the view_jsp as an init param.

                 

                Thanks again for your help

                Dan

                • 5. Re: Question about embedding flex portlets in WLP
                  Rohit . Kumar Adobe Employee

                  Glad to hear that it worked for you!

                   

                  The LCDS documentation has a typo in it. We will get the documentation fixed.

                   

                  Rohit

                  • 6. Re: Question about embedding flex portlets in WLP
                    MacLeod7222 Level 1

                    I have one more question for you.

                    I'm trying to have my portlets javascript function make a call to the embedded flex apps callback method. I've tried a couple different ways but none seemed to work. How would I make a call to the Flex callback method from the wrapper's JavaScript?

                     

                     

                    <script language="JavaScript" type="text/javascript">

                     

                            AC_FL_RunContent(
                                        "src", "<%= srcPath %>",
                                        "id", "<%= (String)request.getAttribute("portlet_name") %>",
                                        "name", "<%= (String)request.getAttribute("portlet_name") %>", 
                                        "width", "<%= request.getAttribute("width") %>",
                                        "height", "<%= request.getAttribute("height") %>",
                                        "align", "middle",
                                        "quality", "high",
                                        "FlashVars", "PORTLET_WS=<%= request.getAttribute("window_state")%><%= wsrpEncodedChannel %>",
                                        "allowScriptAccess","sameDomain",
                                        "type", "application/x-shockwave-flash",
                                        "pluginspage", "http://www.adobe.com/go/getflashplayer");         
                    </script>

                    • 7. Re: Question about embedding flex portlets in WLP
                      Rohit . Kumar Adobe Employee

                      Hi Don,

                       

                      You can call Flex methods from your enclosing wrapper by using the Flex ExternalInterface API. You do this by adding a public method in your application to a list of callable methods. In your application, you add a local Flex function to the list by using the addCallback() method of the ExternalInterface API. This method registers an ActionScript method as callable from the JavaScript or VBScript in the wrapper.

                       

                      For more details, look a the Using Flex SDK guide. For Flex 4, here is the link:

                      http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7e92.html.

                       

                      Have you tried this out?

                       

                      Rohit

                      • 8. Re: Question about embedding flex portlets in WLP
                        MacLeod7222 Level 1

                        Below is what I've tried. Also, not sure if it matters that the Flex app is embedded in a WLP portlet.

                         

                        In my mxml file I added: ExternalInterface.addCallback("setEntityId", setEntityId);

                         

                        In my wrapper jsp I added:

                         

                        <script language="JavaScript" type="text/javascript">

                         

                                AC_FL_RunContent(
                                            "src", "<%= srcPath %>",
                                            "id", "<%= (String)request.getAttribute("portlet_name") %>",
                                            "name", "<%= (String)request.getAttribute("portlet_name") %>", 
                                            "width", "<%= request.getAttribute("width") %>",
                                            "height", "<%= request.getAttribute("height") %>",
                                            "align", "middle",
                                            "quality", "high",
                                            "FlashVars", "PORTLET_WS=<%= request.getAttribute("window_state")%><%= wsrpEncodedChannel %>",
                                            "allowScriptAccess","sameDomain",
                                            "type", "application/x-shockwave-flash",
                                            "pluginspage", "http://www.adobe.com/go/getflashplayer");         
                        </script>

                         

                        function getFlexApp(appName) {
                                //alert("getFlexApp");
                               if (navigator.appName.indexOf("Microsoft") != -1) {
                                   return window[appName];
                               } else {
                                   return document[appName];
                               }
                            }

                         

                        getFlexApp('IncList').setEntityId('xxx');