geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r573941 - in /geronimo/sandbox/gshell/trunk: gshell-assembly/ gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-commands/ gshell-commands/gshell-bsf/ gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands...
Date Sun, 09 Sep 2007 01:55:55 GMT
Author: jdillon
Date: Sat Sep  8 18:55:53 2007
New Revision: 573941

URL: http://svn.apache.org/viewvc?rev=573941&view=rev
Log:
Fix the loading of ~/.gshell/gshell.rc|profile, seems like the Shell's execute(Object... )
is broken :-(
Moved layout loader stuff to sub-package

Added:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
  (contents, props changed)
      - copied, changed from r573906, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
  (contents, props changed)
      - copied, changed from r573938, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
  (with props)
Modified:
    geronimo/sandbox/gshell/trunk/gshell-assembly/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
    geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Arguments.java

Modified: geronimo/sandbox/gshell/trunk/gshell-assembly/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assembly/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assembly/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-assembly/pom.xml Sat Sep  8 18:55:53 2007
@@ -62,14 +62,12 @@
             <artifactId>gshell-builtins</artifactId>
             <version>${pom.version}</version>
         </dependency>
-        
-        <!--
+
         <dependency>
             <groupId>org.apache.geronimo.gshell.commands</groupId>
             <artifactId>gshell-optional</artifactId>
             <version>${pom.version}</version>
         </dependency>
-        -->
         
         <dependency>
             <groupId>org.slf4j</groupId>

Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Sat Sep  8 18:55:53 2007
@@ -191,7 +191,13 @@
         if (file.exists()) {
             log.debug("Loading user-script: {}", file);
 
-            shell.execute("source", file.toURI().toURL());
+
+            // shell.execute("source", file.toURI().toURL());
+            shell.execute("source " + file.toURI().toURL());
+
+            //
+            // TODO: Should probably lookup the command by id, since user's might not bind
this in the layout
+            //
         }
     }
 
@@ -286,12 +292,16 @@
         if (term instanceof jline.WindowsTerminal) {
             log.debug("  Direct: {}", ((jline.WindowsTerminal)term).getDirectConsole());
         }
-        
-        log.debug("Started in {}", watch);
+
+       log.debug("Started in {}", watch);
 
         int code = 0;
 
         try {
+            //
+            // TODO: Load gsh.properties if it exists?
+            //
+
             //
             // TODO: Get the name from the branding theme
             //

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/pom.xml Sat Sep  8 18:55:53 2007
@@ -60,13 +60,26 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-java5-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
                 <groupId>org.apache.geronimo.gshell</groupId>
                 <artifactId>gshell-maven-plugin</artifactId>
                 <version>${pom.version}</version>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>plugin-descriptor</goal>
+                            <goal>commands-descriptor</goal>
                         </goals>
                     </execution>
                 </executions>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
Sat Sep  8 18:55:53 2007
@@ -21,18 +21,18 @@
 
 import org.apache.bsf.BSFEngine;
 import org.apache.bsf.BSFManager;
-import org.apache.geronimo.gshell.JLineConsole;
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.console.Console;
+import org.apache.geronimo.gshell.console.JLineConsole;
 
 /**
  * Provides generic scripting language integration via <a href="http://http://jakarta.apache.org/bsf">BSF</a>.
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="script")
+@CommandComponent(id="script", description="Provides generic scripting language execution
support")
 public class ScriptCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml Sat Sep  8 18:55:53
2007
@@ -54,6 +54,19 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-java5-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
                 <groupId>org.apache.geronimo.gshell</groupId>
                 <artifactId>gshell-maven-plugin</artifactId>
                 <version>${pom.version}</version>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
Sat Sep  8 18:55:53 2007
@@ -96,6 +96,10 @@
             }
         }
 
+        //
+        // TODO: Need to figure out a simple way to access i18n text for the command's help
+        //
+        
         /*
         io.out.println();
         io.out.println("For help on a specific command type:");

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
Sat Sep  8 18:55:53 2007
@@ -46,10 +46,19 @@
     private Shell shell;
 
     @Argument(required=true, description="Source file")
-    private File file;
+    private String source;
 
     protected Object doExecute() throws Exception {
-        BufferedReader reader = openReader(file);
+        URL url;
+        
+        try {
+            url = new URL(source);
+        }
+        catch (MalformedURLException e) {
+            url = new File(source).toURI().toURL();
+        }
+        
+        BufferedReader reader = openReader(url);
 
         String line;
         while ((line = reader.readLine()) != null) {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/pom.xml Sat Sep  8 18:55:53
2007
@@ -40,13 +40,26 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-java5-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
                 <groupId>org.apache.geronimo.gshell</groupId>
                 <artifactId>gshell-maven-plugin</artifactId>
                 <version>${pom.version}</version>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>plugin-descriptor</goal>
+                            <goal>commands-descriptor</goal>
                         </goals>
                     </execution>
                 </executions>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
Sat Sep  8 18:55:53 2007
@@ -40,7 +40,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="cat")
+@CommandComponent(id="cat", description="Concatenate and print files and/or URLs.")
 public class CatCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
Sat Sep  8 18:55:53 2007
@@ -31,7 +31,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="echo")
+@CommandComponent(id="echo", description="Echo or print arguments to STDOUT")
 public class EchoCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
Sat Sep  8 18:55:53 2007
@@ -31,7 +31,8 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="exec")public class ExecuteCommand
+@CommandComponent(id="exec", description="Execute system processes")
+public class ExecuteCommand
     extends CommandSupport
 {
     private ProcessBuilder builder;

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
Sat Sep  8 18:55:53 2007
@@ -37,7 +37,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="java")
+@CommandComponent(id="java", description="Execute a Java standard application")
 public class JavaCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
Sat Sep  8 18:55:53 2007
@@ -28,7 +28,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="sleep")
+@CommandComponent(id="sleep", description="Sleep for a bit then wake up")
 public class SleepCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
Sat Sep  8 18:55:53 2007
@@ -32,7 +32,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="wait")
+@CommandComponent(id="wait", description="Wait, blocking execution... not nice")
 public class WaitCommand
     extends CommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/pom.xml Sat Sep  8 18:55:53 2007
@@ -48,13 +48,26 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-java5-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
                 <groupId>org.apache.geronimo.gshell</groupId>
                 <artifactId>gshell-maven-plugin</artifactId>
                 <version>${pom.version}</version>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>plugin-descriptor</goal>
+                            <goal>commands-descriptor</goal>
                         </goals>
                     </execution>
                 </executions>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
Sat Sep  8 18:55:53 2007
@@ -30,7 +30,7 @@
  *
  * @version $Rev$ $Date$
  */
-@CommandComponent(id="copy")
+@CommandComponent(id="copy", description="Copy files between VFS sources")
 public class CopyCommand
     extends VFSCommandSupport
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml Sat Sep  8 18:55:53 2007
@@ -49,11 +49,18 @@
     
     <modules>
         <module>gshell-builtins</module>
-        <!--
         <module>gshell-optional</module>
-        <module>gshell-bsf</module>
-        <module>gshell-vfs</module>
-        -->
     </modules>
+
+    <profiles>
+        <profile>
+            <id>full</id>
+
+            <modules>
+                <module>gshell-bsf</module>
+                <module>gshell-vfs</module>
+            </modules>
+        </profile>
+    </profiles>
     
 </project>

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
Sat Sep  8 18:55:53 2007
@@ -154,6 +154,10 @@
 
         log.info("Executing (Object...): [{}]", Arguments.asString(args));
 
+        //
+        // FIXME: This is broken... :-(
+        //
+        
         return execute(String.valueOf(args[0]), Arguments.shift(args));
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
Sat Sep  8 18:55:53 2007
@@ -19,15 +19,11 @@
 
 package org.apache.geronimo.gshell.layout;
 
-import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
 
-import org.apache.geronimo.gshell.ShellInfo;
 import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
 import org.apache.geronimo.gshell.layout.model.Layout;
+import org.apache.geronimo.gshell.layout.loader.LayoutLoader;
 import org.apache.geronimo.gshell.plugin.PluginCollector;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -46,57 +42,24 @@
     implements LayoutManager, Initializable
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
-    @Requirement
-    private ShellInfo info;
 
     @Requirement
     private PluginCollector pluginCollector;
 
+    @Requirement
+    private LayoutLoader loader;
+    
     private Layout layout;
     
     public void initialize() throws InitializationException {
-        assert info != null;
+        assert loader != null;
 
-        //
-        // TODO: Move to a layout loader to abstract how this is loaded and allow for better
configuration...
-        //       may be able to use a LayoutFactory component here...
-        //
-        
-        URL url;
         try {
-            url = new File(info.getHomeDir(), "etc/layout.xml").toURI().toURL();
-        }
-        catch (MalformedURLException e) {
-            throw new InitializationException("Invalid URL for layout configuration", e);
-        }
-
-        try {
-            this.layout = load(url);
+            layout = loader.load();
         }
         catch (IOException e) {
-            throw new InitializationException("Failed to load layout from URL: " + url, e);
+            throw new InitializationException(e.getMessage(), e);
         }
-    }
-
-    private Layout load(final URL url) throws IOException {
-        assert url != null;
-
-        log.debug("Loading layout from XML: {}", url);
-
-        InputStream input = url.openStream();
-
-        Layout layout;
-        try {
-            layout = Layout.fromXML(input);
-        }
-        finally {
-           input.close();
-        }
-
-        log.debug("Loaded layout: {}", layout);
-
-        return layout;
     }
 
     public Layout getLayout() {

Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
(from r573906, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java&r1=573906&r2=573941&rev=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
Sat Sep  8 18:55:53 2007
@@ -17,25 +17,21 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.layout;
+package org.apache.geronimo.gshell.layout.loader;
+
+import java.io.IOException;
 
 import org.apache.geronimo.gshell.layout.model.Layout;
-import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
 
 /**
- * Provies the shell with a simple mechanism to organize commands.
+ * A simple abstraction for how one actually loads a layout.
  *
  * @version $Rev$ $Date$
  */
-public interface LayoutManager
+public interface LayoutLoader
 {
     /**
      * Returns the currently loaded layout; never null.
      */
-    Layout getLayout();
-
-    /**
-     * Find the command descriptor for the given path, or null if not found.
-     */
-    CommandDescriptor find(String path);
-}
+    Layout load() throws IOException;
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/LayoutLoader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
(from r573938, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java&r1=573938&r2=573941&rev=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
Sat Sep  8 18:55:53 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.layout;
+package org.apache.geronimo.gshell.layout.loader;
 
 import java.io.File;
 import java.io.IOException;
@@ -26,9 +26,8 @@
 import java.net.URL;
 
 import org.apache.geronimo.gshell.ShellInfo;
-import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
 import org.apache.geronimo.gshell.layout.model.Layout;
-import org.apache.geronimo.gshell.plugin.PluginCollector;
+import org.apache.geronimo.gshell.layout.loader.LayoutLoader;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -36,47 +35,45 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+//
+// FIXME: Should not need to specify a hint of "default" here, but the @Component will default
to "default"
+//        instead of null, as it should.
+//
+
 /**
- * The default implementation of a {@link LayoutManager}.
- *
+ * A simple XML to {@link Layout} loader, uses XStream to handle the dirty work.
+ * 
  * @version $Rev$ $Date$
  */
-@Component(role=LayoutManager.class, hint="default")
-public class DefaultLayoutManager
-    implements LayoutManager, Initializable
+@Component(role= LayoutLoader.class, hint="default") // hint="xml"
+public class XMLLayoutLoader
+    implements LayoutLoader, Initializable
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
+        
     @Requirement
     private ShellInfo info;
 
-    @Requirement
-    private PluginCollector pluginCollector;
+    //
+    // FIXME: Need to fix the @Configuration annotation so that it works...
+    //
+
+    // @Configuration(key="url", value={"etc/layout.xml"})
+    private URL url;
 
-    private Layout layout;
-    
     public void initialize() throws InitializationException {
         assert info != null;
 
-        //
-        // TODO: Move to a layout loader to abstract how this is loaded and allow for better
configuration...
-        //       may be able to use a LayoutFactory component here...
-        //
-        
-        URL url;
         try {
+            //
+            // HACK: Hard code this for now...
+            //
+            
             url = new File(info.getHomeDir(), "etc/layout.xml").toURI().toURL();
         }
         catch (MalformedURLException e) {
             throw new InitializationException("Invalid URL for layout configuration", e);
         }
-
-        try {
-            this.layout = load(url);
-        }
-        catch (IOException e) {
-            throw new InitializationException("Failed to load layout from URL: " + url, e);
-        }
     }
 
     private Layout load(final URL url) throws IOException {
@@ -99,28 +96,7 @@
         return layout;
     }
 
-    public Layout getLayout() {
-        if (layout == null) {
-            throw new IllegalStateException("Layout has not been initalized");
-        }
-        
-        return layout;
-    }
-
-    public CommandDescriptor find(final String path) {
-        assert path != null;
-
-        log.debug("Searching for command descriptor for path: {}", path);
-
-        //
-        // TODO: Need the current environment, so we can get the current group (pwd) and
search path, and then
-        //       use that to search the layout tree.
-        //
-
-        //
-        // HACK: For now, assume the path is just the id... should eventually change this
-        //
-
-        return pluginCollector.getCommandDescriptor(path);
+    public Layout load() throws IOException {
+        return load(url);
     }
 }

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/XMLLayoutLoader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java?rev=573941&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
Sat Sep  8 18:55:53 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Provides things that can load {@link Layout} instances.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.layout.loader;

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/loader/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Arguments.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Arguments.java?rev=573941&r1=573940&r2=573941&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Arguments.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Arguments.java
Sat Sep  8 18:55:53 2007
@@ -36,7 +36,7 @@
         assert args != null;
         assert args.length >= pos;
 
-        String[] _args = new String[args.length - pos];
+        Object[] _args = new Object[args.length - pos];
         System.arraycopy(args, pos, _args, 0, _args.length);
         return _args;
     }



Mime
View raw message