PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
final String portletEntityId = (String) getConfiguration(coplet, "portlet");
PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
PortletEntity portletEntity = ((PortletEntityListImpl)pae.getPortletEntityList()).add(pae, portletEntityId, coplet, registry);
if ( portletEntity.getPortletDefinition() != null ) {
// create the window
PortletWindow portletWindow = new PortletWindowImpl(portletEntityId);
((PortletWindowCtrl)portletWindow).setId(coplet.getId());
((PortletWindowCtrl)portletWindow).setPortletEntity(portletEntity);
PortletWindowList windowList = portletEntity.getPortletWindowList();
((PortletWindowListCtrl)windowList).add(portletWindow);
coplet.setAttribute("window", portletWindow);
// load the portlet
final Map objectModel = ContextHelper.getObjectModel(this.context);