Examples of YesNoPageElement


Examples of com.flaptor.wizard.YesNoPageElement

            .add(new PageElement("You have selected to install Hounder in several machines."))
            .add(new PageElement("You will select which components to install on this machine.", "also, you will enter the hosts where you will install other components."))
            .add(new PageElement("After you install on this machine, you have to run the installer on the other hosts"));
    selectComponents           
          .add(new PageElement("You will now select which components to install."))
          .add(new YesNoPageElement("Install searcher?",null,"installSearcher", "y"))
          .add(new YesNoPageElement("Install indexer?",null,"installIndexer", "y"))
          .add(new YesNoPageElement("Install crawler?",null,"installCrawler", "y"))
          .add(new YesNoPageElement("Install cacheServer?",null,"installCacheServer", "y"))
          .add(new YesNoPageElement("Install monitorWeb?",null,"installMonitorWeb", "y"));
    selectComponentsMulti           
          .add(new PageElement("You will now select which components to install.", "Select whether you want to install a component, and if the component will be installed on this machine or on other."))
          .add(new OptionPageElement("Install searcher?",null,"installSearcher", "0", new String[] {"yes, in this machine""yes, in a remote machine", "no"}))
          .add(new OptionPageElement("Install indexer?",null,"installIndexer", "0", new String[] {"yes, in this machine""yes, in a remote machine", "no"}))
          .add(new OptionPageElement("Install crawler?",null,"installCrawler", "0", new String[] {"yes, in this machine""yes, in a remote machine", "no"}))
          .add(new OptionPageElement("Install cacheServer?",null,"installCacheServer", "0", new String[] {"yes, in this machine""yes, in a remote machine", "no"}))
          .add(new OptionPageElement("Install monitorWeb?",null,"installMonitorWeb", "0", new String[] {"yes, in this machine""yes, in a remote machine", "no"}));      
    searcherInstallRemote
      .add(new PageElement("Searcher remote configuration", "Please tell us where you will install the searcher."))
          .add(new InputPageElement("host", null, "host", "localhost"))
          .add(new InputPageElement("base port", null, "basePort", String.valueOf(PortUtil.getBasePort())))
      .add(new InputPageElement("base dir", null, "baseDir", DEFAULT_INSTALLATION_DIR));
    indexerInstallRemote
      .add(new PageElement("Indexer remote configuration", "Please tell us where you will install the indexer."))
          .add(new InputPageElement("host", null, "host", "localhost"))
          .add(new InputPageElement("base port", null, "basePort", String.valueOf(PortUtil.getBasePort())))
      .add(new InputPageElement("base dir", null, "baseDir", DEFAULT_INSTALLATION_DIR));         
    crawlerInstallRemote
      .add(new PageElement("Crawler remote configuration", "Please tell us where you will install the crawler."))
          .add(new InputPageElement("host", null, "host", "localhost"))
          .add(new InputPageElement("base port", null, "basePort", String.valueOf(PortUtil.getBasePort())))
      .add(new InputPageElement("base dir", null, "baseDir", DEFAULT_INSTALLATION_DIR));
    cacheServerInstallRemote
      .add(new PageElement("Cache Server remote configuration", "Please tell us where you will install the crawler."))
        .add(new InputPageElement("host", null, "host", "localhost"))
        .add(new InputPageElement("base port", null, "basePort", String.valueOf(PortUtil.getBasePort())))
      .add(new InputPageElement("base dir", null, "baseDir", DEFAULT_INSTALLATION_DIR));
    clusteringWebInstallRemote
      .add(new PageElement("Monitor Web remote configuration", "Please tell us where you will install the monitor web."))
          .add(new InputPageElement("host", null, "host", "localhost"))
          .add(new InputPageElement("base port", null, "basePort", String.valueOf(PortUtil.getBasePort())))
      .add(new InputPageElement("base dir", null, "baseDir", DEFAULT_INSTALLATION_DIR));
//        searcherInstall
//          .add(new PageElement("Searcher configuration"));
//        indexerInstall
//          .add(new PageElement("Indexer configuration"));
//        crawlerInstall
//          .add(new PageElement("Crawler configuration"));
        cacheServerInstall
      .add(new PageElement("Cache Server configuration"))
        .add(new InputPageElement("External host name", "users will access this through http, cannot be localhost", "host", "<replace>"));
        thisMachinesName
          .add(new InputPageElement("What's the name of this machine?", "Enter the machine name or IP address", "localhostName", "<replace>"));
        copySSH
        .add(new OptionPageElement(
        "How do you wish to copy files to the remote machines?",
        "You need to have SSH access without password to let the installer copy the files",
        "method",
        "0",
        new String[]{"let the installer copy them via SSH", "give me some .tgz that I'll copy and decompress myself"}));
      dirPortOptions
        .add(new PageElement("Local installation port and path"))
          .add(new InputPageElement("Base port", "Hounder uses a range of ports starting in one base port", "basePort", String.valueOf(PortUtil.getBasePort())))
          .add(new InputPageElement("Base dir", "This is where Hounder will be installed in this machine. If it exists, it will be overwritten.", "path",  installDir));   
//        installBaseOptions
//            .add(new InputPageElement("Local installation path", "This is where Hounder will be installed in this machine. If it exists, it will be overwritten.", "path",  installDir));
           

        thisMachineAllInstall.setPreNextCallback(new Runnable() {
      public void run() {
        multiMachine = false;
        crawlerConfig.install    = true;   
          searcherConfig.install     = true;   
          indexerConfig.install    = true;   
          cacheServerConfig.install   = true;   
          clusteringWebConfig.install  = true;
        crawlerConfig.installOnThisMachine    = true;   
          searcherConfig.installOnThisMachine   = true;   
          indexerConfig.installOnThisMachine     = true;   
          cacheServerConfig.installOnThisMachine   = true;   
          clusteringWebConfig.installOnThisMachine= true;

        cacheServerInstall.setNextPage(dirPortOptions);
      }
        });
        thisMachineSomeInstall.setPreNextCallback(new Runnable() {
      public void run() {
        multiMachine = false;
        crawlerConfig.installOnThisMachine    = true;   
          searcherConfig.installOnThisMachine   = true;   
          indexerConfig.installOnThisMachine     = true;   
          cacheServerConfig.installOnThisMachine   = true;   
          clusteringWebConfig.installOnThisMachine= true;
      }
        });
        multiMachineInstall.setPreNextCallback(new Runnable() {
      public void run() {
        multiMachine = true;
      }
        });
        selectComponents.setPreNextCallback(new Runnable() {
            public void run() {
                crawlerConfig.install    = selectComponents.getProperty("installCrawler").equalsIgnoreCase("y");   
          searcherConfig.install     = selectComponents.getProperty("installSearcher").equalsIgnoreCase("y");   
          indexerConfig.install    = selectComponents.getProperty("installIndexer").equalsIgnoreCase("y");   
          cacheServerConfig.install  = selectComponents.getProperty("installCacheServer").equalsIgnoreCase("y");   
          clusteringWebConfig.install  = selectComponents.getProperty("installMonitorWeb").equalsIgnoreCase("y");
         
          if (cacheServerConfig.install) {
            selectComponents.setNextPage(cacheServerInstall);
            cacheServerInstall.setNextPage(dirPortOptions);
          } else {
            selectComponents.setNextPage(dirPortOptions);
          }
            }
        });      
        selectComponentsMulti.setPreNextCallback(new Runnable() {
            public void run() {
                crawlerConfig.install    = Integer.parseInt(selectComponentsMulti.getProperty("installCrawler")) <= 1;   
          searcherConfig.install     = Integer.parseInt(selectComponentsMulti.getProperty("installSearcher")) <= 1;
          indexerConfig.install    = Integer.parseInt(selectComponentsMulti.getProperty("installIndexer")) <= 1;
          cacheServerConfig.install  = Integer.parseInt(selectComponentsMulti.getProperty("installCacheServer")) <= 1;
          clusteringWebConfig.install  = Integer.parseInt(selectComponentsMulti.getProperty("installMonitorWeb")) <= 1
                crawlerConfig.installOnThisMachine    = selectComponentsMulti.getProperty("installCrawler").equals("0");   
          searcherConfig.installOnThisMachine    = selectComponentsMulti.getProperty("installSearcher").equals("0");  
          indexerConfig.installOnThisMachine    = selectComponentsMulti.getProperty("installIndexer").equals("0");   
          cacheServerConfig.installOnThisMachine  = selectComponentsMulti.getProperty("installCacheServer").equals("0");
          clusteringWebConfig.installOnThisMachine= selectComponentsMulti.getProperty("installMonitorWeb").equals("0");
         
        oneLocal = false;
        oneRemote = false;
       
        Page next = selectComponentsMulti;
        if (searcherConfig.install) {
          if (!searcherConfig.installOnThisMachine) {
            next.setNextPage(searcherInstallRemote);
            next = next.getNextPage();
            oneRemote = true;
          } else {
            oneLocal = true;
          }
        }
        if (indexerConfig.install) {
          if (! indexerConfig.installOnThisMachine) {
            next.setNextPage(indexerInstallRemote);
            next = next.getNextPage();
            oneRemote = true;
          } else {
            oneLocal = true;
          }
        }
        if (crawlerConfig.install) {
          if ( ! crawlerConfig.installOnThisMachine) {
            next.setNextPage(crawlerInstallRemote);
            next = next.getNextPage();
            oneRemote = true;
          } else {
            oneLocal = true;
          }
        }
        if (cacheServerConfig.install) {
          if (!cacheServerConfig.installOnThisMachine) {
            next.setNextPage(cacheServerInstallRemote);
            oneRemote = true;
          } else {
            next.setNextPage(cacheServerInstall);
            oneLocal = true;
          }
          next = next.getNextPage();
        }
        if (clusteringWebConfig.install) {
          if (!clusteringWebConfig.installOnThisMachine) {
            next.setNextPage(clusteringWebInstallRemote);
            next = next.getNextPage();
            oneRemote = true;
          } else {
            oneLocal = true;
          }
        }
        if (oneRemote) {
          next.setNextPage(copySSH);
          next = next.getNextPage();
        }
        if (oneLocal) {
          next.setNextPage(thisMachinesName);
        } else {//maybe there is no components in this machine, in which case we dont need to ask for the local path
          next.setNextPage(installing);
        }
            }
        });      
      dirPortOptions.setPreNextCallback(new Runnable() {
      public void run() {
        if (new File(dirPortOptions.getProperty("path")).exists()) {
          dirPortOptions.setNextPage(confirmOverwrite);
        } else {
          dirPortOptions.setNextPage(installing);
        }
      }
      });

        confirmOverwrite.add(new YesNoPageElement("Installation path exists and will be overwritten. Please Confirm.", null, "confirm","y"));
        confirmOverwrite.addNextPage(installing).addNextPage(dirPortOptions);
       
        installing
            .add(new PageElement("Installing Hounder"));
        summary
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.