Package org.objectstyle.wolips.templateengine

Examples of org.objectstyle.wolips.templateengine.TemplateDefinition


    // create src dirs
    String fullPackagePath = (packagePath != null && packagePath.length() > 0) ? rootPath + File.separator + "src" + File.separator + packagePath : rootPath + File.separator + "src";
    File srcPath = new File(fullPackagePath);
    srcPath.mkdirs();

    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".html.vm", componentPath, name + ".html", name + ".html"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".wod.vm", componentPath, name + ".wod", name + ".wod"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".woo.vm", componentPath, name + ".woo", name + ".woo"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".api.vm", rootPath, name + ".api", name + ".api"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".java.vm", fullPackagePath, name + ".java", name + ".java"));
  }
View Full Code Here


      path = project.getLocation().toOSString();
    }

    if (_webservicesSupportPage != null) {
      if (_webservicesSupportPage.getClientSupport()) {
        engine.addTemplate(new TemplateDefinition("wowebservices" + "/client.wsdd.vm", path, "client.wsdd", "client.wsdd"));
      }

      if (_webservicesSupportPage.getServerSupport()) {
        engine.addTemplate(new TemplateDefinition("wowebservices" + "/server.wsdd.vm", path, "server.wsdd", "server.wsdd"));
      }
    }
  }
View Full Code Here

public abstract class AbstractWonderProjectWizard extends AbstractProjectWizard {

  protected void addComponentDefinition(String templateFolder, TemplateEngine engine, String path, String name) {
    File wo = new File(path + File.separator + "Components" + File.separator + name + ".wo");
    wo.mkdirs();
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".html.vm", path + File.separator + "Components" + File.separator  + name + ".wo", name + ".html", name + ".html"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".wod.vm", path + File.separator + "Components" + File.separator  + name + ".wo", name + ".wod", name + ".wod"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".woo.vm", path + File.separator + "Components" + File.separator  + name + ".wo", name + ".woo", name + ".woo"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".api.vm", path + File.separator + "Components", name + ".api", name + ".api"));
    engine.addTemplate(new TemplateDefinition(templateFolder + "/" + name + ".java.vm", path + File.separator + "Sources", name + ".java", name + ".java"));
  }
View Full Code Here

    bin.mkdirs();
    // project.close(nullProgressMonitor);
    TemplateEngine templateEngine = new TemplateEngine();
    templateEngine.init();
    templateEngine.getWolipsContext().setProjectName(projectName);
    templateEngine.addTemplate(new TemplateDefinition("jarproject/.classpath.vm", path, ".classpath", ".classpath"));
    templateEngine.addTemplate(new TemplateDefinition("jarproject/.project.vm", path, ".project", ".project"));
    templateEngine.addTemplate(new TemplateDefinition("jarproject/build.xml.vm", path, "build.xml", "build.xml"));
    templateEngine.addTemplate(new TemplateDefinition("jarproject/build.properties.vm", path, "build.properties", "build.properties"));
    templateEngine.run(progressMonitor);
  }
View Full Code Here

    } catch (Exception e) {
      WizardsPlugin.getDefault().log(e);
      throw new InvocationTargetException(e);
    }
    templateEngine.getWolipsContext().setProjectName(subprojectName);
    templateEngine.addTemplate(new TemplateDefinition("subproject/PB.project.vm", path, "PB.project", "PB.project"));
    try {
      templateEngine.run(new NullProgressMonitor());
    } catch (Exception e) {
      WizardsPlugin.getDefault().log(e);
      throw new InvocationTargetException(e);
View Full Code Here

    addMavenComponentDefinition(pathRoot, templateEngine, path, "Main", packagePath);
    addMavenComponentDefinition(pathRoot, templateEngine, path, "MenuHeader", packagePath);
    addMavenComponentDefinition(pathRoot, templateEngine, path, "PageWrapper", packagePath);

    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/Application.java.vm", fullSrcPath, "Application.java", "Application.java"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/DirectAction.java.vm", fullSrcPath, "DirectAction.java", "DirectAction.java"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/Session.java.vm", fullSrcPath, "Session.java", "Session.java"));

    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/.classpath.vm", path, ".classpath", ".classpath"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/.project.vm", path, ".project", ".project"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/build.xml.vm", path, "build.xml", "build.xml"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/build.properties.vm", path, "build.properties", "build.properties"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/Properties.vm", path, "Properties", "Properties"));
    templateEngine.addTemplate(new TemplateDefinition(pathRoot+"/user.d2wmodel.vm", path, "user.d2wmodel", "user.d2wmodel"));

    createWebServicesSupport(project, templateEngine);

    templateEngine.run(progressMonitor);
View Full Code Here

  /**
   *
   */
  public void testConstructor() {
    TemplateDefinition templateDefinition = new TemplateDefinition("foo", "foo1", "foo2", "foo3");
    assertNotNull(templateDefinition);
  }
View Full Code Here

  /**
   *
   */
  public void testGetDestinationPath() {
    TemplateDefinition templateDefinition = new TemplateDefinition("foo", "foo1", "foo2", "foo2");
    assertEquals("foo1" + File.separator + "foo2", templateDefinition);
  }
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.templateengine.TemplateDefinition

Copyright © 2018 www.massapicom. 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.