This content has been marked as final.
Show 3 replies
-
1. Re: Content Portlet
noleme Sep 14, 2005 8:15 AM (in response to noleme)"noleme" wrote:
It looks like ContentPortlet displays a certain page given as a parameter.
When I have a link on that page towards another page, and click on it, the contents of the portlet doesn't change...
Is this a bug or a feature?
Is it possible at all to have links and follow them in the ContentPortlet? What is the correct syntax for the link?
Here is the info about the portal I am using:
-> What JBoss version are you using - 4.0.2
-> What JBoss Portal version are you using (and if it's from CVS, sources, binaries) - 2.0 binaries
-> What database you are using with version number - just the file store for cms
-> What JDBC connector you are using NA -
2. Re: Content Portlet
julien1 Sep 14, 2005 8:40 AM (in response to noleme)the actual content portlet always use the same link.
perhaps it should have an option where then it could be used to navigate from that portlet -
3. Re: Content Portlet
noleme Sep 15, 2005 7:45 AM (in response to noleme)"julien@jboss.com" wrote:
the actual content portlet always use the same link.
perhaps it should have an option where then it could be used to navigate from that portlet
Actually what I needed was a portlet which would display one page when normal/minimized, to fit "graciously" with the other portlets (e.g. a summay page) and display another page when maximized, providing more information. Then when pages are clicked on the maximized page to behave like a normal CMS portlet. This would allow one to reuse the content portlet to display several parts of the content tree in the portal window...
Here is a way to do this... (not compltely tested so use cautiously :P :) )
public class CustomContentPortlet extends CMSPortlet {
private boolean firstView = true;
public void processAction(JBossActionRequest req, JBossActionResponse resp)
throws PortletException, PortletSecurityException, IOException {
throw new PortletException();
}
public void render(JBossRenderRequest req, JBossRenderResponse resp)
throws PortletException, IOException {
resp.setTitle(getTitle(req));
doView(req, resp);
}
protected void doView(JBossRenderRequest req, JBossRenderResponse resp)
throws PortletException, IOException, UnavailableException {
if (req.getWindowState() == WindowState.MAXIMIZED) {
if(firstView)
{
String uri = req.getPreferences().getValue("extendedUri", null);
if (uri == null) {
throw new PortletException("No Extended URI defined");
}
req.getPortletSession().setAttribute("uri", uri);
}
super.doView(req, resp);
} else {
firstView = true;
String uri = req.getPreferences().getValue("uri", null);
if (uri == null) {
throw new PortletException("No URI defined");
}
req.getPortletSession().setAttribute("uri", uri);
super.doView(req, resp);
}
}
}