@Test public void testNoPage() throws Exception { resourceProperties.put("path", "/content/nopage"); servlet.doGet(request, response); RenderCondition renderCondition = (RenderCondition) request.getAttribute(RenderCondition.class.getName()); assertNotNull(renderCondition); assertFalse(renderCondition.check()); }
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { final Config cfg = new Config(request.getResource()); final SlingScriptHelper sling = ((SlingBindings) request.getAttribute(SlingBindings.class.getName())).getSling(); final ExpressionHelper ex = new ExpressionHelper(sling.getService(ExpressionResolver.class), request); final String path = ex.getString(cfg.get("path", String.class)); boolean decision = isProductListPage(path, request.getResourceResolver()); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); if (decision) { prepareCatalogPathProperty(path, request); } }
IsProductListPageServlet extends SlingSafeMethodsServlet { protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { final Config cfg = new Config(request.getResource()); final SlingScriptHelper sling = ((SlingBindings) request.getAttribute(SlingBindings.class.getName())).getSling(); final ExpressionHelper ex = new ExpressionHelper(sling.getService(ExpressionResolver.class), request); final String path = ex.getString(cfg.get("path", String.class)); boolean decision = isProductListPage(path, request.getResourceResolver()); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); if (decision) { prepareCatalogPathProperty(path, request); } } }
IsProductListPageServlet extends SlingSafeMethodsServlet { protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { final Config cfg = new Config(request.getResource()); final SlingScriptHelper sling = ((SlingBindings) request.getAttribute(SlingBindings.class.getName())).getSling(); final ExpressionHelper ex = new ExpressionHelper(sling.getService(ExpressionResolver.class), request); final String path = ex.getString(cfg.get("path", String.class)); boolean decision = isProductListPage(path, request.getResourceResolver()); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); if (decision) { prepareCatalogPathProperty(path, request); } }  }
IsProductListPageServlet extends SlingSafeMethodsServlet { protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { final Config cfg = new Config(request.getResource()); final SlingScriptHelper sling = ((SlingBindings) request.getAttribute(SlingBindings.class.getName())).getSling(); final ExpressionHelper ex = new ExpressionHelper(sling.getService(ExpressionResolver.class), request); final String path = ex.getString(cfg.get("path", String.class)); boolean decision = isProductListPage(path, request.getResourceResolver()); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); if (decision) { prepareCatalogPathProperty(path, request); } }   }
IsProductListPageServlet extends SlingSafeMethodsServlet { protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { final Config cfg = new Config(request.getResource()); final SlingScriptHelper sling = ((SlingBindings) request.getAttribute(SlingBindings.class.getName())).getSling(); final ExpressionHelper ex = new ExpressionHelper(sling.getService(ExpressionResolver.class), request); final String path = ex.getString(cfg.get("path", String.class)); boolean decision = isProductListPage(path, request.getResourceResolver()); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); if (decision) { prepareCatalogPathProperty(path, request); } }    }