Examples of Template


Examples of com.floreysoft.jmte.template.Template

    return transformInternal(template, locale, sourceName, model, modelAdaptor, processListener);
  }

  String transformInternal(String template, Locale locale, String sourceName, Map<String, Object> model,
      ModelAdaptor modelAdaptor, ProcessListener processListener) {
    Template templateImpl = getTemplate(template, sourceName);
    String output = templateImpl.transform(model, locale, modelAdaptor, processListener);
    return output;
  }
View Full Code Here

Examples of com.force.sdk.codegen.template.Template

        assert objectFilter != null;
       
        FieldFilter fieldFilter = getFieldFilter();
        assert fieldFilter != null;
       
        Template template = getTemplate();
        assert template != null;
       
        TemplateInjector templateInjector = getTemplateInjector();
        assert templateInjector != null;
       
        WriterProvider writerProvider = getWriterProvider(destDir);
        assert writerProvider != null;
       
        // Write filtered data to the template
        int numGeneratedCode = 0;
       
        for (DescribeSObjectResult dsr : objectFilter.filter(allOrgObjects)) {
            // Before we write a new source file, make sure the template is reset
            template.reset();
           
            // Inject the data into the template
            templateInjector.inject(userInfo, dsr, fieldFilter.filter(dsr), template);
           
            Writer writer = null;
            try {
                writer = writerProvider.getWriter(userInfo, dsr);
                template.write(writer);
                numGeneratedCode++;
            } finally {
                if (writer != null) writer.close();
            }
        }
View Full Code Here

Examples of com.freewebsys.blog.pojo.Template

      HttpServletResponse response,
      @RequestParam(value = "name", required = true) String name,
      @RequestParam(value = "path", required = true) String path,
      ModelMap model) throws Exception {

    Template template = new Template();
    template.setName(name);
    template.setPath(path);

    File theme = new File(FreemakerTemplateEngine.WEBAPP_PATH + THEME_PATH
        + path + "/" + name);
    String content = FileUtils.readFileToString(theme, "utf-8");
    template.setContent(content);
    // 将内容放到表单里面
    model.addAttribute("templateAttribute", template);
    return "/admin/template/templateForm";
  }
View Full Code Here

Examples of com.github.jknack.handlebars.Template

            Map<String, List<String>> context = new HashMap<String, List<String>>();
            context.put(PLUGIN_JS_RESOURCES_PARAM, app.getPluginsJsResources());
            context.put(PLUGIN_CSS_RESOURCES_PARAM, app.getPluginsCssResources());
            TemplateLoader templateLoader = new ServletContextTemplateLoader(request.getServletContext(), "/", ".hbs");
            Handlebars handlebars = new Handlebars(templateLoader);
            Template template = handlebars.compile("index");
            indexHtml = template.apply(context);
        }
        return indexHtml;
    }
View Full Code Here

Examples of com.google.clearsilver.jsilver.template.Template

  }

  // This method should ONLY be called from include()
  private void loadAndRenderIncludedTemplate(String templateName, boolean ignoreMissingFile,
      RenderingContext context) {
    Template template = null;
    try {
      template =
          templateLoader.load(templateName, context.getResourceLoader(), context
              .getAutoEscapeMode());
    } catch (RuntimeException e) {
      if (ignoreMissingFile && ExceptionUtil.isFileNotFoundException(e)) {
        return;
      } else {
        throw e;
      }
    }
    // Intepret loaded template.
    try {
      template.render(context);
    } catch (IOException e) {
      throw new JSilverInterpreterException(e.getMessage());
    }
  }
View Full Code Here

Examples of com.google.gwt.safehtml.client.SafeHtmlTemplates.Template

        SafeHtmlTemplatesImplMethodCreator.SAFE_HTML_FQCN)) {
      throw error(logger, "All methods in interfaces extending "
          + "SafeHtmlTemplates must have a return type of "
          + SafeHtmlTemplatesImplMethodCreator.SAFE_HTML_FQCN + ".");
    }
    Template templateAnnotation = targetMethod.getAnnotation(Template.class);
    if (templateAnnotation == null) {
      throw error(logger, "Required annotation @Template not present "
          + "on interface method " + targetMethod.toString());
    }

    String template = templateAnnotation.value();
    JParameter[] params = targetMethod.getParameters();
    emitMethodBodyFromTemplate(logger, template, params);
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Template

                           List<ThrowsDeclaration> throwsDeclarations,
                           List<Parameter> parameters,
                           List<FormalTypeParameter> formalTypeParameters,
                           Expression content) {
    Constructor constructor = Constructor.empty(pos, "<gxp:template>");
    return new Template(pos, "<gxp:template>", fqTemplateName(dottedName),
                        schema, Collections.<JavaAnnotation>emptyList(), constructor, imports,
                        Collections.<ImplementsDeclaration>emptyList(),
                        throwsDeclarations,
                        parameters, formalTypeParameters,
                        content);
View Full Code Here

Examples of com.google.refine.templating.Template

        String templateString = options.getProperty("template");
        String prefixString = options.getProperty("prefix");
        String suffixString = options.getProperty("suffix");
        String separatorString = options.getProperty("separator");
       
        Template template;
        try {
            template = Parser.parse(templateString);
        } catch (ParsingException e) {
            throw new IOException("Missing or bad template", e);
        }
       
        template.setPrefix(prefixString);
        template.setSuffix(suffixString);
        template.setSeparator(separatorString);
       
        if (!"true".equals(options.getProperty("preview"))) {
            StringWriter stringWriter = new StringWriter();
            JSONWriter jsonWriter = new JSONWriter(stringWriter);
            try {
                jsonWriter.object();
                jsonWriter.key("template"); jsonWriter.value(templateString);
                jsonWriter.key("prefix"); jsonWriter.value(prefixString);
                jsonWriter.key("suffix"); jsonWriter.value(suffixString);
                jsonWriter.key("separator"); jsonWriter.value(separatorString);
                jsonWriter.endObject();
            } catch (JSONException e) {
                // ignore
            }
           
            project.getMetadata().getPreferenceStore().put("exporters.templating.template", stringWriter.toString());
        }
       
        if (engine.getMode() == Mode.RowBased) {
            FilteredRows filteredRows = engine.getAllFilteredRows();
            RowVisitor visitor = template.getRowVisitor(writer, limit);
           
            if (sortingJson != null) {
                try {
                    SortingRowVisitor srv = new SortingRowVisitor(visitor);
                    srv.initializeFromJSON(project, sortingJson);
                   
                    if (srv.hasCriteria()) {
                        visitor = srv;
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
           
            filteredRows.accept(project, visitor);
        } else {
            FilteredRecords filteredRecords = engine.getFilteredRecords();
            RecordVisitor visitor = template.getRecordVisitor(writer, limit);
           
            if (sortingJson != null) {
                try {
                    SortingRecordVisitor srv = new SortingRecordVisitor(visitor);
                    srv.initializeFromJSON(project, sortingJson);
View Full Code Here

Examples of com.google.sitebricks.Template

    TemplateRegistry registry = new SimpleTemplateRegistry();

    for (RegisteredTemplate template : templates) {
      String templateName = template.getName();
      Class<?> pageClass = template.getPageClass();
      Template loadedTemplate = loader.load(pageClass);

      CompiledTemplate compiledTemplate;
      compiledTemplate = TemplateCompiler.compileTemplate(loadedTemplate.getText());

      registry.addNamedTemplate(templateName, compiledTemplate);
    }

    return registry;
View Full Code Here

Examples of com.griaule.grfingerjava.Template

        if (!grInitialized) {
            init();
        }
        fingerprint = f;
        if (useFingerprintSdk) {
            grTemplate = new Template(f.getTemplate());
        }
    }
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.