Author: rich
Date: Mon Dec 13 16:22:23 2004
New Revision: 111766

URL: http://svn.apache.org/viewcvs?view=rev&rev=111766
Log:
Changed the javascript-id element in netui-config.xml to be an enumeration, 
with values "default", "legacy", or "legacyOnly".

DRT: netui (WinXP)
BB: self (linux)


Modified:
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
   incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java?view=diff&rev=111766&p1=incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java&r1=111765&p2=incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java&r2=111766
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
        Mon Dec 13 16:22:23 2004
@@ -108,13 +108,6 @@
         super( sourceFile, controllerClassName );
     }
     
-    void reset()
-    {
-        _actions = new HashSet< ActionInfo >();
-        _nested = false;
-        _returnActions = null;
-    }
-    
     void startBuild()
     {
         _isBuilding = true;

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java?view=diff&rev=111766&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java&r1=111765&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java&r2=111766
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
    Mon Dec 13 16:22:23 2004
@@ -13,23 +13,6 @@
  */
 final public class TagConfig
 {
-    /**
-     * This flag will turn on Legacy JavaScript support for id and name 
attributes.  When this is set
-     * the default tag JavaScript will also be output.
-     */
-    public static final  String LEGACY_JAVA_SCRIPT = "Legacy-JavaScript";
-
-    /**
-     * This flag will make Legacy JavaScript support the only type of 
JavaScript output for id and name
-     * attributes.
-     */
-    public static final String LEGACY_JAVA_SCRIPT_ONLY = 
"Legacy-JavaScript-Only";
-
-    // There are the javascript enum values
-    private static final int JAVASCRIPT_DEFAULT = 1;
-    private static final int JAVASCRIPT_LEGACY_ONLY = 2;
-    private static final int JAVASCRIPT_INCLUDE_LEGACY = 3;
-
     // This is the value of the javascript support for the webapp.  This should
     // be one of the enum values defined above.
     private static int javascriptMode = -1;
@@ -47,7 +30,8 @@
             setLegacyJavaScriptMode();
         }
         assert(javascriptMode != -1);
-        return (javascriptMode == JAVASCRIPT_INCLUDE_LEGACY || javascriptMode 
== JAVASCRIPT_LEGACY_ONLY);
+        return (javascriptMode == JspTagConfig.IdJavascript.INT_LEGACY
+                || javascriptMode == 
JspTagConfig.IdJavascript.INT_LEGACY_ONLY);
     }
 
     /**
@@ -60,7 +44,8 @@
             setLegacyJavaScriptMode();
         }
         assert(javascriptMode != -1);
-        return (javascriptMode == JAVASCRIPT_INCLUDE_LEGACY || javascriptMode 
== JAVASCRIPT_DEFAULT);
+        return (javascriptMode == JspTagConfig.IdJavascript.INT_DEFAULT
+                || javascriptMode == JspTagConfig.IdJavascript.INT_LEGACY);
      }
 
     /**
@@ -92,19 +77,10 @@
     private static void setLegacyJavaScriptMode() {
         JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
         if (tagConfig != null) {
-            String s = tagConfig.getIdJavascript();
-            if (LEGACY_JAVA_SCRIPT.equals(s)) {
-                javascriptMode = JAVASCRIPT_INCLUDE_LEGACY;
-            }
-            else if (LEGACY_JAVA_SCRIPT_ONLY.equals(s)) {
-                javascriptMode = JAVASCRIPT_LEGACY_ONLY;
-            }
-            else {
-                javascriptMode = JAVASCRIPT_DEFAULT;
-            }
+            javascriptMode = tagConfig.getIdJavascript().intValue();
         }
         else {
-            javascriptMode = JAVASCRIPT_DEFAULT;
+            javascriptMode = JspTagConfig.IdJavascript.INT_DEFAULT;
         }
         System.err.println("Javascript Mode:" + javascriptMode);
     }

Modified: incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd?view=diff&rev=111766&p1=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r1=111765&p2=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r2=111766
==============================================================================
--- incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd      
(original)
+++ incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd      Mon Dec 
13 16:22:23 2004
@@ -97,10 +97,20 @@
     <xsd:complexType name="jsp-tag-config">
         <xsd:sequence>
             <xsd:element name="doctype" type="xsd:string" minOccurs="0" 
maxOccurs="1"/>
-            <xsd:element name="id-javascript" type="xsd:string" minOccurs="0" 
maxOccurs="1"/>
+            <xsd:element name="id-javascript" minOccurs="0" maxOccurs="1" 
default="default">
+                <xsd:simpleType>
+                    <xsd:restriction base="xsd:string">
+                        <xsd:enumeration value="default"/>
+                        <!-- This flag will turn on Legacy JavaScript support 
for id and name attributes.  When this is
+                        set the default tag JavaScript will also be output. -->
+                        <xsd:enumeration value="legacy"/>
+                        <!-- This flag will make Legacy JavaScript support the 
only type of JavaScript output for id
+                        and name attributes. -->
+                        <xsd:enumeration value="legacyOnly"/>
+                    </xsd:restriction>
+                </xsd:simpleType>
+            </xsd:element>
             <xsd:element name="tree-image-location" type="xsd:string" 
minOccurs="0" maxOccurs="1"/>
-            <!-- @TODO: This needs to be removed.  We don't support this at 
the moment. -->
-            <xsd:element name="id-transparency" type="xsd:string" 
minOccurs="0" maxOccurs="1" default="false"/>
         </xsd:sequence>
     </xsd:complexType>
        

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml?view=diff&rev=111766&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml&r1=111765&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml&r2=111766
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
       (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
       Mon Dec 13 16:22:23 2004
@@ -49,7 +49,7 @@
 
     <jsp-tag-config>
        <doctype>html4-loose</doctype>
-       <id-javascript>Legacy-JavaScript</id-javascript>
+       <id-javascript>legacy</id-javascript>
        <tree-image-location>resources/images</tree-image-location>
     </jsp-tag-config>
 

Reply via email to