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).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192441#4192441
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192441
I don't know if it's the good method but you can do something like that.
You need to cast the request to JBossRenderRequest and obtain the "PortalObjectContainer" (through injection or MBeanServer) :
| PortalNodeImpl windowNodeImpl = (PortalNodeImpl) jbossRequest.getPortalNode();
| PortalObjectId windowObjectId = windowNodeImpl.getObjectId();
| Window window = (Window) portalObjectContainer.getObject(windowObjectId);
| String instanceId = ((PortletContent) window.getContent()).getInstanceRef();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192426#4192426
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192426