Package com.adaptrex.tools.environment

Examples of com.adaptrex.tools.environment.Environment


    System.out.println(HR);
  }

 
  private void printEnvironment() {
    Environment env = environmentService.getEnvironment();

    System.out.println("Adaptrex Environment" + CR + HR + CR + "Webroot Path    : "
        + env.getWebrootPath() + CR + "Sencha Cmd Path : " + env.getCmdPath() + CR + HR + CR);

    System.out.println("Available Frameworks" + CR + HR);

    Map<String, AdaptrexJS> adaptrexFrameworks = env.getAdaptrexFrameworks();
    for (String key : adaptrexFrameworks.keySet()) {
      AdaptrexJS adaptrex = adaptrexFrameworks.get(key);
      System.out.println("Adaptrex        : " + adaptrex.getVersion() + " (" + adaptrex.getFolderName()
          + ")");
    }

    Map<String, ExtJS> extFrameworks = env.getExtFrameworks();
    for (String key : extFrameworks.keySet()) {
      ExtJS ext = extFrameworks.get(key);
      System.out.println("ExtJS           : " + ext.getVersion() + " (" + ext.getFolderName() + ")");
    }

    Map<String, SenchaTouch> senchaTouchFrameworks = env.getSenchaTouchFrameworks();
    for (String key : senchaTouchFrameworks.keySet()) {
      SenchaTouch st = senchaTouchFrameworks.get(key);
      System.out.println("Sencha Touch    : " + st.getVersion() + " (" + st.getFolderName() + ")");
    }
    System.out.println(HR);

    System.out.println(CR + "Configured Webapps" + CR + HR);
    Map<String, Webapp> webapps = env.getWebapps();
    if (webapps.size() > 0) {
      for (String key : webapps.keySet()) {
        Webapp webapp = webapps.get(key);
        System.out.println(webapp.getName() + " (" + webapp.getFullPath() + ")");
      }
View Full Code Here


    this.logService = logService;
  }

  @Override
  public Webapp loadWebapp(String fullPath) throws IOException {
    Environment env = environmentService.getEnvironment();

    Webapp webapp = new Webapp();
    webapp.setFullPath(fullPath);
   
    /*
     * Create collections to hold our settings, frameworks and webapps for later processing
     */
    Ini ini = new Ini();
    File appSettings = new File(fullPath + "/src/main/webapp/adaptrex/app.config");
    if (!appSettings.exists()) return null;
    ini.load(new FileReader(appSettings));
   
    /*
     * Get our app name
     */
    Ini.Section settingsSection = ini.get(SETTINGS);
    webapp.setName(settingsSection.get("name"));
    webapp.setBasePackage(settingsSection.get(BASE_PACKAGE));
    webapp.setGlobalFolder(settingsSection.get(GLOBAL_FOLDER));
    webapp.setGlobalNamespace(settingsSection.get(GLOBAL_NAMESPACE));
   
   
    /*
     * Get information about our webapp's frameworks
     */
    Ini.Section frameworkSection = ini.get(FRAMEWORKS);
    if (frameworkSection.containsKey(ADAPTREXJS))
      webapp.setAdaptrex(env.getAdaptrexFrameworks().get(frameworkSection.get(ADAPTREXJS)));
    if (frameworkSection.containsKey(EXTJS))
      webapp.setExt(env.getExtFrameworks().get(frameworkSection.get(EXTJS)));
    if (frameworkSection.containsKey(SENCHA_TOUCH))
      webapp.setSenchaTouch(env.getSenchaTouchFrameworks().get(frameworkSection.get(SENCHA_TOUCH)));
    if (frameworkSection.containsKey(ORM))
      webapp.setOrm(frameworkSection.get(ORM));
    if (frameworkSection.containsKey(PRESENTATION))
      webapp.setPresentation(frameworkSection.get(PRESENTATION));
    if (frameworkSection.containsKey(DI))
View Full Code Here

    this.logService = logService;
  }
 
  @Override
  public boolean createBootstrap(Webapp webapp, String framework) throws IOException {
    Environment env = environmentService.getEnvironment();
   
    boolean isExt = framework.equals(JavaScriptFramework.EXTJS);
    JavaScriptFramework javaScriptFramework = isExt ? webapp.getExt() : webapp.getSenchaTouch();   
    AdaptrexJS adaptrexJS = webapp.getAdaptrex();
    if (adaptrexJS == null) {
      logService.log(Log.ERROR, "Generate Bootstrap Error",
          "The adaptrex-js folder required to generate your bootstrap file is missing"
          );
      return false;
    }
   
   
    String sdkFolder = isExt ? "extjs" : "sencha-touch";
   
    String sdkPath = javaScriptFramework.getFullPath();
    String adaptrexSdkPath = adaptrexJS.getFullPath() + "/" + sdkFolder;
    String dependencyFile = isExt ? "ExtDependencies.js" : "SenchaTouchDependencies.js";
    String webappSrcAbsolutePath = webapp.getFullPath() + "/src/main/webapp";
   
    javaScriptFramework.cleanCmdBugs();
    try {
      String[] cmdString = {env.getCmdPath() + "/sencha",
        "-d",
        "-sdk=" + sdkPath,
        "compile",
        "-classpath=" +
          adaptrexSdkPath + "/src",
View Full Code Here

    this.urlMap.put("sencha-touch", "http://cdn.sencha.io/touch/sencha-touch-2.1.0-gpl.zip");
  }
 
  @Override
  public boolean downloadAndInstall(String framework) throws IOException {
    Environment env = environmentService.getEnvironment();
    String weblibPath = env.getWebrootPath() + "/weblib/";
   
    String firstEntry = null;
    String downloadPath = this.urlMap.get(framework);
   
    URL url = new URL(downloadPath);
View Full Code Here

    if (globalFolder == null) globalFolder = "common";
   
    /*
     * Process default frameworks
     */
    Environment env = environmentService.getEnvironment();
    if (adaptrexVersion.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,AdaptrexJS> fw = env.getAdaptrexFrameworks();
      if (fw.size() == 1) {
        AdaptrexJS adaptrex = (AdaptrexJS) fw.get(fw.keySet().iterator().next());
        adaptrexVersion = adaptrex.getFolderName();
      }
    }
   
    if (extFolder.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,ExtJS> fw = env.getExtFrameworks();
      if (fw.size() == 1) {
        ExtJS ext = (ExtJS) fw.get(fw.keySet().iterator().next());
        extFolder = ext.getFolderName();
      }
    }
   
    if (senchaTouchFolder.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,SenchaTouch> fw = env.getSenchaTouchFrameworks();
      if (fw.size() == 1) {
        SenchaTouch senchaTouch = (SenchaTouch) fw.get(fw.keySet().iterator().next());
        senchaTouchFolder = senchaTouch.getFolderName();
      }
    }
View Full Code Here

    this.logService = logService;
  }

  @Override
  public Webapp loadWebapp(String fullPath) throws IOException {
    Environment env = environmentService.getEnvironment();

    Webapp webapp = new Webapp();
    webapp.setFullPath(fullPath);
   
    /*
     * Create collections to hold our settings, frameworks and webapps for later processing
     */
    Ini ini = new Ini();
    File appSettings = new File(fullPath + "/src/main/webapp/adaptrex/app.config");
    if (!appSettings.exists()) return null;
    ini.load(new FileReader(appSettings));
   
    /*
     * Get our app name
     */
    Ini.Section settingsSection = ini.get(SETTINGS);
    webapp.setName(settingsSection.get("name"));
    webapp.setBasePackage(settingsSection.get(BASE_PACKAGE));
    webapp.setGlobalFolder(settingsSection.get(GLOBAL_FOLDER));
    webapp.setGlobalNamespace(settingsSection.get(GLOBAL_NAMESPACE));
   
   
    /*
     * Get information about our webapp's frameworks
     */
    Ini.Section frameworkSection = ini.get(FRAMEWORKS);
    if (frameworkSection.containsKey(ADAPTREXJS))
      webapp.setAdaptrex(env.getAdaptrexFrameworks().get(frameworkSection.get(ADAPTREXJS)));
    if (frameworkSection.containsKey(EXTJS))
      webapp.setExt(env.getExtFrameworks().get(frameworkSection.get(EXTJS)));
    if (frameworkSection.containsKey(SENCHA_TOUCH))
      webapp.setSenchaTouch(env.getSenchaTouchFrameworks().get(frameworkSection.get(SENCHA_TOUCH)));
    if (frameworkSection.containsKey(ORM))
      webapp.setOrm(frameworkSection.get(ORM));
    if (frameworkSection.containsKey(PRESENTATION))
      webapp.setPresentation(frameworkSection.get(PRESENTATION));
    if (frameworkSection.containsKey(DI))
View Full Code Here

    if (globalFolder == null) globalFolder = "common";
   
    /*
     * Process default frameworks
     */
    Environment env = environmentService.getEnvironment();
    if (adaptrexVersion.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,AdaptrexJS> fw = env.getAdaptrexFrameworks();
      if (fw.size() == 1) {
        AdaptrexJS adaptrex = (AdaptrexJS) fw.get(fw.keySet().iterator().next());
        adaptrexVersion = adaptrex.getFolderName();
      }
    }
   
    if (extFolder.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,ExtJS> fw = env.getExtFrameworks();
      if (fw.size() == 1) {
        ExtJS ext = (ExtJS) fw.get(fw.keySet().iterator().next());
        extFolder = ext.getFolderName();
      }
    }
   
    if (senchaTouchFolder.equals(JavaScriptFramework.DEFAULT)) {
      Map<String,SenchaTouch> fw = env.getSenchaTouchFrameworks();
      if (fw.size() == 1) {
        SenchaTouch senchaTouch = (SenchaTouch) fw.get(fw.keySet().iterator().next());
        senchaTouchFolder = senchaTouch.getFolderName();
      }
    }
View Full Code Here

TOP

Related Classes of com.adaptrex.tools.environment.Environment

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.