Examples of Template


Examples of net.sf.saxon.instruct.Template

        return true;
    }


    public Expression compile(Executable exec) throws XPathException {
        Template target = null;
        NamespaceResolver nsContext = null;

        if (calledTemplateExpression==null) {
            if (template==null) {
                return null;   // error already reported
View Full Code Here

Examples of net.sourceforge.temply.base.project.Template

            }

            TemplyUI ui = TemplyUIFactory.getInstance().getUI(type);
           
            Project project = new Project(projectFileDir);
            Template template = (Template) ui.combo("Template", project.getTemplates());
            if (template == null) {
                return;
            }
            Destination destination = (Destination) ui.combo("Destination", template.getDestinations());
            if (destination == null) {
                return;
            }
            String script = (String) ui.combo("Script", project.getScripts());
            if (script == null) {
View Full Code Here

Examples of net.webpasswordsafe.common.model.Template

   
    private void doAddTemplate()
    {
        if (clientSessionUtil.isAuthorized(Function.ADD_TEMPLATE))
        {
            displayTemplateDialog(new Template());
        }
        else
        {
            MessageBox.alert(textMessages.error(), textMessages.notAuthorized(), null);
        }
View Full Code Here

Examples of org.andromda.core.cartridge.template.Template

        // first template
        final Iterator templateIterator = resources.iterator();
        Resource resource = (Resource)templateIterator.next();
        assertTrue(resource.isLastModifiedCheck());
       
        Template template = (Template)templateIterator.next();
        assertEquals(
            "EntityBean.vsl",
            template.getPath());
        assertEquals(
            "{0}/{1}Bean.java",
            template.getOutputPattern());
        assertEquals(
            "beans",
            template.getOutlet());
        assertTrue(template.isOverwrite());
        assertNotNull(template.getSupportedModeElements());
        assertEquals(
            "entity",
            template.getSupportedModeElements().getVariable());
        Collection modelElements = template.getSupportedModeElements().getModelElements();
        assertNotNull(modelElements);
        assertEquals(
            1,
            modelElements.size());
        ModelElement element = (ModelElement)modelElements.iterator().next();
        assertEquals(
            "Entity",
            element.getStereotype());

        // second template
        template = (Template)templateIterator.next();
        assertEquals(
            "templates/webservice/axis/server-config.wsdd.vsl",
            template.getPath());
        assertEquals(
            "WEB-INF/server-config.wsdd",
            template.getOutputPattern());
        assertEquals(
            "axis-configuration",
            template.getOutlet());
        assertEquals("$viewType.equals('jsp')", template.getOutputCondition());
        assertTrue(template.isOverwrite());
        assertTrue(template.isOutputToSingleFile());
        assertFalse(template.isOutputOnEmptyElements());
        assertNotNull(template.getSupportedModeElements());
        assertEquals(
            "services",
            template.getSupportedModeElements().getVariable());
        modelElements = template.getSupportedModeElements().getModelElements();
        assertNotNull(modelElements);
        assertEquals(
            1,
            modelElements.size());
        element = (ModelElement)modelElements.iterator().next();
View Full Code Here

Examples of org.apache.abdera.i18n.templates.Template

      setTemplate(entry.getKey(),entry.getValue());
    }
  }
 
  public TemplateTargetBuilder setTemplate(Object key, String template) {
    return setTemplate(key, new Template(template));
  }
View Full Code Here

Examples of org.apache.click.eclipse.preferences.Template

    final String filename = page.getFilename();
    final String sourceFolder = page.getSourceFolder();
    final String packageName = page.getPackageName();
    final String className = page.getClassName();
    final String superClass = page.getSuperClass();
    final Template template = page.getTemplate();
    final IProject project = page.getProject();
   
    IDialogSettings settings = getDialogSettings();
    settings.put(SHOULD_CREATE_HTML, shouldCreateHTML);
    settings.put(SHOULD_CREATE_CLASS, shouldCreateClass);
View Full Code Here

Examples of org.apache.flex.forks.velocity.Template

      String path = source.getName();

      StandardDefs standardDefs = info.getStandardDefs();
      String templateName = TemplatePath + standardDefs.getInterfaceDefTemplate();

    Template template = VelocityManager.getTemplate(templateName);
    if (template != null)
    {
      try
      {
        // create a velocity context
        VelocityContext velocityContext = VelocityManager.getCodeGenContext();

        //  SourceCodeBuffer tracks line number change during codegen
        SourceCodeBuffer out = new SourceCodeBuffer((int) source.size());

        //  create SourceCode wrappers for scripts
        Set<SourceCode> scriptSet = new LinkedHashSet<SourceCode>();
        for (Iterator iter = info.getScripts().iterator(); iter.hasNext(); )
        {
          Script script = (Script) iter.next();
          if (!script.isEmbedded())
          {
            scriptSet.add(new SourceCode(script.getText(), script.getXmlLineNumber(), out, map));
          }
          else
          {
            // use Source.getName() to construct the new VirtualFile name
            String n = source.getName().replace('\\', '/') + ":" + script.getXmlLineNumber() + "," + script.getEndXmlLineNumber();
            VirtualFile f = new TextFile(script.getText(), n, source.getParent(), MimeMappings.AS, source.getLastModified());

                        // line number map is for error reporting, so the names must come from error reporting...
                        LineNumberMap m = new LineNumberMap(source.getNameForReporting(), n);

                        m.put(script.getXmlLineNumber(), 1, (script.getEndXmlLineNumber() - script.getXmlLineNumber()));
                        // C: add this so that when unexpected EOF occurs, (last line + 1) maps to the last line
                        //    in the original XML Script block.
                        m.put(script.getEndXmlLineNumber(), script.getEndXmlLineNumber() - script.getXmlLineNumber() + 1, 1);

                        // 'n' must match 'n' in the include directive...
                        source.addSourceFragment(n, f, m);

                        // 'n' must match 'n' in the addSourceFragment call.
                        scriptSet.add(new SourceCode("include \"" + n + "\";", script.getXmlLineNumber(), out, map));
                    }
                }

                //  create SourceCode wrappers for metadata entries
                Set<SourceCode> metadataSet = new LinkedHashSet<SourceCode>();
                for (Iterator iter = info.getMetadata().iterator(); iter.hasNext(); )
                {
                    Script script = (Script)iter.next();
                    metadataSet.add(new SourceCode(script.getText(), script.getXmlLineNumber(), out, map));
                }

                //  create SourceCode wrappers for variable declarations
                Map<String, SourceCode> varDeclMap = new LinkedHashMap<String, SourceCode>();
                for (Iterator iter = info.getVarDecls().values().iterator(); iter.hasNext(); )
                {
                    DocumentInfo.VarDecl varDecl = (DocumentInfo.VarDecl)iter.next();
                    varDeclMap.put(varDecl.name, new SourceCode(varDecl.className, varDecl.line, out, map));
                }

                int superClassLineNumber = 1;

                Set<SourceCode> importNameSet = new LinkedHashSet<SourceCode>();
                for (Iterator i = info.getImportNames().iterator(); i.hasNext();)
                {
                    DocumentInfo.NameInfo importName = (DocumentInfo.NameInfo) i.next();
                    importNameSet.add(new SourceCode(importName.getName(), importName.getLine(), out, map));

                    if (importName.getName().equals(info.getQualifiedSuperClassName()))
                    {
                        superClassLineNumber = importName.getLine();
                    }
                }
                for (Iterator<String> i = bogusImports.iterator(); i.hasNext();)
                {
                    String importName = i.next();
                    importNameSet.add(new SourceCode(importName, 1, out, map));
                }

                Set<SourceCode> interfaceNameSet = new LinkedHashSet<SourceCode>();
                for (Iterator i = info.getInterfaceNames().iterator(); i.hasNext();)
                {
                    DocumentInfo.NameInfo interfaceName = (DocumentInfo.NameInfo) i.next();
                    interfaceNameSet.add(new SourceCode(interfaceName.getName(), interfaceName.getLine(), out, map));
                }

                // register values
                velocityContext.put("imports", importNameSet);
                velocityContext.put("variables", varDeclMap.entrySet());
                velocityContext.put("scripts", scriptSet);
                velocityContext.put("classMetaData", metadataSet);
                velocityContext.put("bindingManagementVariables", FrameworkDefs.bindingManagementVars);

                // C: should really give line number mappings to superclass name and interface names.
                velocityContext.put("superClassName", new SourceCode(info.getQualifiedSuperClassName(), superClassLineNumber, out, map));
                velocityContext.put("interfaceNames", interfaceNameSet);

                velocityContext.put("className", info.getClassName());
                velocityContext.put("packageName", info.getPackageName());

                // run the template!
                //long s2 = System.currentTimeMillis();
                //VelocityManager.parseTime += s2 - start;
                template.merge(velocityContext, out);
                //VelocityManager.mergeTime += System.currentTimeMillis() - s2;

                // Normalize line endings as a temporary work around for bug 149821
                String generated = out.toString().replaceAll("\r\n", "\n");
                String filename = writeGenerated(info, generated);
View Full Code Here

Examples of org.apache.hadoop.gateway.util.urltemplate.Template

    return IGNORE_HEADER_NAMES.contains( name );
  }

  private String rewriteValue( String value, String rule ) {
    try {
      Template input = Parser.parse( value );
      Template output = rewriter.rewrite( this, input, UrlRewriter.Direction.OUT, rule );
      if( output != null ) {
        value = output.toString();
      }
    } catch( URISyntaxException e ) {
      LOG.failedToParseValueForUrlRewrite( value );
    }
    return value;
View Full Code Here

Examples of org.apache.jmeter.gui.action.template.Template

     * @param actionEvent {@link ActionEvent}
     */
    private void checkDirtyAndLoad(final ActionEvent actionEvent)
            throws HeadlessException {
        final String selectedTemplate = templateList.getText();
        final Template template = TemplateManager.getInstance().getTemplateByName(selectedTemplate);
        if (template == null) {
            return;
        }
        final boolean isTestPlan = template.isTestPlan();
        // Check if the user wants to drop any changes
        if (isTestPlan) {
            ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.CHECK_DIRTY));
            GuiPackage guiPackage = GuiPackage.getInstance();
            if (guiPackage.isDirty()) {
                // Check if the user wants to create from template
                int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(),
                        JMeterUtils.getResString("cancel_new_from_template"), // $NON-NLS-1$
                        JMeterUtils.getResString("template_load?")// $NON-NLS-1$
                        JOptionPane.YES_NO_CANCEL_OPTION,
                        JOptionPane.QUESTION_MESSAGE);
                if(response == JOptionPane.YES_OPTION) {
                    ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.SAVE));
                }
                if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.CANCEL_OPTION) {
                    return; // Don't clear the plan
                }
            }
        }
        ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.STOP_THREAD));
        final File parent = template.getParent();
        final File fileToCopy = parent != null
              ? new File(parent, template.getFileName())
              : new File(JMeterUtils.getJMeterHome(), template.getFileName());      
        Load.loadProjectFile(actionEvent, fileToCopy, !isTestPlan, false);
        this.setVisible(false);
    }
View Full Code Here

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

                templateFile = "group-rss.vm";
            } else if("atom".equals(feedRequest.getFormat())) {
                templateFile = "group-atom.vm";
            }
           
            Template template = new StaticTemplate(templateFile, null, "velocity");
            renderer = RendererManager.getRenderer(template);
        } catch(Exception e) {
            // nobody wants to render my content :(

            if(!response.isCommitted()) response.reset();
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.