@Override public PortletContext getPortletContext() { return wrapped.getPortletContext(); }
@Override public InputStream getThemeResourceAsStream(UI uI, String themeName, String resource) { VaadinPortletSession session = (VaadinPortletSession) uI.getSession(); PortletContext portletContext = session.getPortletSession() .getPortletContext(); return portletContext .getResourceAsStream("/" + VaadinPortlet.THEME_DIR_PATH + '/' + themeName + "/" + resource); }
public PortletContext getPortletContext() { return getPortletSession().getPortletContext(); }
public javax.servlet.ServletContext getServletContext() { return PortletServletContext.getInstance(_sess.getPortletContext()); }
public PortletContext getPortletContext() { return getPortletSession().getPortletContext(); }
protected URI getXslUri(RenderRequest req) { if (xslUri == null) { // see if this is a well-formed URL xslUri = URI.create(xslUriStr); if ( !xslUri.isAbsolute() ) { try { xslUri = URI.create(req.getPortletSession().getPortletContext().getResource(xslUriStr).toString()); } catch (MalformedURLException e) { throw new IllegalArgumentException( "Misconfigured xslUri property: " + xslUriStr, e); } } } return xslUri; } public IPortletServant getPermissionsManagerServant() {
public SortedSet<String> getSkinNames(PortletRequest request) { PortletContext ctx = request.getPortletSession().getPortletContext();
private BundleContext getBundleContext(PortletRequest request) { return (BundleContext) request.getPortletSession().getPortletContext().getAttribute("osgi-bundlecontext"); } }
protected URI getFileUri(String parameterName, RenderRequest req) { URI uri; String str_uri = req.getPreferences().getValue(parameterName, null); try { // see if this is a well-formed URL uri = URI.create(str_uri); if (!uri.isAbsolute()) { uri = URI.create(req.getPortletSession() .getPortletContext() .getResource(str_uri) .toString()); } } catch (Exception any) { final RuntimeException e = new RuntimeException("malformed " + parameterName + " value specified : str_xslUri=" + str_uri, any); logger.error(e.getMessage(), e); throw e; } return uri; }
private BundleContext getBundleContext(PortletRequest request) { return (BundleContext) request.getPortletSession().getPortletContext().getAttribute("osgi-bundlecontext"); }
private void initializePortletConfig(PortletRequest req) { IPortletWindow window = transientPortletWindowRegistry.createTransientPortletWindowControl(permissionsManagerFunctionName); if (window == null) { throw new PortalRuntimeException("Could not find the permissions manager portlet definition with the functional name="+permissionsManagerFunctionName); } //TODO fix this once the pluto resource bundle is available // Locale locale = window.getPortletInfo().getLocale(); // ResourceBundle resourceBundle = window.getPortletInfo().getResourceBundle(locale); Map<Locale, ResourceBundle> resourceBundles = new HashMap<Locale, ResourceBundle>(1); // resourceBundles.put(locale, resourceBundle); WrappedPortletConfig config = new WrappedPortletConfig(portletName, req.getPortletSession().getPortletContext(), resourceBundles, initParameters); super.setPortletConfig(config); super.setPortletContext(req.getPortletSession().getPortletContext()); }
/** * Gets the PortletContext from the PortletSession (Creating one if nessesary) * and uses it to create a request dispatcher for the specified resource which * the request is included in the response. * * @param request The request to get the session from and include with. * @param response The response to include with. * @param resource The path to the resource for the portlet request dispatcher. * @throws PortletException See: {@link PortletRequestDispatcher#include(javax.portlet.RenderRequest, javax.portlet.RenderResponse)} * @throws IOException See: {@link PortletRequestDispatcher#include(javax.portlet.RenderRequest, javax.portlet.RenderResponse)} */ public static void dispatch(RenderRequest request, RenderResponse response, String resource) throws PortletException, IOException { final PortletSession session = request.getPortletSession(true); final PortletContext context = session.getPortletContext(); final PortletRequestDispatcher dispatcher = context.getRequestDispatcher(resource); dispatcher.include(request, response); } }
public DefaultDynamicSkinInstanceDataImpl(final PortletRequest request) { this.pullDataFromPortletPreferences(request.getPreferences()); this.pullDataFromPortletContext(request.getPortletSession().getPortletContext()); this.portletRequest = request; }
protected XWikiContext initializeXWikiContext(PortletRequest portletRequest, PortletResponse portletResponse) throws XWikiException, PortletException { XWikiRequest request = new XWikiPortletRequest(portletRequest); XWikiResponse response = new XWikiPortletResponse(portletResponse); XWikiEngineContext engineContext = new XWikiPortletContext(portletRequest.getPortletSession().getPortletContext()); String action = request.getParameter("action"); if ((action == null) || (action.equals(""))) { if (RenderRequest.class.isAssignableFrom(portletRequest.getClass())) { action = portletRequest.getPortletMode().equals(CONFIG_PORTLET_MODE) ? "portletConfig" : "view"; } else { action = "view"; } } XWikiContext context = Utils.prepareContext(action, request, response, engineContext); // Initialize the Container component which is the new of transporting the Context in the new // component architecture. initializeContainerComponent(context); return context; }
/** * Method description * * * @param request * @param response * @param chain * * @throws IOException * @throws PortletException */ @Override public void doFilter(ActionRequest request, ActionResponse response, FilterChain chain) throws IOException, PortletException { logger .trace("action - doFilter " + request.getPortletSession().getPortletContext() .getPortletContextName()); chain.doFilter(request, response); releaseConnection(); logger .trace("action - released connection " + request.getPortletSession().getPortletContext() .getPortletContextName()); }
/** * Method description * * * @param request * @param response * @param chain * * @throws IOException * @throws PortletException */ @Override public void doFilter(ResourceRequest request, ResourceResponse response, FilterChain chain) throws IOException, PortletException { logger .trace("resource - doFilter " + request.getPortletSession().getPortletContext() .getPortletContextName()); chain.doFilter(request, response); releaseConnection(); logger .trace("resource - released connection " + request.getPortletSession().getPortletContext() .getPortletContextName()); }
/** * Method description * * * @param request * @param response * @param chain * * @throws IOException * @throws PortletException */ @Override public void doFilter(RenderRequest request, RenderResponse response, FilterChain chain) throws IOException, PortletException { logger .trace("render - doFilter " + request.getPortletSession().getPortletContext() .getPortletContextName()); chain.doFilter(request, response); releaseConnection(); logger .trace("render - release connection " + request.getPortletSession().getPortletContext() .getPortletContextName()); }
PortletContext portletContext = renderRequest.getPortletSession().getPortletContext();
public void perform(TaskRequest req, TaskResponse res) { RenderRequest preq = (RenderRequest) request.evaluate(req, res); RenderResponse pres = (RenderResponse) response.evaluate(req, res); String rsc = (String) resource.evaluate(req, res); try { // Load the PortletRequest... for (String key : req.getAttributeNames()) { preq.setAttribute(key, req.getAttribute(key)); } PortletRequestDispatcher prd = preq.getPortletSession(true).getPortletContext().getRequestDispatcher(rsc); prd.include(preq, pres); } catch (Throwable t) { String msg = "Error dispatching to the specified resource: " + rsc; throw new RuntimeException(msg, t); } }