geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r699574 - in /geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main: java/org/apache/geronimo/gshell/commands/builtins/ resources/META-INF/spring/ resources/org/apache/geronimo/gshell/commands/builtins/
Date Sat, 27 Sep 2008 07:01:53 GMT
Author: jdillon
Date: Sat Sep 27 00:01:53 2008
New Revision: 699574

URL: http://svn.apache.org/viewvc?rev=699574&view=rev
Log:
Adding about command to show details about the current application

Added:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
  (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
  (contents, props changed)
      - copied, changed from r699454, geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties
Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml

Added: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java?rev=699574&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
(added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
Sat Sep 27 00:01:53 2008
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.commands.builtins;
+
+import org.apache.geronimo.gshell.application.Application;
+import org.apache.geronimo.gshell.application.ApplicationManager;
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.io.IO;
+import org.apache.geronimo.gshell.model.application.ApplicationModel;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Display information about the current GShell application.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AboutAction
+    implements CommandAction
+{
+    @Autowired
+    private ApplicationManager applicationManager;
+    
+    public Object execute(CommandContext context) throws Exception {
+        assert context != null;
+        IO io = context.getIo();
+
+        assert applicationManager != null;
+        Application app = applicationManager.getApplication();
+        ApplicationModel model = app.getModel();
+
+        String id = app.getId();
+        String name = model.getName();
+
+        if (name == null) {
+            io.info("{}", id);
+        }
+        else {
+            io.info("{} ({})", name, id);
+        }
+
+        io.info("{}", model.getVersion());
+
+        //
+        // TODO: Add more options to get specific details out.  Hook up the branding muck
here too.
+        //
+        
+        return Result.SUCCESS;
+    }
+}

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AboutAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml?rev=699574&r1=699573&r2=699574&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
Sat Sep 27 00:01:53 2008
@@ -29,6 +29,10 @@
 
     <gshell:plugin name="gshell-builtins">
         <gshell:command-bundle name="default">
+            <gshell:command name="about">
+                <gshell:action class="org.apache.geronimo.gshell.commands.builtins.AboutAction"/>
+            </gshell:command>
+
             <gshell:command name="help">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.HelpAction"/>
             </gshell:command>

Copied: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
(from r699454, geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties?p2=geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties&p1=geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties&r1=699454&r2=699574&rev=699574&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
Sat Sep 27 00:01:53 2008
@@ -21,15 +21,9 @@
 ## $Rev$ $Date$
 ##
 
-command.name=alias
+command.name=about
 
-command.description=Define an alias.
-
-command.argument.name=Name of the alias to define.
-command.argument.name.token=NAME
-
-command.argument.target=Target command to be aliased as NAME.
-command.argument.target.token=TARGET
+command.description=Display information about the current GShell application.
 
 command.manual=\
-  TODO: alias manual
\ No newline at end of file
+  TODO: about manual
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AboutAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message