public void admin(PortletRequestContext requestContext, PortletRequest request, PortletResponse response) throws IOException, PortletException, PortletContainerException { throw new PortletContainerException("Unsupported action ADMIN"); }
@Override public DriverPortletConfig getPortletConfig(String applicationName, String portletName) throws PortletContainerException { DriverPortletConfig ipc = portletConfigs.get(applicationName + "/" + portletName); if (ipc != null) { return ipc; } String msg = "Unable to locate portlet config [applicationName=" + applicationName + "]/[" + portletName + "]."; logger.warn(msg); throw new PortletContainerException(msg); }
@Override public PortletDefinition getPortlet(String applicationName, String portletName) throws PortletContainerException { DriverPortletConfig ipc = portletConfigs.get(applicationName + "/" + portletName); if (ipc != null) { return ipc.getPortletDefinition(); } String msg = "Unable to retrieve portlet: '" + applicationName + "/" + portletName + "'"; logger.warn(msg); throw new PortletContainerException(msg); }
@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); }
InputStream webIn = servletContext.getResourceAsStream(WEB_XML); if (paIn == null) { throw new PortletContainerException( "Cannot find '" + PORTLET_XML throw new PortletContainerException( "Cannot find '" + WEB_XML this.portletAppDescriptorService.mergeWebDescriptor(portletApp, webIn); } catch (Exception ex) { throw new PortletContainerException( "Exception loading portlet descriptor for: " + servletContext.getServletContextName(),
public boolean isPortletModeSupportedByPortlet(String portletId, String mode) { // View mode is always supported if (mode.equalsIgnoreCase(PortletMode.VIEW.toString())) { return true; } String applicationId = PortletWindowConfig.parseContextPath(portletId); String applicationName = applicationId; String portletName = PortletWindowConfig.parsePortletName(portletId); try { if (portletRegistry == null) { LOG.error("Optional Portlet Registry Service not found."); throw new PortletContainerException("Optional Portlet Registry Service not found."); } PortletApplicationDefinition ctx = portletRegistry.getPortletApplication(applicationName); for (Supports sd : ctx.getPortlet(portletName).getSupports()) { if (sd.getMimeType().matches("(?:\\*|\\*/\\*|text/html|text/\\*)")) { for (String pm : sd.getPortletModes()) { if (pm.equalsIgnoreCase(mode)) { return true; } } } } } catch (PortletContainerException e) { LOG.error("Error determining mode support.", e); } LOG.info("Portlet mode '" + mode + "' not found for portletId: '" + portletId + "'"); return false; }
/** * Gets all modes supported by a portlet that are defined in the portlet's supports child element in portlet.xml. * * @param portletId * of interest. * @return all portlet modes supported by a portlet. */ public Set<PortletMode> getSupportedPortletModes(String portletId) throws PortletContainerException { Set<PortletMode> modeSet = new HashSet<PortletMode>(); modeSet.add(PortletMode.VIEW); // view is always supported String applicationId = PortletWindowConfig.parseContextPath(portletId); String applicationName = applicationId; String portletName = PortletWindowConfig.parsePortletName(portletId); if (portletRegistry == null) { LOG.error("Optional Portlet Registry Service not found."); throw new PortletContainerException("Optional Portlet Registry Service not found."); } PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName); for (Supports sd : portletApp.getPortlet(portletName).getSupports()) { if (sd.getMimeType().matches("(?:\\*|\\*/\\*|text/html|text/\\*)")) { for (String pm : sd.getPortletModes()) { modeSet.add((new PortletMode(pm))); } } } return modeSet; }
String appName = portletContext.getApplicationName(); if (appName == null) { throw new PortletContainerException( "Portlet application name should not be null.");
throw new PortletContainerException(e); throw new PortletContainerException(e);