Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1407

Shell is missing options in wizards where default values allow immediately moving to next step

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.0.Beta4
    • Fix Version/s: 2.0.0.CR1
    • Component/s: UI - Shell
    • Labels:
      None

      Description

      Should have a lot more options:

      [jpa-demo]$ jpa-setup 
      --dataSourceName  --dbType  --persistenceUnitName 
      

      The problem is here in ShellWizard.java (in shell addon)

       private CommandLineParser populate(ShellContext shellContext, String line,
      
                  final Map<String, InputComponent<?, ?>> inputs)
      
                  throws Exception
      
         {
      
            inputs.putAll(getController().getInputs());
      
            CommandLineParser parser = commandLineUtil.generateParser(getController(), shellContext, inputs);
      
            CommandLine cmdLine = parser.parse(line, true);
      
            Map<String, InputComponent<?, ?>> populatedInputs = commandLineUtil.populateUIInputs(cmdLine, inputs);
      
            if (getController().isValid())
      
            {
      
               if (getController().canMoveToNextStep())
      
               {
      
                  // The bug is here. we are immediately moving to the next step and removing all inputs that are not populated.
      
                  // this really needs to know if we have defaulted to next step or actually moved there willingly
      
                  // it should not remove old choices until a new choice has been made
      
                  getController().next().initialize();
      
                  inputs.keySet().retainAll(populatedInputs.keySet());
      
                  parser = populate(shellContext, line, inputs);
      
               }
      
            }
      
            return parser;
      
         }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                gastaldi George Gastaldi
                Reporter:
                lincolnthree Lincoln Baxter III
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: