-
1. Re: Creating Portal Pages Dynamically using Jboss Portal API
schamarthi Aug 25, 2009 11:30 AM (in response to schamarthi)any one ?
-
2. Re: Creating Portal Pages Dynamically using Jboss Portal API
schamarthi Aug 27, 2009 9:41 AM (in response to schamarthi)any jboss portal developers can help ?
-
3. Re: Creating Portal Pages Dynamically using Jboss Portal API
tomhombergs Aug 28, 2009 4:50 AM (in response to schamarthi)We used the JBoss Portal API to create pages dynamically. I figured out how to do it by downloading the JBoss Portal source and reverse-engineering the admin-portlets :).
You will need to access the PortalObjectContainer MBean to create pages and add portlets to those pages. Here are some snippets (out-of-context, though):// creating a page (parent page must exist) PortalObjectPath portalPath = new PortalObjectPath(pathToParentPage, PortalObjectPath.CANONICAL_FORMAT); PortalObjectId id = new PortalObjectId("", portalPath); PortalObject object = getPortalObjectContainer().getObject(id); PageContainer parent = (PageContainer) object; Page page = parent.createPage("My Page"); // adding an instance of MyPortlet (instance must be created beforehand) Window window = page.createWindow("MyPortletWindow", ContentType.PORTLET, "MyPortletInstance");
The PortalObjectContainer can only be accessed through a JTA transaction, if you want to use it outside of a portlet (this code would be in the method getPortalObjectContainer()):TransactionManager tm = null; try { InitialContext ic = new InitialContext(); tm = (TransactionManager) ic.lookup("java:/TransactionManager"); tm.setTransactionTimeout(600); } catch (NamingException e) { throw new RuntimeException("TransactionManager konnte nicht erzeugt werden!", e); } tm.begin(); try { MBeanServer mbeanServer = MBeanServerLocator.locateJBoss(); PortalObjectContainer container = (PortalObjectContainer) MBeanProxy.get(PortalObjectContainer.class, new ObjectName("portal:container=PortalObject"), mbeanServer); return container; } finally { tm.commit(); logger.trace("...beende JTA-Transaktion."); }
Hope this helps. Looking at the source of the JBoss Portal Admin-Portlets helped me a great deal! -
4. Re: Creating Portal Pages Dynamically using Jboss Portal API
tomhombergs Aug 28, 2009 5:04 AM (in response to schamarthi)Almost overlooked your performance-question:
I tested the automatic creation of 5.000 - 10.000 portal pages with 5 Portlets each, which was no problem (the database is the bottleneck here). Those pages all referenced the same 5 Portlet instances.
However, when creating 1 new portlet instance for each page, Jboss Portal cannot handle the several thousand portlet instances (the admin backend and the JBoss API do not respond anymore). No one should need as many different portlet instances, though.
I do not understand what you mean by portlet preferences. -
5. Re: Creating Portal Pages Dynamically using Jboss Portal API
schamarthi Aug 29, 2009 5:07 AM (in response to schamarthi)Thank you so much. That helped me lot
-
6. Re: Creating Portal Pages Dynamically using Jboss Portal API
jbossaspirant Jan 3, 2012 7:00 AM (in response to schamarthi)Hi
Can you please explain the procedure to create a dynamic portal page.
-
7. Re: Creating Portal Pages Dynamically using Jboss Portal API
jbossaspirant Jan 4, 2012 2:14 AM (in response to jbossaspirant)Hi
Can anyone help me out on this...
My Requirement is like when a user clicks on a hyperlink in a portlet , which is on the home page of portal.
A Portal Page should be created dynamically and the respective application (based on the hyperlink data) should be
loaded in an other portlet in that particular dynamically created Portal Page.
Please give me some suggestions...
Thanks.
-
8. Re: Creating Portal Pages Dynamically using Jboss Portal API
jssteux Jan 4, 2012 6:15 AM (in response to jbossaspirant)Hi,
What we do is redefininig the defaut PortalObjectContainer.
When the user clicks a link, we create DynamicWindowBean or DynamicPageBean and store them in the user's session.
Then, our portalObjectContainer looks for this dynamicWindow and return them as DynamicWindow or DynamicPage objects (which are our implementation of the Portal Window/Page Interface).
It needs a good experience of JBoss Portal to implement.
Jean-Sébastien Steux