[jboss-user] [JBoss Portal] - get corresponding PortalObject of a PortalNode

JohnnyTheHun do-not-reply at jboss.com
Tue Dec 9 10:45:22 EST 2008


JBoss Portal 2.7.0-cr1

I have a PortalNode via JBossRenderRequest.getPortalNode();
I want to create a Page programmaticly under this node, to do that I need a PortalObject (Page) instance.

Is there any easy way to do that, for example a PortalObject getPortalObjectFor(PortalNode node) function?:

  | PortalNode currentNode = request.getPortalNode();
  | PortalNode pageNode = currentNode .getParent();
  | Page pageObj = (Page)getPortalObjectFor(pageNode);
  | Page newPage = pageObj.createPage(...);
  | 


Or do I have to do it the hard way?:


  | PortalNode currentNode = request.getPortalNode();
  | PortalNode pageNode = currentNode.getParent();
  | 
  | // get name of pageNode's parents
  | ...
  | 
  |                 MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
  |                 container = (PortalObjectContainer) MBeanProxy.get(PortalObjectContainer.class, new ObjectName("portal:container=PortalObject"), mbeanServer);
  |                 Context ctx = container.getContext();
  | 
  | //using the names of pageNode's parents - get the PortalObject from the Context's children's children.
  | ...
  | 

Thanks, John

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

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



More information about the jboss-user mailing list