@Override public PortletContext getPortletContext() { return wrapped.getPortletContext(); }
/** * Returns the <code>PortletContext</code> of the portlet application the * portlet is in. * * @return the portlet application context */ public PortletContext getPortletContext() { if (config == null) throw new java.lang.IllegalStateException( "Config is null, please ensure that your init(config) method calls super.init(config)"); return config.getPortletContext(); }
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
@Override public ServletConfig getServletConfig( PortletConfig portletConfig, PortletRequest portletRequest) { PortletContext portletContext = portletConfig.getPortletContext(); Object servletConfig = portletContext.getAttribute( _PORTLET_CONTAINER_SERVLET_CONFIG); if (servletConfig == null) { servletConfig = portletRequest.getAttribute( PortletServlet.PORTLET_SERVLET_CONFIG); } return (ServletConfig)servletConfig; }
protected PortletRequestDispatcher getPortletRequestDispatcher( ResourceRequest resourceRequest, String path) { PortletConfig portletConfig = getPortletConfig(resourceRequest); PortletContext portletContext = portletConfig.getPortletContext(); return portletContext.getRequestDispatcher(path); }
protected void include( ResourceRequest resourceRequest, ResourceResponse resourceResponse, String jspPath) throws IOException, PortletException { PortletConfig portletConfig = getPortletConfig(resourceRequest); PortletContext portletContext = portletConfig.getPortletContext(); PortletRequestDispatcher portletRequestDispatcher = portletContext.getRequestDispatcher(jspPath); portletRequestDispatcher.include(resourceRequest, resourceResponse); }
final PortletContext context = config.getPortletContext(); for (final Enumeration<String> e = context.getInitParameterNames(); e .hasMoreElements();) {
@Override public void setPortletConfig(PortletConfig portletConfig) { this.portletConfig = portletConfig; if (portletConfig != null && this.portletContext == null) { this.portletContext = portletConfig.getPortletContext(); } }
public void setPortletConfig(PortletConfig portletConfig) { this.portletConfig = portletConfig; if (portletConfig != null && this.portletContext == null) { this.portletContext = portletConfig.getPortletContext(); } }
@Override public void setPortletConfig(PortletConfig portletConfig) { this.portletConfig = portletConfig; if (portletConfig != null && this.portletContext == null) { this.portletContext = portletConfig.getPortletContext(); } }
/** * Create a new PortletContextAwareProcessor for the given context and config. */ public PortletContextAwareProcessor(PortletContext portletContext, PortletConfig portletConfig) { this.portletContext = portletContext; this.portletConfig = portletConfig; if (portletContext == null && portletConfig != null) { this.portletContext = portletConfig.getPortletContext(); } }
public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); normalView = portletConfig.getPortletContext().getRequestDispatcher( "/WEB-INF/view/jmsmanager/server/normal.jsp"); maximizedView = portletConfig.getPortletContext().getRequestDispatcher( "/WEB-INF/view/jmsmanager/server/maximized.jsp"); helpView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/jmsmanager/server/help.jsp"); editView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/jmsmanager/server/edit.jsp"); }
public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); normalView = portletConfig.getPortletContext().getRequestDispatcher( NORMALVIEW_JSP); maximizedView = portletConfig.getPortletContext().getRequestDispatcher( MAXIMIZEDVIEW_JSP); helpView = portletConfig.getPortletContext().getRequestDispatcher( HELPVIEW_JSP); }
@Override @SuppressWarnings("unchecked") public Map<String, String> getDefaultViewIdMap() { if (defaultViewIdMap == null) { String portletName = portletConfig.getPortletName(); String attrNameDefaultViewIdMap = Bridge.BRIDGE_PACKAGE_PREFIX + portletName + "." + Bridge.DEFAULT_VIEWID_MAP; defaultViewIdMap = (Map<String, String>) portletConfig.getPortletContext().getAttribute( attrNameDefaultViewIdMap); } return defaultViewIdMap; }
/** * Overridden method that simply returns {@code null} when no * PortletConfig set yet. * @see #getPortletConfig() */ @Override public final PortletContext getPortletContext() { return (getPortletConfig() != null ? getPortletConfig().getPortletContext() : null); }
@Override public ResourceResponse getResourceResponse(ResourceRequest resourceRequest, ResourceResponse resourceResponse, PortletConfig portletConfig, BridgeConfig bridgeConfig) { ResourceResponse wrappedResourceResponse = getWrapped().getResourceResponse(resourceRequest, resourceResponse, portletConfig, bridgeConfig); PortletContext portletContext = portletConfig.getPortletContext(); return new ResourceResponseBridgeLiferayImpl(portletContext, resourceRequest, wrappedResourceResponse); }
@Override public BridgeConfig getBridgeConfig(PortletConfig portletConfig) { PortletContext portletContext = portletConfig.getPortletContext(); BridgeConfig bridgeConfig = (BridgeConfig) portletContext.getAttribute(BRIDGE_CONFIG); if (bridgeConfig == null) { bridgeConfig = new BridgeConfigImpl(portletConfig); portletContext.setAttribute(BRIDGE_CONFIG, bridgeConfig); } return bridgeConfig; }
public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); PortletContext pc = portletConfig.getPortletContext(); normalView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/normal.jsp"); maximizedView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/maximized.jsp"); helpView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/help.jsp"); editConnectorView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/editConnector.jsp"); }
/** * */ private void prepareServletActionContext() throws PortletException, IOException { PortletRequestDispatcher disp = PortletActionContext.getPortletConfig() .getPortletContext().getNamedDispatcher("preparator"); disp.include(PortletActionContext.getRenderRequest(), PortletActionContext.getRenderResponse()); } }
/** * */ private void prepareServletActionContext() throws PortletException, IOException { PortletRequestDispatcher disp = PortletActionContext.getPortletConfig() .getPortletContext().getNamedDispatcher("preparator"); disp.include(PortletActionContext.getRenderRequest(), PortletActionContext.getRenderResponse()); }