Examples of Template


Examples of org.apache.roller.pojos.Template

              
        // if there is an "_entry" page, only load it once
        // but don't do it for dummy website
        if (weblog != null && !"zzz_none_zzz".equals(weblog.getHandle())) {
            // alternative display pages - customization
            Template entryPage = weblog.getPageByName("_entry");
            if (entryPage != null) {
                ctx.put("entryPage", TemplateWrapper.wrap(entryPage));
            }
            Template descPage = weblog.getPageByName("_desc");
            if (descPage != null) {
                ctx.put("descPage", TemplateWrapper.wrap(descPage));
            }
        }
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.Template

        // lookup Renderer we are going to use
        Renderer renderer = null;
        try {
            log.debug("Looking up renderer");
            Template template = new StaticTemplate(pageId, "velocity");
            renderer = RendererManager.getRenderer(template);
        } catch(Exception e) {
            // nobody wants to render my content :(

            // TODO: this log message has been disabled because it fills up
View Full Code Here

Examples of org.apache.sirona.reporting.web.plugin.api.Template

import static org.apache.sirona.reporting.web.plugin.api.graph.Graphs.generateReport;

public class HazelcastEndpoints {
    @Regex
    public Template home() {
        return new Template("hazelcast/home.vm");
    }
View Full Code Here

Examples of org.apache.struts2.components.template.Template

        int themeEndIndex = name.indexOf('/', tokenIndex);
        if (themeEndIndex < 0) {
            return parentTemplateLoader.findTemplateSource(name);
        }

        Template template = new Template(
            name.substring(0, tokenIndex - 1),
            name.substring(tokenIndex + themeExpansionToken.length(), themeEndIndex),
            name.substring(themeEndIndex + 1));
       
        List<Template> possibleTemplates = template.getPossibleTemplates(templateEngine);
        for (Template possibleTemplate : possibleTemplates) {
            Object templateSource = parentTemplateLoader.findTemplateSource(
                    possibleTemplate.toString().substring(1));
            if (templateSource != null) {
                return templateSource;
            }
        }
        String parentTheme = (String) templateEngine.getThemeProps(template).get("parent");
        if (parentTheme == null) {
            // no parent theme, no way to fetch parent template
            return null;
        }
        String parentName = "/" + template.getDir() + "/" + themeExpansionToken + parentTheme + "/" + template.getName();
        return this.findTemplateSource(parentName);
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.Template

                                                    OMElement elem, Properties properties) {

        TemplateFactory templateFactory = new TemplateFactory();
        String name = elem.getAttributeValue(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));
        try {
            Template template = templateFactory.createEndpointTemplate(elem, properties);
            if (template != null) {
                config.addEndpointTemplate(template.getName(), template);
            }
            return template;
        } catch (Exception e) {
            String msg = "Endpoint Template: " + name + "configuration cannot be built";
            handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_TEMPLATES, msg, e);
View Full Code Here

Examples of org.apache.velocity.Template

    Boolean inChain = result.isInChain();
    if((inChain==null || !inChain) &&(result.getErrorType() != null || result.getInvalidValues() != null)){
      url = annotation.error().value();
    }
    //获取模板
    Template template = Velocity.getTemplate(url, "utf-8");
    //往上下文中填入数据
    context.put("ctxPath", this.request.getContextPath());
    context.put("ctx", result);
    context.put("xctx",request.getSession().getAttribute(HtmlResponseWriter.OPTION_KEY));
    //输出到用户端
    StringWriter writer = new StringWriter();
    template.merge(context, writer);
    String content = writer.toString();
    out.write(content.getBytes());
  }
View Full Code Here

Examples of org.bee.tl.core.Template

    public void render() {
        Writer writer = null;
        OutputStream os = null;
        try {
            response.setContentType(contentType);
            Template template = gt.getFileTemplate(view);
            Enumeration<String> attrs = request.getAttributeNames();
            while (attrs.hasMoreElements()) {
                String attrName = attrs.nextElement();
                template.set(attrName, request.getAttribute(attrName));

            }
            WebVariable webVariable = new WebVariable();
            webVariable.setRequest(request);
            webVariable.setResponse(response);
            webVariable.setSession(request.getSession());
            template.set("servlet", webVariable);
            template.set("request", request);
            template.set("ctxPath", request.getContextPath());
            if (gt.isDirectByteOutput()) {
                os = response.getOutputStream();
                template.getText(os);
            } else {
                writer = response.getWriter();
                template.getText(writer);
            }

        } catch (Exception e) {
            throw new RenderException(e);
        } finally {
View Full Code Here

Examples of org.commontemplate.core.Template

     
      HttpSession session = this.request.getSession();
      url = session.getServletContext().getRealPath("/")+url;
     
      //获取模板
      Template template = this.engine.getTemplate(url);
      //往上下文中填入数据
      this.context.put("ctxPath", this.request.getContextPath());
      UserRole userPrincipal = this.securityContext.getUserPrincipal();
      this.context.put(SecurityContext.CURRENT_USER_ROlE, userPrincipal);
      this.context.put(SecurityContext.USER_IS_LOGIN, userPrincipal!=null);
      this.context.put("ctx", result);
      this.context.put("xctx",session.getAttribute(HtmlResponseWriter.OPTION_KEY));
     
      template.render(this.context);
     
      String content = this.context.getOut().toString();
     
      //输出到页面
      out.write(content.getBytes("utf-8"));
View Full Code Here

Examples of org.cx4a.rsense.typing.Template

        if (receiverType != null) {
            Method method = (Method) receiverType.searchMethod(name);
            if (method != null
                && (method.getVisibility() != Visibility.PRIVATE
                    || vertex.hasPrivateVisibility())) {
                Template template = method.getTemplate(attr);
                if (template == null) {
                    template = createTemplate(graph, vertex, name, method, attr);
                    Logger.debug(SourceLocation.of(vertex), "template created: %s", method);
                } else {
                    template.reproduceSideEffect(graph, receiver, args, vertex.getBlock());
                    Logger.debug(SourceLocation.of(vertex), "template reused: %s", method);
                }
                return template.getReturnVertex();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.jface.text.templates.Template

     *            a source offset into the parent compilation unit. The template is evaluated at the given source offset
     * @return return the template with the given name or <code>null</code> if the template could not be found.
     */
    protected String getTemplate(String name, ICompilationUnit parentCU, int pos) {
        try {
            Template template = JavaPlugin.getDefault().getTemplateStore().findTemplate(name);
            if (template != null) {
                return JavaContext.evaluateTemplate(template, parentCU, pos);
            }
        } catch (CoreException e) {
            JavaPlugin.log(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.