[jboss-user] [JBoss Portal Users] - Re: links from portlet content to another portal page

hamptont do-not-reply at jboss.com
Thu Oct 1 13:01:38 EDT 2009


I tried the code from the reference guide but I can't get it working correctly.  The following is a test portlet jsp fragment that I'm working with.

The portal page structure is like this


  | pageA
  |     pageB
  |         pageC
  | 

The jsp fragment below is for a portlet that is on page B and is trying to resolve the pageURL to pageC which is a sub-page of pageB


  | <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
  | <%@ page isELIgnored="false" %>
  | <%@ page import="org.jboss.portlet.JBossRenderRequest" %>
  | <%@ page import="org.jboss.portlet.JBossRenderResponse" %>
  | <%@ page import="org.jboss.portal.api.node.PortalNode" %>
  | <%@ page import="org.jboss.portal.api.node.PortalNodeURL" %>
  | 
  | <portlet:defineObjects/>
  | 
  | <%
  |     JBossRenderRequest req = new JBossRenderRequest(renderRequest);
  |     JBossRenderResponse resp = new JBossRenderResponse(renderResponse);
  | 
  |     PortalNode thisNode = null;
  |     PortalNode linkToNode = null;
  |     PortalNodeURL pageURL = null;
  | 
  |     thisNode = req.getPortalNode().getParent();
  |     if (thisNode != null) linkToNode = thisNode.resolve("pageC");
  |     if (linkToNode != null) pageURL = resp.createRenderURL(linkToNode);
  | %>
  | 
  | 
  | <p>
  | thisNode = 
  | <%  if (thisNode != null) { %>
  |         <%= thisNode.getName() %>
  | <%  } else { %>
  |         null
  | <%  } %>
  | </p>
  | 
  | 
  | 
  | <p>
  | linkToNode = 
  | <%  if (linkToNode != null) { %>
  |         <%= linkToNode.getName() %>
  | <%  } else { %>
  |         null
  | <%  } %>
  | </p>
  | 
  | 
  | <p>
  | pageURL = 
  | <%  if (pageURL != null) { %>
  |         <%= pageURL.toString() %>
  | <%  } else { %>
  |         null
  | <%  } %>
  | </p>
  | 

This example also produces a bizarre and very long error on the call to thisNode.resolve().  I am not sure that I'm getting the references to JBossRenderRequest & JBossRenderResponse correctly, but the example in the reference guide does not say what the correct way is to get these objects.


  | 12:46:07,397 ERROR [PortalPermissionCollection] Permission check against the repository failed
  | org.hibernate.HibernateException: Unable to locate current JTA transaction
  | .........
  | 

I'm not sure what to the correct way to do this is but I'm pretty sure I did it wrong :)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258242#4258242

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258242



More information about the jboss-user mailing list