Examples of JavaScriptFramework


Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  @Override
  public boolean compilePage(Webapp webapp, Page page) throws IOException {
    String sdkType = page.getFrameworkType();
    boolean isExt = sdkType.equals(JavaScriptFramework.EXTJS);
    JavaScriptFramework framework = isExt ? webapp.getExt() : webapp.getSenchaTouch();
   
    String sdkPath = isExt ? webapp.getExt().getFullPath() : webapp.getSenchaTouch().getFullPath();
    String dependencyFile = isExt ? "ExtDependencies.js" : "SenchaTouchDependencies.js";
    String webappSrcAbsolutePath = webapp.getFullPath() + "/src/main/webapp";
    String pageAbsolutePath = webappSrcAbsolutePath + "/" + page.getPath();
   
    /*
     * Create ghosts
     */
    try {
      if (!createGhosts(webapp, webappSrcAbsolutePath, pageAbsolutePath, sdkType, sdkPath)) return false;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
   
   
    /*
     * Compile Page
     */
    String compileOutput = null;
    framework.cleanCmdBugs();
    try {
      String[] cmdString = {
        environmentService.getEnvironment().getCmdPath() + "/sencha",
        "-d",
        "-sdk=" + sdkPath,
        "compile",
        "-classpath=" +
          webappSrcAbsolutePath + "/adaptrex/ghosts.js," +
          pageAbsolutePath + "/app/app.js," +
          pageAbsolutePath + "/app," +
          webappSrcAbsolutePath + "/" + webapp.getGlobalFolder() + "," +
          webapp.getAdaptrex().getFullPath() + "/" + sdkType + "/src," +
          sdkPath + "/src",
        "exclude","-all",
        "and","include","-r","-f",  pageAbsolutePath + "/app/app.js",
        "and","exclude","-f",     sdkPath + "/src",
        "and","exclude","-f",     webappSrcAbsolutePath + "/adaptrex/ghosts.js",
        "and","concat",        pageAbsolutePath + "/build/app-all-debug.js",
        "and","concat""-compress",pageAbsolutePath + "/build/app-all.js",
        "and","save""appset",
        "and","exclude","-all",
        "and","include","-r","-f",  pageAbsolutePath + "/app/app.js",
        "and","include","-na",    "Adaptrex.override",
        "and","include","-r","-f",  dependencyFile,
        "and","exclude","-s",    "appset",
        "and","exclude","-f",    dependencyFile,
        "and","concat",        pageAbsolutePath + "/build/app-" + sdkType + "-debug.js",
        "and","concat""-compress",pageAbsolutePath + "/build/app-" + sdkType + ".js"
      };
     
      ProcessBuilder processBuilder = new ProcessBuilder(cmdString);
      processBuilder.redirectErrorStream();
      Process cmd = processBuilder.start();
      Tools.StreamGobbler gobbler = new Tools.StreamGobbler(cmd.getInputStream());
          gobbler.start();
      cmd.waitFor();
      compileOutput = gobbler.getGobblerOutput();
         
          if (compileOutput.contains("[ERR]")) {
            logService.log(Log.ERROR, "Error compiling page: " + page.getPath(), compileOutput);
        return false;
          }
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      framework.restoreCmdBugs();
    }
   
    logService.log(Log.SUCCESS, "Successfully compiled page: " + page.getPath());
    return true;
  }
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setAdaptrexJS(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getAdaptrexFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "AdaptrexJS", ADAPTREXJS, "a");
    if (fw != null) {
      webapp.setAdaptrex((AdaptrexJS) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setExtJS(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getExtFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "ExtJS", EXTJS, "e");
    if (fw != null) {
      webapp.setExt((ExtJS) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setSenchaTouch(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getSenchaTouchFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "Sencha Touch", SENCHA_TOUCH, "s");
    if (fw != null) {
      webapp.setSenchaTouch((SenchaTouch) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

          TAB + "  download and install " + title + "."
        );
      return null;
    }
   
    JavaScriptFramework fw = null;
    if (newFolder.equals(JavaScriptFramework.DEFAULT)) {
      if (fws.size() > 1) {
        List<String> tryAgain = new ArrayList<String>();
        for (String key : fws.keySet()) {
          tryAgain.add(TAB +
              "adaptrex configure webapp -p=\"" + webapp.getFullPath() + "\"" +
              " -" + option + "=" + key);
        }
        logService.log(Log.ERROR, "Multiple " + title + " folders available",
            "Adaptrex tools can't determine which " + title + " folder you want to use." + CR +
            "Specify the correct folder by running one of the following:" + CR +
            StringUtils.join(tryAgain, CR)
          );
        return null;
      } else {
        fw = (JavaScriptFramework) fws.get(fws.keySet().iterator().next());
      }
    } else {
      fw = (JavaScriptFramework) fws.get(newFolder);
      if (fw == null) {
        List<String> tryAgain = new ArrayList<String>();
        for (String key : fws.keySet()) {
          tryAgain.add(TAB +
              "adaptrex configure webapp -n=\"" + webapp.getName() + "\"" +
              " -" + option + "=" + key);
        }
        logService.log(Log.ERROR, title + " folders not found",
          "No " + title + " folder was found at " + newFolder + CR +
          "Specify the correct folder by running one of the following:" + CR +
          StringUtils.join(tryAgain, CR)
        );
        return null;
      }
    }
   
    logService.log(Log.SUCCESS, title + " set to " + fw.getFolderName());
    return fw;
  }
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  @Override
  public boolean compilePage(Webapp webapp, Page page) throws IOException {
    String sdkType = page.getFrameworkType();
    boolean isExt = sdkType.equals(JavaScriptFramework.EXTJS);
    JavaScriptFramework framework = isExt ? webapp.getExt() : webapp.getSenchaTouch();
   
    String sdkPath = isExt ? webapp.getExt().getFullPath() : webapp.getSenchaTouch().getFullPath();
    String dependencyFile = isExt ? "ExtDependencies.js" : "SenchaTouchDependencies.js";
    String webappSrcAbsolutePath = webapp.getFullPath() + "/src/main/webapp";
    String pageAbsolutePath = webappSrcAbsolutePath + "/" + page.getPath();
   
    /*
     * Create ghosts
     */
    try {
      if (!createGhosts(webapp, webappSrcAbsolutePath, pageAbsolutePath, sdkType, sdkPath)) return false;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
   
   
    /*
     * Compile Page
     */
    String compileOutput = null;
    framework.cleanCmdBugs();
    try {
      String[] cmdString = {
        environmentService.getEnvironment().getCmdPath() + "/sencha",
        "-d",
        "-sdk=" + sdkPath,
        "compile",
        "-classpath=" +
          webappSrcAbsolutePath + "/adaptrex/ghosts.js," +
          pageAbsolutePath + "/app/app.js," +
          pageAbsolutePath + "/app," +
          webappSrcAbsolutePath + "/" + webapp.getGlobalFolder() + "," +
          webapp.getAdaptrex().getFullPath() + "/" + sdkType + "/src," +
          sdkPath + "/src",
        "exclude","-all",
        "and","include","-r","-f",  pageAbsolutePath + "/app/app.js",
        "and","exclude","-f",     sdkPath + "/src",
        "and","exclude","-f",     webappSrcAbsolutePath + "/adaptrex/ghosts.js",
        "and","concat",        pageAbsolutePath + "/build/app-all-debug.js",
        "and","concat""-compress",pageAbsolutePath + "/build/app-all.js",
        "and","save""appset",
        "and","exclude","-all",
        "and","include","-r","-f",  pageAbsolutePath + "/app/app.js",
        "and","include","-na",    "Adaptrex.override",
        "and","include","-r","-f",  dependencyFile,
        "and","exclude","-s",    "appset",
        "and","exclude","-f",    dependencyFile,
        "and","concat",        pageAbsolutePath + "/build/app-" + sdkType + "-debug.js",
        "and","concat""-compress",pageAbsolutePath + "/build/app-" + sdkType + ".js"
      };
     
      ProcessBuilder processBuilder = new ProcessBuilder(cmdString);
      processBuilder.redirectErrorStream();
      Process cmd = processBuilder.start();
      Tools.StreamGobbler gobbler = new Tools.StreamGobbler(cmd.getInputStream());
          gobbler.start();
      cmd.waitFor();
      compileOutput = gobbler.getGobblerOutput();
         
          if (compileOutput.contains("[ERR]")) {
            logService.log(Log.ERROR, "Error compiling page: " + page.getPath(), compileOutput);
        return false;
          }
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      framework.restoreCmdBugs();
    }
   
    logService.log(Log.SUCCESS, "Successfully compiled page: " + page.getPath());
    return true;
  }
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setAdaptrexJS(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getAdaptrexFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "AdaptrexJS", ADAPTREXJS, "a");
    if (fw != null) {
      webapp.setAdaptrex((AdaptrexJS) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setExtJS(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getExtFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "ExtJS", EXTJS, "e");
    if (fw != null) {
      webapp.setExt((ExtJS) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

  }

  @Override
  public boolean setSenchaTouch(Webapp webapp, String newFolder) {
    Map<String,?> fws = environmentService.getEnvironment().getSenchaTouchFrameworks();
    JavaScriptFramework fw = getNewFramework(webapp, newFolder, fws, "Sencha Touch", SENCHA_TOUCH, "s");
    if (fw != null) {
      webapp.setSenchaTouch((SenchaTouch) fw);
      return true;
    } else {
      return false;
View Full Code Here

Examples of com.adaptrex.tools.framework.javascript.JavaScriptFramework

          TAB + "  download and install " + title + "."
        );
      return null;
    }
   
    JavaScriptFramework fw = null;
    if (newFolder.equals(JavaScriptFramework.DEFAULT)) {
      if (fws.size() > 1) {
        List<String> tryAgain = new ArrayList<String>();
        for (String key : fws.keySet()) {
          tryAgain.add(TAB +
              "adaptrex configure webapp -p=\"" + webapp.getFullPath() + "\"" +
              " -" + option + "=" + key);
        }
        logService.log(Log.ERROR, "Multiple " + title + " folders available",
            "Adaptrex tools can't determine which " + title + " folder you want to use." + CR +
            "Specify the correct folder by running one of the following:" + CR +
            StringUtils.join(tryAgain, CR)
          );
        return null;
      } else {
        fw = (JavaScriptFramework) fws.get(fws.keySet().iterator().next());
      }
    } else {
      fw = (JavaScriptFramework) fws.get(newFolder);
      if (fw == null) {
        List<String> tryAgain = new ArrayList<String>();
        for (String key : fws.keySet()) {
          tryAgain.add(TAB +
              "adaptrex configure webapp -n=\"" + webapp.getName() + "\"" +
              " -" + option + "=" + key);
        }
        logService.log(Log.ERROR, title + " folders not found",
          "No " + title + " folder was found at " + newFolder + CR +
          "Specify the correct folder by running one of the following:" + CR +
          StringUtils.join(tryAgain, CR)
        );
        return null;
      }
    }
   
    logService.log(Log.SUCCESS, title + " set to " + fw.getFolderName());
    return fw;
  }
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.