Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0.M1
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None

      Description

      When ROO Shell starts, shows a version header like the following:

          ____  ____  ____ 
         / __ \/ __ \/ __ \
        / /_/ / / / / / / /
       / _, _/ /_/ / /_/ /      
      /_/ |_|\____/\____/     2.0.0.BUILD-SNAPSHOT [959f35c]
                           
      

      Will be interesting that Shell Header changes depending of installed Roo Addon Suites (ROO-3600) or some file (shell-header.txt) located on .roo/config folder (ROO-3704)

      Roo Addon Suite could include some service that implements something like ShellHeader and if some ShellHeader implementation is found, AbstractShell.java will execute something like this:

          @CliCommand(value = { "version" }, help = "Displays shell version")
          public String version(
                  @CliOption(key = "", help = "Special version flags") final String extra) {
              final StringBuilder sb = new StringBuilder(); 
      
              [...]
      
              if(getShellHeader() != null){
                 sb.append(shellHeader.getHeader());          
                 return sb.toString();
              } 
      
              sb.append("    ____  ____  ____  ").append(LINE_SEPARATOR);
              sb.append("   / __ \\/ __ \\/ __ \\ ").append(LINE_SEPARATOR);
              sb.append("  / /_/ / / / / / / / ").append(LINE_SEPARATOR);
              sb.append(" / _, _/ /_/ / /_/ /  ").append(LINE_SEPARATOR);
              sb.append("/_/ |_|\\____/\\____/   ").append(" ").append(versionInfo())
                      .append(LINE_SEPARATOR);
              sb.append(LINE_SEPARATOR);
      
              return sb.toString();
          }
      

      When Spring Shell starts, we are going to see something like:

         _____ __  __________________   ___
        / ___// / / /  _/_  __/ ____/  <  /
        \__ \/ / / // /  / / / __/     / / 
       ___/ / /_/ // /  / / / /___    / /    
      /____/\____/___/ /_/ /_____/   /_/   1.3.0.RELEASE
                                           
                           
      

      The implementation above is OK if we have only one Roo Addon Suite installed... but what happens if we have more than one Roo Addon Suite installed on Spring Roo Shell? Which ShellHeader implementation we are going to use to show header?

      A possible solution could be that instead of get only one ShellHeader implementation, gets a List of ShellHeader implementation and shows header as the following:

          ____  ____  ____ 
         / __ \/ __ \/ __ \   My Roo Addon Suite (1.3.0.RELEASE)
        / /_/ / / / / / / /   Amazing Roo Addon Suite (3.1.1.RELEASE)
       / _, _/ /_/ / /_/ /    5 Roo Addon Suites more were found...   
      /_/ |_|\____/\____/     2.0.0.BUILD-SNAPSHOT [959f35c]
                           
      

      So AbstractShell.java will execute something like this:

          @CliCommand(value = { "version" }, help = "Displays shell version")
          public String version(
                  @CliOption(key = "", help = "Special version flags") final String extra) {
              final StringBuilder sb = new StringBuilder(); 
      
              [...]
             
              // Getting ShellHeader implementations
              populateShellHeaders();
              if(!shellHeaders.isEmpty()){
                 for(ShellHeader shellHeader : shellHeaders){
                    // Generates header like above
                 }
                 return sb.toString();
              } 
      
              sb.append("    ____  ____  ____  ").append(LINE_SEPARATOR);
              sb.append("   / __ \\/ __ \\/ __ \\ ").append(LINE_SEPARATOR);
              sb.append("  / /_/ / / / / / / / ").append(LINE_SEPARATOR);
              sb.append(" / _, _/ /_/ / /_/ /  ").append(LINE_SEPARATOR);
              sb.append("/_/ |_|\\____/\\____/   ").append(" ").append(versionInfo())
                      .append(LINE_SEPARATOR);
              sb.append(LINE_SEPARATOR);
      
              return sb.toString();
          }
      

        Attachments

          Activity

            People

            • Assignee:
              jcgarcia Juan Carlos García del Canto
              Reporter:
              jcgarcia Juan Carlos García del Canto
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: