/** * Performs the filter chain inclusion, setting the WCMMode before and after the inclusion. * * @param request the request * @param response the response * @param chain the filter chain * @param before the WCMMode to apply before the filter chaining * @param after the WCMMode to apply before the filter chaining * @throws IOException * @throws ServletException */ private void processChain(final ServletRequest request, final ServletResponse response, final FilterChain chain, final WCMMode before, final WCMMode after) throws IOException, ServletException { before.toRequest(request); chain.doFilter(request, response); after.toRequest(request); }
/** * Performs the filter chain inclusion, setting the WCMMode before and after the inclusion. * * @param request the request * @param response the response * @param chain the filter chain * @param before the WCMMode to apply before the filter chaining * @param after the WCMMode to apply before the filter chaining * @throws IOException * @throws ServletException */ private void processChain(final ServletRequest request, final ServletResponse response, final FilterChain chain, final WCMMode before, final WCMMode after) throws IOException, ServletException { before.toRequest(request); chain.doFilter(request, response); after.toRequest(request); }
/** * {@inheritDoc} */ @Override public int doStartTag() throws JspException { final WCMMode toSet = WCMMode.valueOf(mode); final ServletRequest request = pageContext.getRequest(); this.oldMode = WCMMode.fromRequest(request); toSet.toRequest(request); return EVAL_BODY_INCLUDE; }
/** * {@inheritDoc} */ @Override public int doStartTag() throws JspException { final WCMMode toSet = WCMMode.valueOf(mode); final ServletRequest request = pageContext.getRequest(); this.oldMode = WCMMode.fromRequest(request); toSet.toRequest(request); return EVAL_BODY_INCLUDE; }
@Override public void processGet(final ComponentServletRequest request) throws ServletException, IOException { final SlingHttpServletRequest slingRequest = request.getSlingRequest(); final SlingHttpServletResponse slingResponse = request.getSlingResponse(); WCMMode.DISABLED.toRequest(slingRequest); try { final List<Paragraph> paragraphs = getParagraphs(request); if (paragraphs != null) { LOG.debug("{} paragraphs found on page", paragraphs.size()); writeJsonResponse(slingResponse, ImmutableMap.of("paragraphs", paragraphs)); } else { LOG.info("null returned, indicating a lack of page or a lack of content"); slingResponse.sendError(HttpServletResponse.SC_NOT_FOUND); } } catch (RepositoryException e) { LOG.error("error requesting paragraph HTML for contained components", e); slingResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }