[jboss-user] [JBoss Portal] - Re: Portal 2.7.0 - how to get to PortalNode API?

JohnnyTheHun do-not-reply at jboss.com
Wed Nov 19 21:28:32 EST 2008


Thanks it works.

For the Page creation part - if anyone else is looking for a solution I found this on another thread (it works):


  | TransactionManager tm = null;
  |         try {
  |             InitialContext ic = new InitialContext();
  |             tm = (TransactionManager) ic.lookup("java:/TransactionManager");
  |             return tm;
  |         } catch (NamingException ex) {
  |             System.out.println("Failed to find transactionmnager");
  |             return null;
  |         }
  | try {
  | tm.begin();
  | MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
  |                 container = (PortalObjectContainer) MBeanProxy.get(PortalObjectContainer.class, new ObjectName("portal:container=PortalObject"), mbeanServer);
  |                 Context ctx = container.getContext();
  |                 
  |                 Portal po = ctx.getPortal(pathToPage.get(0).getName());
  |                 
  |                 po.createPage("JBOSS rocks!");
  | } finally {
  | tm.commit();
  | }
  | 



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

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



More information about the jboss-user mailing list