10 Replies Latest reply on Jan 25, 2007 12:19 PM by florent.picot

    CMS Portlet Issue

    jdestef

      Hi,

      The doc for this portlet says that one can configure a starting page. Looking at the source code it doesn't appear that is currently possible.

      We made a small change to the code to take a starting page as an instance preference. This works fine. When we create a page with a link to another page in it, however, we are redirected back to the default portal page that has another instance of the CMS portlet on it. I though I saw a configuration parameter for this behavior some place.

      Does this sound familiar to anyone?

      Tx

        • 1. Re: CMS Portlet Issue

          You can set the default page in the portlet.xml:

           <init-param>
           <description>Default path to index page.</description>
           <name>indexpage</name>
           <value>/default/index.html</value>
           </init-param>
          


          • 2. Re: CMS Portlet Issue
            jdestef

            Hi Roy,

            Thanks for the response. The issue is I have multiple CMS portlet instances on different pages in my portal. In the *-object.xml I set the default page for a given instance. That took a little tweaking of the CMS portlet code.

            Now when the given CMS portlet instance renders content in use the PortletPrefernces to get it's initial out put. What I want to do now is put a link to another page in the CMS repository. When I select that link the Portal responds by sending me back to the default portal page (which has an instance of the CMS Portlet on it) and displays the linked content in the CMS Portlet on that page.

            Tx

            • 3. Re: CMS Portlet Issue

              ok. If I'm understanding correctly, it sounds like the link is malformed. If it can't find the page, it'll send you back to the default page.

              Can you make sure the link is absolute, with no leading slash? default/folder/file.html. Also, you should be able to access this file by going to your browser and doing: http://localhost:8080/content/default/folder/file.html

              If I'm not understanding correctly and the link is correct, then let me know.

              • 4. Re: CMS Portlet Issue
                jdestef

                Hi Roy,

                Thanks for the help. When I type in "http://localhost:8080/content/default/help/test.html" I get a resource not available error. When I type in "http://localhost:8080/portal/content/default/help/test.html" I get the portal displayed and my content (test.html page) displayed in the CMS Portlet on that page.

                It this what I should expect?

                Tx

                • 5. Re: CMS Portlet Issue

                   

                  "jdestef" wrote:
                  It this what I should expect?


                  Yes. html and text will be displayed in the portlet window. If the resource was a gif, pdf, doc, or some other binary it would appear in the browser window, WITHOUT any portal decorations. This makes it easier to send links to pdfs and such in emails.

                  • 6. Re: CMS Portlet Issue
                    jdestef

                    Ok,

                    So I'm back to my original problem. When selecting a link in CMS portlet 2 on page 2, the portal returns to the default page and displays the link contents in the CMS Portlert instance on that page. Is this what is supposed to happen?

                    Tx

                    • 7. Re: CMS Portlet Issue

                      The behaviour you're describing still sounds to me like its a bad link. Can you post what the href looks like AND the path to where the file is, in the repo?

                      I tested doing creating a new cmsportlet instance and assigning it to a window on the default page. So I have 2 instances in 2 windows of CMSPortlet. Clicking on a link in one, only affects that one instance/window, not the other.

                      • 8. Re: CMS Portlet Issue
                        jdestef

                        Hi Roy,

                        This is the html produced by the portal for my "TestPage" :

                        
                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml">
                        <head>
                         <title>JBoss Portal 2.2.0-FINAL</title>
                         <meta http-equiv="Content-Type" content="text/html;"/>
                         <!-- to correct the unsightly Flash of Unstyled Content. -->
                         <script type="text/javascript"></script>
                         <!-- inject the theme; default to the Nphalanx theme if nothing is selected for the portal or the page -->
                         <link rel='stylesheet' type='text/css' id='main_css' href='/portal-core/themes/maple/portal_style.css' />
                        <link rel='shortcut icon' href='/portal-core/themes/maple/images/favicon.ico' />
                        
                         <!-- insert header content that was possibly set by portlets on the page -->
                        
                        </head>
                        
                        <body id="body">
                        <div id="portal-container">
                         <div id="sizer">
                         <div id="expander">
                         <div id="logoName"></div>
                         <table border="0" cellpadding="0" cellspacing="0" id="header-container">
                         <tr>
                         <td align="center" valign="top" id="header">
                         <div class='empty-region' />
                         <div id="spacer"></div>
                         </td>
                         </tr>
                         </table>
                         <div id="content-container">
                         <!-- insert the content of the 'left' region of the page, and assign the css selector id 'regionA' -->
                         <div class='empty-region' />
                         <!-- insert the content of the 'center' region of the page, and assign the css selector id 'regionB' -->
                         <div id='regionB'><div class="portlet-container"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="portlet-titlebar-left"></td><td class="portlet-titlebar-center"><div class="portlet-titlebar-decoration"><span class="portlet-titlebar-title"></span></div><div class="portlet-mode-container"><div class="portlet-mode-minimized" onClick="location.href='/portal/auth/index.html?ctrl:cmd=nav&ctrl:windowstate=minimized&ctrl:window=default.TestPage.HHCMSPortlet';"></div><div class="portlet-mode-maximized" onClick="location.href='/portal/auth/index.html?ctrl:cmd=nav&ctrl:windowstate=maximized&ctrl:window=default.TestPage.HHCMSPortlet';"></div></div></td><td class="portlet-titlebar-right"></td></tr><tr><td class="portlet-content-left"></td><td class="portlet-body"><div class="portlet-content-center">This is a help page. This is a link to a <a href="/portal/content/default/new.html">new page</a>.</div></td><td class="portlet-content-right"></td></tr><tr><td class="portlet-footer-left"></td><td class="portlet-footer-center"></td><td class="portlet-footer-right"></td></tr></table></div></div>
                         <hr class="cleaner"/>
                        
                         <div id="footer-container" class="portal-copyright">Powered by <a class="portal-copyright"
                         href="http://www.jboss.com/products/jbossportal">JBoss
                         Portal</a><br/>
                         <span id="ThemeBy"></span>
                         </div>
                         </div>
                         </div>
                         </div>
                        </div>
                        </body>
                        </html>


                        The link look like this:

                        This is a help page. This is a link to a <a href="/portal/content/default/new.html">new page</a>


                        The page being displayed in the portlet is in default/help.html.

                        The new page is in the repository at default/new.html.

                        The TestPage is a separate page (different page) that the default portal page. Have you tries putting an instance of the CMS portlet on a different page that the default page and clicking a link in it?

                        Thanks for the help.

                        • 9. Re: CMS Portlet Issue

                          ok. I tested now, and in fact, this is a bug. Clicking a link in the CMSPortlet on one page, sends you back to the default page, with the proper link page displayed.

                          I have created a bug in jira: http://jira.jboss.com/jira/browse/JBPORTAL-538

                          • 10. Re: CMS Portlet Issue
                            florent.picot

                            Hi,

                            I am working on a future application. So I am looking for a jboss portal's solution. I want to use several portal instance and several CMSportletInstance too.
                            I have the problem mentioned into this post: When I implement a CMSPortletInstance in another page/portal that the default(s), a link in this CMSPortletwindow send me back to the default page in the default portal.
                            I want to stay into my second portal and my test page when I click on the link. You proposed that we modify the CMSObjectCommandFactory in the portal-cms.sar/META-INF/jboss-service.xml file.
                            But if I do that, I suppose that the defaultCMSwindow of the default page in the default portal will send me into my other portal instance.
                            So if my second CMSportletwindow works fine with this modification, this is the default one which won't longer work correctly.

                            Am I right? Perhaps I did not understand some-thing.

                            In advance thank you.