You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2008/10/03 18:09:45 UTC

svn commit: r701426 - in /myfaces/trinidad/branches/1.2.9.1-branch: trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd

Author: arobinson74
Date: Fri Oct  3 09:09:45 2008
New Revision: 701426

URL: http://svn.apache.org/viewvc?rev=701426&view=rev
Log:
Used the xsd substitutionGroup attribute to hack around the lack of support of xsd:choice in xsd:all. Fix for TRINIDAD-722

Modified:
    myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml   (contents, props changed)
    myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd

Modified: myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml?rev=701426&r1=701425&r2=701426&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml (original)
+++ myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml Fri Oct  3 09:09:45 2008
@@ -1,94 +1,94 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-    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.
-	   
--->
-<skins xmlns="http://myfaces.apache.org/trinidad/skin">
-    <skin>
-        <id>
-            purple.desktop
-        </id>
-        <family>
-            purple
-        </family>
-        <render-kit-id>
-            org.apache.myfaces.trinidad.desktop
-        </render-kit-id>
-        <style-sheet-name>
-            skins/purple/purpleSkin.css
-        </style-sheet-name>
-        <bundle-name>
-            org.apache.myfaces.trinidaddemo.resource.SkinBundle
-        </bundle-name>
-    </skin>
-    <!-- You can extend any skin you want. Here we want the purple
-    skin, but with a bigger font size -->
-    <skin>
-        <id>
-            purpleBigFont.desktop
-        </id>
-        <family>
-            purpleBigFont
-        </family>
-        <extends>
-            purple.desktop
-        </extends>
-        <render-kit-id>
-            org.apache.myfaces.trinidad.desktop
-        </render-kit-id>
-        <style-sheet-name>
-            skins/purple/purpleBigFontSkin.css
-        </style-sheet-name>
-        <translation-source>#{skinTranslationMap.contents}</translation-source>
-    </skin>    
-    <skin>
-        <id>
-            beach.desktop
-        </id>
-        <family>
-            beach
-        </family>
-        <render-kit-id>
-            org.apache.myfaces.trinidad.desktop
-        </render-kit-id>
-        <style-sheet-name>
-            skins/beach/beach.css
-        </style-sheet-name>
-        <translation-source>#{skinTranslationMap.resourceBundle}</translation-source>
-
-    </skin>
-    <skin>
-        <id>
-            suede.desktop
-        </id>
-        <family>
-            suede
-        </family>
-        <render-kit-id>
-            org.apache.myfaces.trinidad.desktop
-        </render-kit-id>
-        <style-sheet-name>
-            skins/suede/suede.css
-        </style-sheet-name>
-        <translation-source>#{skinTranslationMap.resourceBundle}</translation-source>
-    </skin>
-    <skin-addition>
-      <skin-id>purpleBigFont.desktop</skin-id>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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.
+	   
+-->
+<skins xmlns="http://myfaces.apache.org/trinidad/skin">
+    <skin>
+        <id>
+            purple.desktop
+        </id>
+        <family>
+            purple
+        </family>
+        <render-kit-id>
+            org.apache.myfaces.trinidad.desktop
+        </render-kit-id>
+        <style-sheet-name>
+            skins/purple/purpleSkin.css
+        </style-sheet-name>
+        <bundle-name>
+            org.apache.myfaces.trinidaddemo.resource.SkinBundle
+        </bundle-name>
+    </skin>
+    <!-- You can extend any skin you want. Here we want the purple
+    skin, but with a bigger font size -->
+    <skin>
+        <id>
+            purpleBigFont.desktop
+        </id>
+        <family>
+            purpleBigFont
+        </family>
+        <extends>
+            purple.desktop
+        </extends>
+        <render-kit-id>
+            org.apache.myfaces.trinidad.desktop
+        </render-kit-id>
+        <style-sheet-name>
+            skins/purple/purpleBigFontSkin.css
+        </style-sheet-name>
+        <translation-source>#{skinTranslationMap.contents}</translation-source>
+    </skin>    
+    <skin>
+        <id>
+            beach.desktop
+        </id>
+        <family>
+            beach
+        </family>
+        <render-kit-id>
+            org.apache.myfaces.trinidad.desktop
+        </render-kit-id>
+        <style-sheet-name>
+            skins/beach/beach.css
+        </style-sheet-name>
+        <translation-source>#{skinTranslationMap.resourceBundle}</translation-source>
+
+    </skin>
+    <skin>
+        <id>
+            suede.desktop
+        </id>
+        <family>
+            suede
+        </family>
+        <render-kit-id>
+            org.apache.myfaces.trinidad.desktop
+        </render-kit-id>
+        <style-sheet-name>
+            skins/suede/suede.css
+        </style-sheet-name>
+        <translation-source>#{skinTranslationMap.resourceBundle}</translation-source>
+    </skin>
+    <skin-addition>
+      <skin-id>purpleBigFont.desktop</skin-id>
     </skin-addition>
 
     <!-- A skin which demonstrates accessibility features,
@@ -100,5 +100,5 @@
       <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
       <style-sheet-name>skins/accdemo/accdemo.css</style-sheet-name>
     </skin>
-
-</skins>
+
+</skins>

Propchange: myfaces/trinidad/branches/1.2.9.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd?rev=701426&r1=701425&r2=701426&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd (original)
+++ myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/resources/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd Fri Oct  3 09:09:45 2008
@@ -16,7 +16,7 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-	   
+
 -->
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema"
             xmlns:skin="http://myfaces.apache.org/trinidad/skin"
@@ -45,7 +45,7 @@
     </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="skinType">
-    <xsd:sequence>
+    <xsd:all>
       <xsd:element name="id" type="string" minOccurs="1" maxOccurs="1">
         <xsd:annotation>
           <xsd:documentation>A string identifier which uniquely identifies this custom skin
@@ -78,25 +78,8 @@
                              skin.</xsd:documentation>
         </xsd:annotation>
       </xsd:element>
-      <xsd:choice>
-        <xsd:element name="bundle-name" type="string" minOccurs="0" maxOccurs="1">
-          <xsd:annotation>
-            <xsd:documentation>Name of the bundle for this skin. By default, the custom skin
-                               inherits the translations that are provided by the its parent skin.
-                               The custom skin can override any customizable message by defining its
-                               own ResourceBundles.</xsd:documentation>
-          </xsd:annotation>
-        </xsd:element>
-        <xsd:element name="translation-source" type="string" minOccurs="0" maxOccurs="1">
-          <xsd:annotation>
-            <xsd:documentation>This is an EL binding that can point to a Map or a ResourceBundle.
-                               You can use this instead of the bundle-name if you would like to be
-                               more dynamic in your skin translations at runtime. bundle-name takes
-                               precedence.</xsd:documentation>
-          </xsd:annotation>
-        </xsd:element>
-      </xsd:choice>
-    </xsd:sequence>
+      <xsd:element ref="skin:bundleSource" minOccurs="0" maxOccurs="1" />
+    </xsd:all>
   </xsd:complexType>
   <xsd:complexType name="skinAdditionType">
     <xsd:sequence>
@@ -112,23 +95,28 @@
                              addition.</xsd:documentation>
         </xsd:annotation>
       </xsd:element>
-      <xsd:choice>
-        <xsd:element name="bundle-name" type="string" minOccurs="0" maxOccurs="1">
-          <xsd:annotation>
-            <xsd:documentation>Name of the bundle for this skin addition.</xsd:documentation>
-          </xsd:annotation>
-        </xsd:element>
-        <xsd:element name="translation-source" type="string" minOccurs="0" maxOccurs="1">
-          <xsd:annotation>
-            <xsd:documentation>This is an EL binding that can point to a Map or a ResourceBundle.
-                               You can use this instead of the bundle-name if you would like to be
-                               more dynamic in your skin translations at runtime. bundle-name takes
-                               precedence.</xsd:documentation>
-          </xsd:annotation>
-        </xsd:element>
-      </xsd:choice>
+      <xsd:element ref="skin:bundleSource" minOccurs="0" maxOccurs="1" />
     </xsd:sequence>
   </xsd:complexType>
+  <!-- Use XSD "inheritance" of the substitution group to avoid the use of xsd:choice as it
+    is not allowed in an xsd:all element -->
+  <xsd:element name="bundleSource" type="xsd:string" abstract="true" />
+  <xsd:element name="bundle-name" type="xsd:string" substitutionGroup="skin:bundleSource">
+    <xsd:annotation>
+      <xsd:documentation>Name of the bundle for this skin or skin addition. For skins, by default,
+                         the custom skin inherits the translations that are provided by the
+                         its parent skin. The custom skin can override any customizable message
+                         by defining its own ResourceBundles.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:element name="translation-source" type="xsd:string" substitutionGroup="skin:bundleSource">
+    <xsd:annotation>
+      <xsd:documentation>This is an EL binding that can point to a Map or a ResourceBundle.
+                         You can use this instead of the bundle-name if you would like to be
+                         more dynamic in your skin translations at runtime. bundle-name takes
+                         precedence.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
 </xsd:schema>