geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r698124 - in /geronimo/gshell/trunk/gshell-wisdom: gshell-wisdom-bootstrap/ gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/ gshell-wisdom-bootstrap/src/main/resources/META-INF/ gshell-wisdom-bootstrap/src/mai...
Date Tue, 23 Sep 2008 10:33:31 GMT
Author: jdillon
Date: Tue Sep 23 03:33:30 2008
New Revision: 698124

URL: http://svn.apache.org/viewvc?rev=698124&view=rev
Log:
Have to move the spring ns config stuff to gshell-wisdom-core so it has access to container
impls

Added:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/
  (props changed)
      - copied from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java
      - copied, changed from r697941, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
  (contents, props changed)
      - copied, changed from r697941, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginBeanDefinitionParser.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.handlers
      - copied, changed from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.handlers
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.schemas
      - copied, changed from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.schemas
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/
  (props changed)
      - copied from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
      - copied, changed from r697940, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
Removed:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.handlers
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.schemas
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/CommandBeanDefinitionParser.java
Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/pom.xml
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/pom.xml

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/pom.xml?rev=698124&r1=698123&r2=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/pom.xml Tue Sep 23 03:33:30
2008
@@ -72,6 +72,25 @@
             <groupId>org.apache.geronimo.gshell</groupId>
             <artifactId>gshell-application</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.support</groupId>
+            <artifactId>gshell-spring</artifactId>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/pom.xml?rev=698124&r1=698123&r2=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/pom.xml Tue Sep 23 03:33:30 2008
@@ -72,6 +72,25 @@
             <groupId>org.apache.geronimo.gshell</groupId>
             <artifactId>gshell-parser</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.support</groupId>
+            <artifactId>gshell-spring</artifactId>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java
(from r697941, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java&r1=697941&r2=698124&rev=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/GShellNamespaceHandler.java
Tue Sep 23 03:33:30 2008
@@ -31,9 +31,6 @@
     extends NamespaceHandlerSupport
 {
     public void init() {
-        registerBeanDefinitionParser("plugin", new PluginBeanDefinitionParser());
-        registerBeanDefinitionParser("command-bundle", new CommandBundleBeanDefinitionParser());
-        registerBeanDefinitionParser("command", new CommandBeanDefinitionParser());
-        registerBeanDefinitionParser("action", new ActionBeanDefinitionParser());
+        registerBeanDefinitionParser("plugin", new PluginParser());
     }
 }

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
(from r697941, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginBeanDefinitionParser.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginBeanDefinitionParser.java&r1=697941&r2=698124&rev=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginBeanDefinitionParser.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
Tue Sep 23 03:33:30 2008
@@ -19,25 +19,44 @@
 
 package org.apache.geronimo.gshell.wisdom.config;
 
+import org.apache.geronimo.gshell.wisdom.plugin.PluginImpl;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
 import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.util.xml.DomUtils;
 import org.w3c.dom.Element;
 
+import java.util.List;
+
 /**
  * Parser for the &lt;gshell:plugin/&gt; element.
  *
  * @version $Rev$ $Date$
  */
-public class PluginBeanDefinitionParser
-    implements BeanDefinitionParser
+public class PluginParser
+    extends AbstractBeanDefinitionParser
 {
-    public BeanDefinition parse(final Element element, final ParserContext parserContext)
{
+    protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext
parserContext) {
         assert element != null;
         assert parserContext != null;
 
-        // TODO:
+        BeanDefinitionBuilder plugin = BeanDefinitionBuilder.rootBeanDefinition(PluginImpl.class);
+        plugin.addPropertyValue("id", element.getAttribute("name"));
+
+        @SuppressWarnings({"unchecked"})
+        List<Element> children = DomUtils.getChildElementsByTagName(element, "command-bundle");
+        if (children != null && children.size() > 0) {
+            parseCommandBundles(plugin, children);
+        }
+
+        return plugin.getBeanDefinition();
+    }
+
+    private void parseCommandBundles(final BeanDefinitionBuilder plugin, final List<Element>
elements) {
+        assert elements != null;
+        assert plugin != null;
+
 
-        return null;
     }
 }
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/config/PluginParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.handlers
(from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.handlers)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.handlers?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.handlers&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.handlers&r1=697915&r2=698124&rev=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.handlers
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.handlers
Tue Sep 23 03:33:30 2008
@@ -21,4 +21,4 @@
 ## $Rev: 697807 $ $Date: 2008-09-22 20:12:04 +0700 (Mon, 22 Sep 2008) $
 ##
 
-http\://gshell.org/schema/wisdom/gshell=org.apache.geronimo.gshell.wisdom.config.GShellNamespaceHandler
\ No newline at end of file
+http\://gshell.org/schema/wisdom-gshell=org.apache.geronimo.gshell.wisdom.config.GShellNamespaceHandler
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.schemas
(from r697915, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.schemas)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.schemas?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.schemas&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.schemas&r1=697915&r2=698124&rev=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/META-INF/spring.schemas
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring.schemas
Tue Sep 23 03:33:30 2008
@@ -21,4 +21,4 @@
 ## $Rev: 697807 $ $Date: 2008-09-22 20:12:04 +0700 (Mon, 22 Sep 2008) $
 ##
 
-http\://gshell.org/schema/wisdom/gshell/wisdom-gshell.xsd=org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
+http\://gshell.org/schema/wisdom-gshell/wisdom-gshell.xsd=org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
(from r697940, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd&r1=697940&r2=698124&rev=698124&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/config/wisdom-gshell.xsd
Tue Sep 23 03:33:30 2008
@@ -20,10 +20,10 @@
 
 <!-- $Rev$ $Date$ -->
 
-<xsd:schema xmlns="http://gshell.org/schema/wisdom/gshell"
+<xsd:schema xmlns="http://gshell.org/schema/wisdom-gshell"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:beans="http://www.springframework.org/schema/beans"
-        targetNamespace="http://gshell.org/schema/wisdom/gshell"
+        targetNamespace="http://gshell.org/schema/wisdom-gshell"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
 
@@ -35,6 +35,74 @@
         ]]></xsd:documentation>
     </xsd:annotation>
 
-    <!-- TODO: -->
+    <xsd:element name="plugin">
+        <xsd:complexType>
+            <xsd:annotation>
+                <xsd:documentation>
+                    Defines a plugin.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+                <xsd:element ref="command-bundle" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+            <xsd:attribute name="name" type="xsd:string" use="required"/>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="command-bundle">
+        <xsd:complexType>
+            <xsd:annotation>
+                <xsd:documentation>
+                    Defines a command bundle.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+                <xsd:element ref="command" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+            <xsd:attribute name="name" type="xsd:string" use="required"/>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="command">
+        <xsd:complexType>
+            <xsd:annotation>
+                <xsd:documentation>
+                    Defines a command.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+                <xsd:element ref="action" minOccurs="0" maxOccurs="1"/>
+            </xsd:sequence>
+            <xsd:attribute name="name" type="xsd:string" use="required"/>
+            <xsd:attribute name="type" type="xsd:string" use="optional" default="stateful">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The command type.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:simpleType>
+                    <xsd:restriction base="xsd:string">
+                        <xsd:enumeration value="stateless"/>
+                        <xsd:enumeration value="stateful"/>
+                    </xsd:restriction>
+                </xsd:simpleType>
+            </xsd:attribute>
+            <xsd:attribute name="action" type="xsd:string" use="optional"/>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="action">
+        <xsd:complexType>
+            <xsd:annotation>
+                <xsd:documentation>
+                    Defines a command action.
+                </xsd:documentation>
+            </xsd:annotation>
+            <!--
+            TODO: Allow nested beans:bean
+            -->
+            <xsd:attribute name="class" type="xsd:string" use="optional"/>
+        </xsd:complexType>
+    </xsd:element>
 
 </xsd:schema>
\ No newline at end of file



Mime
View raw message