Package com.adaptrex.tools.webapp

Examples of com.adaptrex.tools.webapp.Webapp


    options.addOption(s);
  }
 
 
  public Webapp getWebapp() {
    Webapp webapp = null;
   
    if (cl.hasOption("p")) {
      String path = cl.getOptionValue("p");
      if (!path.contains(Tools.SLASH)){
        File curDirectory = new File (".");
View Full Code Here


  private void deletePage() throws ParseException, IOException {
    setDeletePageOptions();
    cl = commandService.parseCommands(PAGE_USAGE);
    commandService.requireOptions(PAGE_USAGE, "P");
   
    Webapp webapp = commandService.getWebapp();
    if (webapp == null) return;
   
    String pagePath = cl.getOptionValue("P");
   
    Page page = webappService.getPage(webapp, pagePath);
View Full Code Here

 
  private void deleteWebapp() throws ParseException, IOException {
    setDeleteWebappOptions();
    cl = commandService.parseCommands(WEBAPP_USAGE);
   
    Webapp webapp = commandService.getWebapp();
    if (webapp == null) return;
   
    boolean success = environmentService.deleteWebapp(webapp, false);
    commandService.printLog();
    if (!success) return;
View Full Code Here

  private void importPage() throws ParseException, IOException {
    setImportPageOptions();
    cl = commandService.parseCommands(PAGE_USAGE);
    commandService.requireOptions(PAGE_USAGE, "N", "P", "f");
   
    Webapp webapp = commandService.getWebapp();
    if (webapp == null) return;
   
    String namespace = cl.getOptionValue("N");
    String pagePath = cl.getOptionValue("P");
    String framework = cl.getOptionValue("f", "ext-js");
View Full Code Here

    String orm        = cl.getOptionValue("o");
    String di        = cl.getOptionValue("d");
    String extTheme      = cl.getOptionValue("t");
    String senchaTouchTheme  = cl.getOptionValue("T");
   
    Webapp webapp = environmentService.importWebapp(path, name,
        globalFolder, globalNamespace, basePackage,
        adaptrex, ext, sencha,
        view, orm, di, extTheme, senchaTouchTheme);
    commandService.printLog();
    if (webapp == null) return;

    webappService.saveWebapp(webapp);
    environmentService.saveEnvironment();
   
    /*
     * Add themes
     */
    if (cl.hasOption("t")) {
      try {
        boolean success = webapp.getExt().importTheme(webapp, cl.getOptionValue("t"));
        if (success) {
          commandService.log(Log.SUCCESS, "Theme Successfully Imported", null);
        } else {
          commandService.log(Log.ERROR, "Unspecified Error Importing Theme", null);
        }
      } catch (Exception e) {
        commandService.log(Log.ERROR, "Error Importing Theme", e.getMessage());
      }
      commandService.printLog();
    }
    if (cl.hasOption("T")) {
      try {
        boolean success = webapp.getSenchaTouch().importTheme(webapp, cl.getOptionValue("T"));
        if (success) {
          commandService.log(Log.SUCCESS, "Theme Successfully Imported", null);
        } else {
          commandService.log(Log.ERROR, "Unspecified Error Importing Theme", null);
        }
View Full Code Here

    setPageOptions();
   
    cl = commandService.parseCommands(PAGE_USAGE);
    commandService.requireOptions(PAGE_USAGE, "P");
   
    Webapp webapp = commandService.getWebapp();
    if (webapp == null) return;
   
    String pagePath    = cl.getOptionValue("P");
    Page page = webappService.getPage(webapp, pagePath);
   
View Full Code Here

 
  private void compileWebapp() throws ParseException, IOException {
    setWebappOptions();
   
    cl = commandService.parseCommands(WEBAPP_USAGE);
    Webapp webapp = commandService.getWebapp();
    if (webapp == null) return;
   
    for (String pageKey : webapp.getPages().keySet()) {
      webappService.compilePage(webapp, webapp.getPages().get(pageKey));
      commandService.printLog();
    }
   
   
  }
View Full Code Here

  private void generatePage() throws ParseException, IOException, TemplateException {
    setGeneratePageOptions();
    cl = commandService.parseCommands(PAGE_USAGE);
    commandService.requireOptions(PAGE_USAGE, "P", "N", "f");
   
    Webapp webapp = commandService.getWebapp();
   
    String pagePath    = cl.getOptionValue("P");
    String namespace  = cl.getOptionValue("N");
    String framework  = cl.getOptionValue("f");
   
View Full Code Here

    options.addOption(s);
  }
 
 
  public Webapp getWebapp() {
    Webapp webapp = null;
   
    if (cl.hasOption("p")) {
      String path = cl.getOptionValue("p");
      if (!path.contains(Tools.SLASH)){
        File curDirectory = new File (".");
View Full Code Here

  @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))
      webapp.setDi(frameworkSection.get(DI));
     
   
    /*
     * Get our list of pages
     */
    Map<String,String> pagesSection = ini.get(PAGES);
    Map<String,Page> pages = webapp.getPages();
    if (pagesSection != null) {
      for (String key : pagesSection.keySet()) {
        String[] valueParts = pagesSection.get(key).split(",");
        String path = key.replace(".", "/");
        String name = valueParts[0];
View Full Code Here

TOP

Related Classes of com.adaptrex.tools.webapp.Webapp

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.