/** * Called to to get the title of the web page * * @param originalPage the decorated sitemesh page * @return the title to use */ public String getPageTitle(Page originalPage) { return getPageTitle(originalPage.getTitle()); }
/** * Called to get the ua.compatible value * * @param originalPage the decorated sitemesh page * @return the ua.compatible value */ public String getXUACompatible(Page originalPage) { String xUaCompatible = originalPage.getProperty(META_X_UA_COMPATIBLE); if (xUaCompatible == null) { xUaCompatible = "IE=Edge"; } return xUaCompatible; }
private Decorator getByProperty(HttpServletRequest request, Page p, String name) { if (p.isPropertySet(name)) { return getNamedDecorator(request, p.getProperty(name)); } return null; } }
String titleHtml = page.getTitle(); if (titleHtml == null || titleHtml.isEmpty()) { titleHtml = "Welcome!"; String htmlClass = page.getProperty("class"); String bodyClass = page.getProperty("body.class"); if (bodyClass != null) { velocityParams.put("bodyClass", bodyClass); page.writeBody(OutputConverter.getWriter(bodyBuffer)); velocityParams.put("bodyHtml", bodyBuffer);
private Map<String, Object> getVelocityParams(HttpServletRequest request, Page page, HttpServletResponse response) throws IOException { Map<String, Object> velocityParams = getDefaultVelocityParams(); velocityParams.put("page", page); velocityParams.put("title", page.getTitle()); StringWriter bodyBuffer = new StringWriter(); page.writeBody(OutputConverter.getWriter(bodyBuffer)); velocityParams.put("body", bodyBuffer); if (page instanceof HTMLPage) { HTMLPage htmlPage = (HTMLPage) page; StringWriter buffer = new StringWriter(); htmlPage.writeHead(OutputConverter.getWriter(buffer)); velocityParams.put("head", buffer.toString()); } // This allows the templates to include JSPs, using $dispatcher.include() velocityParams.put("dispatcher", new BufferingRequestDispatcher(request, response)); velocityParams.put("i18n", getJiraAuthenticationContext().getI18nHelper()); velocityParams.put("req", request); return velocityParams; }
if (pageObject instanceof HTMLPage) model.put("head", ((HTMLPage)pageObject).getHead()); model.put("body", pageObject.getBody()); model.put("title", pageObject.getTitle()); model.put("page.properties", pageObject.getProperties()); template.process(model, writer);
public final int doEndTag() { try { getPage().writeBody(getOut()); } catch (Exception e) { trace(e); } return EVAL_PAGE; }
String k = (String) paramKeys.next(); String v = (String) params.get(k); pageObj.addProperty(k, v); pageObj.setRequest((HttpServletRequest) pageContext.getRequest()); pageContext.getRequest().setAttribute(DECORATOR, decorator); Decorator d = decoratorMapper.getDecorator(((HttpServletRequest) pageContext.getRequest()), pageObj);
public int doEndTag() { Page page = getPage(); page.addProperty("_sitemesh.removefrompage." + getProperty(), "true"); return super.doEndTag(); }
model.put("head", htmlPage.getHead()); model.put("title",page.getTitle()); model.put("body",page.getBody()); model.put("page.properties", new SimpleHash(page.getProperties()));
public void process(Tag tag) { String id = tag.getAttributeValue("id", true); if (!page.isPropertySet("_sitemesh.removefrompage." + id)) { currentBuffer().append(page.getProperty(id)); } } });
public static String getTitle(IRequestCycle cycle) { return getPage(cycle).getTitle(); }
public static String getProperty(String name, IRequestCycle cycle) { return getPage(cycle).getProperty(name); }
public final int doEndTag() { try { String title = getPage().getTitle(); if (title == null || title.trim().length() == 0) title = defaultTitle; if (title != null) getOut().write(title); } catch (Exception e) { trace(e); } return EVAL_PAGE; }
@Override public void run() { includeTopNavigation(out, httpServletRequest, page.getProperty("page.section"), getWebFragmentContext("atl.header")); } });
public String getTitle() { String title = getSiteMeshPage().getTitle(); return Tapestry.isBlank(title) ? getDefault() : title; } }
public int doEndTag() { try { Page page = getPage(); String propertyValue = page.getProperty(propertyName); if (propertyValue == null || propertyValue.trim().length() == 0) propertyValue = defaultValue; if (propertyValue != null) { Writer out = getOut(); if (writeEntireProperty) { out.write(" "); out.write(propertyName.substring(propertyName.lastIndexOf('.') + 1)); out.write("=\""); out.write(propertyValue); out.write("\""); } else { out.write(propertyValue); } } } catch (Exception e) { trace(e); } return EVAL_PAGE; }
public String getValue() { String propertyName = getProperty(); String propertyValue = getSiteMeshPage().getProperty(propertyName); if (Tapestry.isBlank(propertyValue)) { propertyValue = getDefault(); } return propertyValue; } }