beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekon...@apache.org
Subject svn commit: r385891 - in /beehive/trunk/netui: src/core/org/apache/beehive/netui/core/chain/ src/util/org/apache/beehive/netui/util/config/bean/ src/util/org/apache/beehive/netui/util/config/internal/ src/util/org/apache/beehive/netui/util/config/inter...
Date Tue, 14 Mar 2006 21:10:21 GMT
Author: ekoneil
Date: Tue Mar 14 13:10:19 2006
New Revision: 385891

URL: http://svn.apache.org/viewcvs?rev=385891&view=rev
Log:
Rework the definition of a <command> element from:

  <command id="..." classname="...">
    <custom-property/>
    ...
  </command>

to:

  <command>
    <id>...</id>
    <command-class>...</command-class>
    <custom-property/>
    ...
  </command>

so that while it's more verbose to author, it's more symmetric with the rest of the beehive-netui-config.xsd
definition.

BB: self
Test: NetUI BVT pass


Modified:
    beehive/trunk/netui/src/core/org/apache/beehive/netui/core/chain/CatalogFactory.java
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CommandConfig.java
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/CatalogParser.java
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/catalog-config.xsd
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd
    beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/CatalogParserTest.java
    beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/xmls/simple-chain.xml
    beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/util/config/xmls/beehive-netui-config-with-chain.xml

Modified: beehive/trunk/netui/src/core/org/apache/beehive/netui/core/chain/CatalogFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/core/org/apache/beehive/netui/core/chain/CatalogFactory.java?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/core/org/apache/beehive/netui/core/chain/CatalogFactory.java (original)
+++ beehive/trunk/netui/src/core/org/apache/beehive/netui/core/chain/CatalogFactory.java Tue
Mar 14 13:10:19 2006
@@ -86,7 +86,7 @@
             }
             else {
                 Command command = createCommand(commandConfig);
-                catalog.addCommand(commandConfig.getName(), command);
+                catalog.addCommand(commandConfig.getId(), command);
             }
         }
         catalogFactory.setCatalog(catalog);

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CommandConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CommandConfig.java?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CommandConfig.java
(original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CommandConfig.java
Tue Mar 14 13:10:19 2006
@@ -26,7 +26,6 @@
  */
 public class CommandConfig {
 
-    private String _name;
     private String _id;
     private String _classname;
     private LinkedList _parameters;
@@ -45,14 +44,6 @@
 
     public void setId(String id) {
         _id = id;
-    }
-
-    public String getName() {
-        return _name;
-    }
-
-    public void setName(String name) {
-        _name = name;
     }
 
     public String getClassname() {

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml
(original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml
Tue Mar 14 13:10:19 2006
@@ -51,8 +51,12 @@
 
     <catalog>
         <chain name="xhr-servlet">
-            <command classname="org.apache.beehive.netui.tags.tree.TreeCRI"/>
-            <command classname="org.apache.beehive.netui.tags.divpanel.DivPanelCRI"/>
+            <command>
+                <command-class>org.apache.beehive.netui.tags.tree.TreeCRI</command-class>
+            </command>
+            <command>
+                <command-class>org.apache.beehive.netui.tags.divpanel.DivPanelCRI</command-class>
+            </command>
         </chain>
     </catalog>
 </netui-config>

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/CatalogParser.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/CatalogParser.java?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/CatalogParser.java
(original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/CatalogParser.java
Tue Mar 14 13:10:19 2006
@@ -79,7 +79,7 @@
 
             db.setEntityResolver(new EntityResolver() {
                 public InputSource resolveEntity(String publicId, String systemId) {
-                    if(systemId.endsWith("/chain-config.xsd")) {
+                    if(systemId.endsWith("/catalog-config.xsd")) {
                         InputStream inputStream = getClass().getClassLoader().getResourceAsStream(CONFIG_SCHEMA);
                         return new InputSource(inputStream);
                     }
@@ -138,9 +138,7 @@
                     }
                     else if(node.getNodeName().equals("command")) {
                         Element element = (Element)node;
-                        String name = element.getAttribute("name");
                         CommandConfig commandConfig = parseCommand(element);
-                        commandConfig.setName(name);
                         catalogConfig.addCommand(commandConfig);
                     }
                 }
@@ -155,8 +153,8 @@
         assert element.getNodeName().equals("command");
 
         CommandConfig commandConfig = new CommandConfig();
-        String id = element.getAttribute("id");
-        String classname = element.getAttribute("classname");
+        String id = DomUtils.getChildElementText(element, "id");
+        String classname = DomUtils.getChildElementText(element, "command-class");
         commandConfig.setId(id);
         commandConfig.setClassname(classname);
 

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/catalog-config.xsd
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/catalog-config.xsd?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/catalog-config.xsd
(original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/internal/catalog/catalog-config.xsd
Tue Mar 14 13:10:19 2006
@@ -40,11 +40,10 @@
 
     <xsd:complexType name="command">
         <xsd:sequence>
+            <xsd:element name="id" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+            <xsd:element name="command-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
             <xsd:element name="custom-property" type="netui:custom-property" minOccurs="0"
maxOccurs="unbounded"/>
         </xsd:sequence>
-        <xsd:attribute name="id" type="xsd:string"/>
-        <xsd:attribute name="name" type="xsd:string"/>
-        <xsd:attribute name="classname" type="xsd:string"/>
     </xsd:complexType>
 
     <xsd:complexType name="custom-property">

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd
(original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd
Tue Mar 14 13:10:19 2006
@@ -327,11 +327,10 @@
 
     <xsd:complexType name="command">
         <xsd:sequence>
+            <xsd:element name="id" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+            <xsd:element name="command-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
             <xsd:element name="custom-property" type="netui:custom-property" minOccurs="0"
maxOccurs="unbounded"/>
         </xsd:sequence>
-        <xsd:attribute name="id" type="xsd:string"/>
-        <xsd:attribute name="name" type="xsd:string"/>
-        <xsd:attribute name="classname" type="xsd:string"/>
     </xsd:complexType>
 
 </xsd:schema>

Modified: beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/CatalogParserTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/CatalogParserTest.java?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/CatalogParserTest.java
(original)
+++ beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/CatalogParserTest.java
Tue Mar 14 13:10:19 2006
@@ -59,6 +59,7 @@
         Catalog catalog = catalogFactory.getCatalog();
         Command command = catalog.getCommand("configurable");
         ConfigurableCommand configurableCommand = (ConfigurableCommand)command;
+        assertNotNull(configurableCommand);
         assertEquals(54321, configurableCommand.getBar());
         assertEquals("Homer", configurableCommand.getFoo());
 

Modified: beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/xmls/simple-chain.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/xmls/simple-chain.xml?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/xmls/simple-chain.xml
(original)
+++ beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/chain/xmls/simple-chain.xml
Tue Mar 14 13:10:19 2006
@@ -2,25 +2,33 @@
 
 <catalog xmlns="http://beehive.apache.org/netui/2004/server/config">
     <chain name="echo-1234">
-        <command id="1" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>1</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo 1</value>
             </custom-property>
         </command>
-        <command id="2" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>2</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo 2</value>
             </custom-property>
         </command>
-        <command id="3" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>3</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo 3</value>
             </custom-property>
         </command>
-        <command id="4" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>4</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo 4</value>
@@ -28,20 +36,26 @@
         </command>
     </chain>
     <chain name="echo-abc">
-        <command id="1" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>1</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo aaa</value>
             </custom-property>
         </command>
-        <command id="2" classname="org.apache.beehive.netui.test.core.chain.commands.EchoCommand">
+        <command>
+            <id>2</id>
+            <command-class>org.apache.beehive.netui.test.core.chain.commands.EchoCommand</command-class>
             <custom-property>
                 <name>message</name>
                 <value>echo bbb</value>
             </custom-property>
         </command>
     </chain>
-    <command name="configurable" classname="org.apache.beehive.netui.test.core.chain.commands.ConfigurableCommand">
+    <command>
+        <id>configurable</id>
+        <command-class>org.apache.beehive.netui.test.core.chain.commands.ConfigurableCommand</command-class>
         <custom-property>
             <name>foo</name>
             <value>Homer</value>

Modified: beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/util/config/xmls/beehive-netui-config-with-chain.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/util/config/xmls/beehive-netui-config-with-chain.xml?rev=385891&r1=385890&r2=385891&view=diff
==============================================================================
--- beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/util/config/xmls/beehive-netui-config-with-chain.xml
(original)
+++ beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/util/config/xmls/beehive-netui-config-with-chain.xml
Tue Mar 14 13:10:19 2006
@@ -49,8 +49,14 @@
 
     <catalog>
         <chain name="xhr-servlet">
-            <command id="1" classname="Foobar"/>
-            <command id="2" classname="Raboof"/>
+            <command>
+                <id>1</id>
+                <command-class>Foobar</command-class>
+            </command>
+            <command>
+                <id>2</id>
+                <command-class>Raboof</command-class>
+            </command>
         </chain>
     </catalog>
 



Mime
View raw message