This content has been marked as final.
Show 3 replies
-
1. Re: How to set the Portlet for a window programmaticly
cpage Nov 26, 2008 7:18 AM (in response to johnnythehun)To create a window in a page use :
Page.createWindow("window name", ContentType.PORTLET, "instance ID")
To get the available portlet list you can do something like that :
get the FederatingPortletInvoker through the MBeanServer or the injection and do :Set<FederatedPortlet> portlets = new HashSet<FederatedPortlet>(); for (Iterator<FederatedPortletInvoker> iterator = federatingInvoker.getFederatedInvokers().iterator(); iterator.hasNext();) { FederatedPortletInvoker federated = iterator.next(); portlets.addAll(federated.getPortlets()); }
To create a portlet instance you could use InstanceContainer.createDefinition("new instance id", "existing portlet context id", true). -
2. Re: How to set the Portlet for a window programmaticly
johnnythehun Dec 9, 2008 2:59 PM (in response to johnnythehun)Thanks, I am now able to get Portlet instances.
After a few lines I have stumbled into the following question:
How do I put a Window into a region programmaticly?
I have added a Window to the page, but how can I specify the region where the window should be rendered?
To others:
To get FederatingPortletInvoker call:FederatingPortletInvoker fedPortletInvoker = (FederatingPortletInvoker) MBeanProxy.get(FederatingPortletInvoker.class, new ObjectName("portal:service=PortletInvoker,type=Federating"), mbeanServer);
Thanks,
John -
3. Re: How to set the Portlet for a window programmaticly
cpage Dec 15, 2008 5:20 AM (in response to johnnythehun)To put a Window in a region use :
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, "YOUR_REGION_NAME");
If you want to view code for portal object management, look at the "core-admin" portlets of portal project