You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2005/05/04 07:36:32 UTC

svn commit: r168075 - in /struts/shale/trunk/clay-plugin: build.xml src/conf/shale-clay.tld src/conf/view-config.dtd src/conf/view-config.xml src/java/org/apache/shale/clay/config/ClayXmlParser.java src/java/org/apache/shale/clay/config/Globals.java

Author: craigmcc
Date: Tue May  3 22:36:31 2005
New Revision: 168075

URL: http://svn.apache.org/viewcvs?rev=168075&view=rev
Log:
Automatically process a clay-config file in the META-INF directory of a JAR
file (same as the approach used to process implicit faces-config.xml files).
Also, add some docs in the DTD for configuration files.

PR:  Bugzilla #34698
Submitted By:  Gary VanMatre <gvanmatre AT comcast.net>

Modified:
    struts/shale/trunk/clay-plugin/build.xml
    struts/shale/trunk/clay-plugin/src/conf/shale-clay.tld
    struts/shale/trunk/clay-plugin/src/conf/view-config.dtd
    struts/shale/trunk/clay-plugin/src/conf/view-config.xml
    struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java
    struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java

Modified: struts/shale/trunk/clay-plugin/build.xml
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/build.xml?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/build.xml (original)
+++ struts/shale/trunk/clay-plugin/build.xml Tue May  3 22:36:31 2005
@@ -170,7 +170,7 @@
     </copy>
     <copy    todir="${build.home}/classes/META-INF">
       <fileset dir="src/conf"
-          includes="*.tld faces-config.xml"/>
+          includes="*.tld faces-config.xml view-config.xml"/>
     </copy>
   </target>
 

Modified: struts/shale/trunk/clay-plugin/src/conf/shale-clay.tld
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/conf/shale-clay.tld?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/conf/shale-clay.tld (original)
+++ struts/shale/trunk/clay-plugin/src/conf/shale-clay.tld Tue May  3 22:36:31 2005
@@ -1,65 +1,65 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-  Copyright 2004-2005 The Apache Software Foundation.
- 
-  Licensed 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.
--->
-
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
-                        "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-
-<taglib>
-
-  <tlib-version>1.0</tlib-version>
-  <jsp-version>1.2</jsp-version>
-  <short-name>sh</short-name>
-  <uri>http://struts.apache.org/shale/core</uri>
-  <description></description>
-
-  <listener>
-    <listener-class>org.apache.shale.clay.config.ClayConfigureListener</listener-class>
-  </listener>
-
-  <tag>
-
-    <name>clay</name>
-    <tag-class>org.apache.shale.clay.taglib.ClayTag</tag-class>
-
-    <attribute>
-      <name>id</name>
-      <required>true</required>
-      <rtexprvalue>false</rtexprvalue>
-    </attribute>
-
-    <attribute>
-      <name>jsfid</name>
-      <required>true</required>
-      <rtexprvalue>false</rtexprvalue>
-    </attribute>
-
-    <attribute>
-      <name>managedBeanName</name>
-      <required>false</required>
-      <rtexprvalue>false</rtexprvalue>
-    </attribute>
-
-    <attribute>
-      <name>shapeValidator</name>
-      <required>false</required>
-      <rtexprvalue>false</rtexprvalue>
-    </attribute>
-
-  </tag>
-
-</taglib>
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+  Copyright 2004-2005 The Apache Software Foundation.
+ 
+  Licensed 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.
+-->
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+                        "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+<taglib>
+
+  <tlib-version>1.0</tlib-version>
+  <jsp-version>1.2</jsp-version>
+  <short-name>sh</short-name>
+  <uri>http://struts.apache.org/shale/core</uri>
+  <description></description>
+
+  <listener>
+    <listener-class>org.apache.shale.clay.config.ClayConfigureListener</listener-class>
+  </listener>
+
+  <tag>
+
+    <name>clay</name>
+    <tag-class>org.apache.shale.clay.taglib.ClayTag</tag-class>
+
+    <attribute>
+      <name>id</name>
+      <required>true</required>
+      <rtexprvalue>false</rtexprvalue>
+    </attribute>
+
+    <attribute>
+      <name>jsfid</name>
+      <required>true</required>
+      <rtexprvalue>false</rtexprvalue>
+    </attribute>
+
+    <attribute>
+      <name>managedBeanName</name>
+      <required>false</required>
+      <rtexprvalue>false</rtexprvalue>
+    </attribute>
+
+    <attribute>
+      <name>shapeValidator</name>
+      <required>false</required>
+      <rtexprvalue>false</rtexprvalue>
+    </attribute>
+
+  </tag>
+
+</taglib>

Modified: struts/shale/trunk/clay-plugin/src/conf/view-config.dtd
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/conf/view-config.dtd?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/conf/view-config.dtd (original)
+++ struts/shale/trunk/clay-plugin/src/conf/view-config.dtd Tue May  3 22:36:31 2005
@@ -21,10 +21,41 @@
 
 -->
 
+<!--Boolean enumeration as two values that correspond to a boolean primitive data type-->
 <!ENTITY % Boolean "(true|false)">
 
+<!--
+  The "attributes" node contains all of the attributes that will be applied to the
+  the target "component" or "element".  Individual attributes are specified using the
+  "set" node, a child element.  
+  
+  When using JSF/JSP tags to define composition, the attributes are specified in the body
+  of the being JSP tag.  In clay, all components are represented generically by a top-level
+  "component" or nested "element" node.  The attributes are declared using within the 
+  "attributes" node verses a unique tag for each specific type of component.
+-->
 <!ELEMENT attributes (set+)>
 
+<!--
+  The "set" node represents an individual meta attribute that should be applied to the "component" 
+  or "element" nodes. 
+  
+  name - The attribute name that corresponds to a component property.  The parent "attributes" node
+         container can be inherited.  The "name" attribute acts as the "method signature" when 
+         resolving inheritance.
+         
+  useMethodLateBinding - This attribute informs the Clay component to pass a MethodBinding object to
+         to the component.  Currently all the standard method binding events, “action”, “actionListener”, 
+         “validator” and “valueChangeListner” are handled. This attribute is meant to be used by a custom 
+         component that has a non-standard attribute name for binding a method event.
+
+  useValueLateBinding - When this attribute is toggled on with a “true” value, the Clay component will pass 
+         a ValueBinding object to the component; otherwise, the component will receive the resulting value.  
+         The resulting value can be a literal or a expression language binding expression. 
+  
+  value - This attribute holds the value of the named attribute. A literal string value or a dynamic bound 
+         expression.  
+-->
 <!ELEMENT set EMPTY>
 <!ATTLIST set
 	name CDATA #REQUIRED
@@ -33,7 +64,48 @@
     value CDATA #IMPLIED
 >
 <!--
-  A component represents a single top-level simple component or a subtree of components.
+  A "component" represents a single top-level simple component or a subtree of components.
+  
+  attributes - A container to hold attributes that will be applied to the target component.
+  
+  converter - A component can have a single converter which is the same relationship that 
+      a JSF component would have to a Converter.  JSF has a assumed rule that only components 
+      implementing the ValueHolder interfaces can be assigned converters.  This rule is enforced 
+      at runtime and not through this document type definition.
+         
+  validator - A component can have zero or many associated validators.  Only components that 
+      implement the EditableValueHolder interfaces can be assigned validators.  This rule 
+      is enforced at runtime and not through this document type definition. 
+  
+  actionListener - A component can have zero or many assigned actionListeners.  Action listeners
+      can only be assigned to components implementing the ActionSource interfaces.  This rule is
+      enforced at runtime.
+
+  valueChangeListener - A component can have zero or many assigned valueChangeListeners.  Change listeners
+      can only be assigned to components implementing the EditableValueHolder interfaces.  This rule is
+      enforced at runtime.
+
+      
+   element - A top-level "component" can contain any number of sub "elements".  Elements define 
+      composition for a complex component.  The element is the glue that pulls in a “top-level” 
+      component.  The element is kind of like an inner class in that it can extend the attributes 
+      of the “top-level” component that it's aggregating.
+      
+      
+   jsfid - A unique identifier defining the component instances as it relates to the 
+      componentType.  This is a required attribute.
+   
+   extends - A jsfid that this component will inherit characteristics from. A jsfid that this 
+      component will inherit characteristics from. By  characteristics we mean parent “elements” 
+      and “attributes”.  This is an optional attribute.
+      
+   componentType - The component type will be the JSF registered logical name for Components,
+      Validators and Converters in the faces-config.xml file.  For ActionListeners and 
+      ValueChangeListeners, the component type will be the fully qualified class name.  The
+      componentType will be required when the extends attribute is not specified.  If the 
+      extends attribute is specified it will inherit the attribute value from the parent
+      component.  
+   
 -->
 <!ELEMENT component (attributes?, converter?, validator*, actionListener*, valueChangeListener*, element*)>
 <!ATTLIST component jsfid CDATA #REQUIRED
@@ -44,7 +116,45 @@
 
 <!--
    The element nodes are the composition glue.  The jsfid represents the top-level component that 
-   the nested component will extend.  
+   the nested component will extend.  The jsfid is used in the element like the componentType is 
+   to the "component".  The renderId is the unique namespace within the owning "component" or "element".
+   The key difference between an element and component is that a component can be reused within
+   any number of compositions where an element is the structure for defining the composition.
+   
+  attributes - A container to hold attributes that will be applied to the target component.  These
+       attributes will override and extend attributes in the top-level component which is specified
+       by the "jsfid" attribute.
+
+  converter - A component can have a single converter which is the same relationship that 
+      a JSF component would have to a Converter.  JSF has a assumed rule that only components 
+      implementing the ValueHolder interfaces can be assigned converters.  This rule is enforced 
+      at runtime and not through this document type definition.
+         
+  validator - A component can have zero or many associated validators.  Only components that 
+      implement the EditableValueHolder interfaces can be assigned validators.  This rule 
+      is enforced at runtime and not through this document type definition. 
+  
+  actionListener - A component can have zero or many assigned actionListeners.  Action listeners
+      can only be assigned to components implementing the ActionSource interfaces.  This rule is
+      enforced at runtime.
+
+  valueChangeListener - A component can have zero or many assigned valueChangeListeners.  Change listeners
+      can only be assigned to components implementing the EditableValueHolder interfaces.  This rule is
+      enforced at runtime.
+      
+  element - A "element" can contain any number of sub-elements.  Elements define 
+      composition for a complex component.  The element is the glue that pulls in a “top-level” 
+      component.  The element is kind of like an inner class in that it can extend the attributes 
+      of the “top-level” component that it's aggregating.  
+      
+  renderId - A numeric integer value that uniquely defines the element within a owning "component"
+      or "element".  It's the "method signature" used to resolve inheritances and also ordering 
+      within the parent.  A component that extends another can override or add nested "element"s 
+      by renderId.     
+      
+   id - This attribute corresponds to a JSF component's id attribute that will be used to derive
+      the client id value within the HTML id attribute.
+     
 -->
 <!ELEMENT element (attributes?, converter?, validator*, actionListener*, valueChangeListener*, element*)>
 <!ATTLIST element
@@ -52,17 +162,65 @@
 	jsfid CDATA #REQUIRED
 	id CDATA #IMPLIED
 >
-
+<!--
+  A "converter" node is the meta component definition for a JSF converter.  This 
+  node can exist under a "component" or "element" node.  A converter can only be
+  assigned to a JSF component implementing the ValueHolder interfaces.
+  
+  jsfid - The top-level component that defines a converter. The componentType
+     attribute of this component will should be a converter-id registered in
+     the faces-config.xml file.
+-->
 <!ELEMENT converter (attributes?)>
 <!ATTLIST converter jsfid CDATA #REQUIRED>
 
+
+<!--
+  A "actionListener" node is the meta component definition for a JSF action listener.  This 
+  node can exist under a "component" or "element" node.  A action listener can only be
+  assigned to a JSF component implementing the ActionSource interfaces.
+  
+  jsfid - The top-level component that defines a converter. The componentType
+     attribute of this component will should be a fully qualified class name
+     of the java class implementing the ActionListener interfaces.
+-->
 <!ELEMENT actionListener (attributes?)>
 <!ATTLIST actionListener jsfid CDATA #REQUIRED>
 
+<!--
+  A "validator" node is the meta component definition for a JSF validator.  This 
+  node can exist under a "component" or "element" node.  A converter can only be
+  assigned to a JSF component implementing the EditableValueHolder interfaces.
+  
+  jsfid - The top-level component that defines a validator. The componentType
+     attribute of this component will should be a validator-id registered in
+     the faces-config.xml file.
+-->
 <!ELEMENT validator (attributes?)>
 <!ATTLIST validator jsfid CDATA #REQUIRED>
 
+<!--
+  A "valueChangeListener" node is the meta component definition for a JSF value change listener. 
+  This node can exist under a "component" or "element" node.  A value change listener can only be
+  assigned to a JSF component implementing the EditableValueHolder interfaces.
+  
+  jsfid - The top-level component that defines a value change listener. The componentType
+     attribute of this component will should be a fully qualified class name
+     of the java class implementing the ValueChangeListener interfaces.
+-->
 <!ELEMENT valueChangeListener (attributes?)>
 <!ATTLIST valueChangeListener jsfid CDATA #REQUIRED>
 
+<!-- 
+  The "view" node is the root of the document.  This document holds meta data used to 
+  construct a sub component tree.  It's a stand-in for the JSF JSP tags meaning that
+  the same information can be represented here using a very generic structure.
+  
+  component - A top-level meta component definition that can be reused across pages 
+  and subtree compositions. 
+  
+  A component can be directly included from within a clay component by it's unique 
+  jsfid or tied to the view composition indirectly by a HTML template where the HTML 
+  element has a binding jsfid attribute.
+-->
 <!ELEMENT view (component*)>

Modified: struts/shale/trunk/clay-plugin/src/conf/view-config.xml
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/conf/view-config.xml?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/conf/view-config.xml (original)
+++ struts/shale/trunk/clay-plugin/src/conf/view-config.xml Tue May  3 22:36:31 2005
@@ -1,81 +1,92 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-
- Copyright 2004-2005 The Apache Software Foundation.
- 
- Licensed 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.
-
- $Id$
-
--->
-
-<!--DOCTYPE view SYSTEM "view-config.dtd"--> 
-
-<view>
-
-  <component jsfid="outputText" componentType="javax.faces.HtmlOutputText">
-    <attributes>
-      <set name="value" useValueLateBinding="true" />
-    </attributes>
-  </component>
-  <component jsfid="parameter" componentType="javax.faces.Parameter"/>
-  <component jsfid="selectItem" componentType="javax.faces.SelectItem"/>
-  <component jsfid="selectItems" componentType="javax.faces.SelectItems">
-    <attributes>
-      <set name="value" useValueLateBinding="true" />
-    </attributes>
-  </component>
-  <component jsfid="selectOneRadio" componentType="javax.faces.HtmlSelectOneRadio"/>
-  <component jsfid="selectOneMenu" componentType="javax.faces.HtmlSelectOneMenu"/>
-  <component jsfid="selectManyMenu" componentType="javax.faces.HtmlSelectManyMenu"/>
-  <component jsfid="manyCheckbox" componentType="javax.faces.HtmlSelectManyCheckbox"/>
-  <component jsfid="selectBooleanCheckbox" componentType="javax.faces.HtmlSelectBooleanCheckbox"/>
-  <component jsfid="panelGroup" componentType="javax.faces.HtmlPanelGroup"/>
-  <component jsfid="outputLink" componentType="javax.faces.HtmlOutputLink"/>
-  <component jsfid="outputLabel" componentType="javax.faces.HtmlOutputLabel"/>
-  <component jsfid="inputTextarea" componentType="javax.faces.HtmlInputTextarea"/>
-  <component jsfid="inputSecret" componentType="javax.faces.HtmlInputSecret"/>
-  <component jsfid="inputHidden" componentType="javax.faces.HtmlInputHidden"/>
-  <component jsfid="image" componentType="javax.faces.HtmlGraphicImage"/>
-  <component jsfid="form" componentType="javax.faces.HtmlForm"/>
-  <component jsfid="dataTable" componentType="javax.faces.HtmlDataTable"/>
-  <component jsfid="commandLink" componentType="javax.faces.HtmlCommandLink"/>
-  <component jsfid="column" componentType="javax.faces.Column"/>
-  <component jsfid="inputText" componentType="javax.faces.HtmlInputText"/>
-  <component jsfid="outputFormat" componentType="javax.faces.HtmlOutputFormat"/>
-  <component jsfid="messages" componentType="javax.faces.HtmlMessages"/>	
-  <component jsfid="message" componentType="javax.faces.HtmlMessage"/>	
-  <component jsfid="commandButton" componentType="javax.faces.HtmlCommandButton"/>	
-  <component jsfid="panelGrid" componentType="javax.faces.HtmlPanelGrid" />
-  <component jsfid="namingContainer" componentType="javax.faces.NamingContainer" />
-  <component jsfid="space" extends="outputText">
-    <attributes>
-      <set name="value" value="&amp;nbsp;" />
-      <set name="escape" value="false" />
-    </attributes>		
-  </component>
-  <component jsfid="integerConverter" componentType="javax.faces.Integer"/>   
-  <component jsfid="dateTimeConverter" componentType="javax.faces.DateTime" >
-    <attributes>
-      <set name="pattern" value="MM/dd/yyyy" />
-    </attributes>	
-    </component>
-    <component jsfid="validateLongRange" componentType="javax.faces.LongRange" >
-      <attributes>
-        <set name="minimum" value="5" />
-        <set name="maximum" value="10" />
-      </attributes>	
-    </component>
-
-</view>
+<!--
+
+ Copyright 2004-2005 The Apache Software Foundation.
+ 
+ Licensed 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.
+
+ $Id$
+
+-->
+
+<!DOCTYPE view PUBLIC "-//Apache Software Foundation//DTD Shale Clay View//EN" "http://jakarta.apache.org/struts/dtds/clay-config_1_1.dtd">
+<view>
+   <!-- 
+      The "Token" component emits a transactional token that is then
+      validated (on a subsequent form submit) to catch cases where the
+      same form was submitted more than once.
+    -->
+   <component jsfid="token" id="token" componentType="org.apache.shale.Token">
+      <attributes>
+         <set name="allowBody" value="false"/>
+      </attributes>   
+   </component>
+
+  <component jsfid="outputText" componentType="javax.faces.HtmlOutputText">
+    <attributes>
+      <!-- The current value of this component. -->
+      <set name="value" useValueLateBinding="true" />      
+    </attributes>
+  </component>
+    
+  <component jsfid="parameter" componentType="javax.faces.Parameter"/>
+  <component jsfid="param" componentType="javax.faces.Parameter"/>
+  
+  <component jsfid="selectItem" componentType="javax.faces.SelectItem"/>
+  <component jsfid="selectItems" componentType="javax.faces.SelectItems">
+    <attributes>
+      <set name="value" useValueLateBinding="true" />
+    </attributes>
+  </component>
+  <component jsfid="selectOneRadio" componentType="javax.faces.HtmlSelectOneRadio"/>
+  <component jsfid="selectOneMenu" componentType="javax.faces.HtmlSelectOneMenu"/>
+  <component jsfid="selectManyMenu" componentType="javax.faces.HtmlSelectManyMenu"/>
+  <component jsfid="manyCheckbox" componentType="javax.faces.HtmlSelectManyCheckbox"/>
+  <component jsfid="selectBooleanCheckbox" componentType="javax.faces.HtmlSelectBooleanCheckbox"/>
+  <component jsfid="panelGroup" componentType="javax.faces.HtmlPanelGroup"/>
+  <component jsfid="outputLink" componentType="javax.faces.HtmlOutputLink"/>
+  <component jsfid="outputLabel" componentType="javax.faces.HtmlOutputLabel"/>
+  <component jsfid="inputTextarea" componentType="javax.faces.HtmlInputTextarea"/>
+  <component jsfid="inputSecret" componentType="javax.faces.HtmlInputSecret"/>
+  <component jsfid="inputHidden" componentType="javax.faces.HtmlInputHidden"/>
+  <component jsfid="image" componentType="javax.faces.HtmlGraphicImage"/>
+  <component jsfid="form" componentType="javax.faces.HtmlForm"/>
+  <component jsfid="dataTable" componentType="javax.faces.HtmlDataTable"/>
+  <component jsfid="commandLink" componentType="javax.faces.HtmlCommandLink"/>
+  <component jsfid="column" componentType="javax.faces.Column"/>
+  <component jsfid="inputText" componentType="javax.faces.HtmlInputText"/>
+  <component jsfid="outputFormat" componentType="javax.faces.HtmlOutputFormat"/>
+  <component jsfid="messages" componentType="javax.faces.HtmlMessages"/>	
+  <component jsfid="message" componentType="javax.faces.HtmlMessage"/>	
+  <component jsfid="commandButton" componentType="javax.faces.HtmlCommandButton"/>	
+  <component jsfid="panelGrid" componentType="javax.faces.HtmlPanelGrid" />
+  <component jsfid="namingContainer" componentType="javax.faces.NamingContainer" />
+  <component jsfid="space" extends="outputText">
+    <attributes>
+      <set name="value" value="&amp;nbsp;" />
+      <set name="escape" value="false" />
+    </attributes>		
+  </component>
+  <component jsfid="integerConverter" componentType="javax.faces.Integer"/>   
+  <component jsfid="dateTimeConverter" componentType="javax.faces.DateTime" >
+    <attributes>
+      <set name="pattern" value="MM/dd/yyyy" />
+    </attributes>	
+    </component>
+    <component jsfid="validateLongRange" componentType="javax.faces.LongRange" >
+      <attributes>
+        <set name="minimum" value="5" />
+        <set name="maximum" value="10" />
+      </attributes>	
+    </component>
+
+</view>

Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/ClayXmlParser.java Tue May  3 22:36:31 2005
@@ -127,8 +127,17 @@
                     digester.clear();
                     digester.push(config);
                 }
-                InputSource in =
-                        new InputSource(config.getServletContext().getResourceAsStream(configFile));
+
+                InputSource in = null;
+                if (configFile.startsWith("META-INF")) {
+                
+                   ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+                   if(classloader == null)
+                       classloader = this.getClass().getClassLoader();
+
+                   in = new InputSource(classloader.getResourceAsStream(configFile));
+                } else
+                    in = new InputSource(config.getServletContext().getResourceAsStream(configFile));
                 try {
                     digester.parse(in);
                 } catch (IOException e) {

Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java?rev=168075&r1=168074&r2=168075&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java (original)
+++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/Globals.java Tue May  3 22:36:31 2005
@@ -78,7 +78,7 @@
      * components.
      *</p>
      */
-    public static final String DEFAULT_CLAY_CONFIG_FILE = "/WEB-INF/view-config.xml";
+    public static final String DEFAULT_CLAY_CONFIG_FILE = "META-INF/view-config.xml";
     
     /**
      * <p>The literal string used to identify that a clay subtree should be
@@ -197,4 +197,4 @@
                             "title", };
                             
                             
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org