private void fireRemoved(DriverPortletContext context) { PortletRegistryEvent event = new PortletRegistryEvent(); event.setPortletApplication(context.getPortletApplicationDefinition()); for (PortletRegistryListener l : registryListeners) { l.portletApplicationRemoved(event); } logger.info("Portlet Context '" + context.getApplicationName() + "' removed."); }
@Override public PortletApplicationDefinition getPortletApplication(String applicationName) throws PortletContainerException { DriverPortletContext ipc = portletContexts.get(applicationName); if (ipc != null) { return ipc.getPortletApplicationDefinition(); } String msg = "Unable to retrieve portlet application: '" + applicationName + "'"; logger.warn(msg); throw new PortletContainerException(msg); }
servletContext, portletApp, requestDispatcherService); portletContext.setAttribute( PlatformApiBroker.PORTLET_CONTEXT_ATTRIBUTE_NAME, platformApiBroker); portletContexts.put(contextPath, portletContext); + portletApp.getPortlets().size() + " portlets for context " + portletContext.getApplicationName()); String appName = portletContext.getApplicationName(); if (appName == null) { throw new PortletContainerException( portletContext.getApplicationName() + "/" + portlet.getPortletName(), new DriverPortletConfigImpl(portletContext, portlet));
@Override public synchronized void unregister(DriverPortletContext context) { portletContexts.remove(context.getApplicationName()); classLoaders.remove(context.getApplicationName()); Iterator<String> configs = portletConfigs.keySet().iterator(); while (configs.hasNext()) { String key = configs.next(); if (key.startsWith(context.getApplicationName() + "/")) { configs.remove(); } } fireRemoved(context); }
public void init(ServletContext context) throws DriverConfigurationException { if (PlutoServices.getServices() != null) { PageConfig page = new PageConfig(); page.setName("Embedded Portlets"); page.setUri("/WEB-INF/themes/pluto.jsp"); PortletContextService contextService = PlutoServices.getServices().getPortletContextService(); Iterator<DriverPortletContext> portletContexts = contextService.getPortletContexts(); String contextPath = context.getContextPath(); while (portletContexts.hasNext()) { DriverPortletContext driverPortletContext = portletContexts.next(); List<? extends PortletDefinition> portlets = driverPortletContext.getPortletApplicationDefinition() .getPortlets(); for (PortletDefinition portletDefinition : portlets) { String portletName = portletDefinition.getPortletName(); page.addPortlet(contextPath, portletName); } } pages.add(page); initialized = true; } }
private void fireRegistered(DriverPortletContext context) { PortletRegistryEvent event = new PortletRegistryEvent(); event.setPortletApplication(context.getPortletApplicationDefinition()); for (PortletRegistryListener l : registryListeners) { l.portletApplicationRegistered(event); } logger.info("Portlet Context '" + context.getApplicationName() + "' registered."); }