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>
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.
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.
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?
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.
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?
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.
This is the html produced by the portal for my "TestPage" :
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.
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
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.