You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/09/10 22:52:14 UTC

svn commit: r995982 - in /myfaces/tobago/trunk/tobago-core/src/main: java/org/apache/myfaces/tobago/config/ resources/org/apache/myfaces/tobago/config/

Author: lofwyr
Date: Fri Sep 10 20:52:13 2010
New Revision: 995982

URL: http://svn.apache.org/viewvc?rev=995982&view=rev
Log:
TOBAGO-914 and TOBAGO-915
- preparation the DTD on webserver
- using nicer name for the new DTDs
- defining (SNAPSHOT) DTD for Tobago 1.5
- clean up

Added:
    myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd   (contents, props changed)
      - copied, changed from r995893, myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd
    myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd
Removed:
    myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd
Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java?rev=995982&r1=995981&r2=995982&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java Fri Sep 10 20:52:13 2010
@@ -36,8 +36,9 @@ public class TobagoConfigParser {
 
   private static final Logger LOG = LoggerFactory.getLogger(TobagoConfigParser.class);
 
-  private static final String TOBAGO_CONFIG_DTD = "/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd";
-  private static final String TOBAGO_CONFIG_DTD_1_0_29 = "/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd";
+  private static final String TOBAGO_CONFIG_DTD_1_0 = "/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd";
+  private static final String TOBAGO_CONFIG_DTD_1_0_29 = "/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd";
+  private static final String TOBAGO_CONFIG_DTD_1_5 = "/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd";
 
   public TobagoConfig parse(ServletContext context) throws IOException, SAXException, FacesException {
 
@@ -83,7 +84,7 @@ public class TobagoConfigParser {
 
     String configPath = "/WEB-INF/tobago-config.xml";
     InputStream input = null;
-    registerDtd(digester);
+    registerDtds(digester);
     try {
       input = context.getResourceAsStream(configPath);
       if (input != null) {
@@ -96,18 +97,22 @@ public class TobagoConfigParser {
     }
   }
 
-  private void registerDtd(Digester digester) {
-    URL url = TobagoConfigParser.class.getResource(TOBAGO_CONFIG_DTD);
-    URL url1029 = TobagoConfigParser.class.getResource(TOBAGO_CONFIG_DTD_1_0_29);
+  private void registerDtds(Digester digester) {
+    registerDtd(digester, "-//Atanion GmbH//DTD Tobago Config 1.0//EN", TOBAGO_CONFIG_DTD_1_0);
+    registerDtd(digester, "-//The Apache Software Foundation//DTD Tobago Config 1.0//EN", TOBAGO_CONFIG_DTD_1_0);
+    registerDtd(digester, "-//The Apache Software Foundation//DTD Tobago Config 1.0.29//EN", TOBAGO_CONFIG_DTD_1_0_29);
+    registerDtd(digester, "-//The Apache Software Foundation//DTD Tobago Config 1.5//EN", TOBAGO_CONFIG_DTD_1_5);
+  }
+
+  private void registerDtd(Digester digester, String publicId, String entityUrl) {
+    URL url = TobagoConfigParser.class.getResource(entityUrl);
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Registering dtd: url={}", url);
+      LOG.debug("Registering dtd: url='{}'", url);
     }
     if (null != url) {
-      digester.register("-//Atanion GmbH//DTD Tobago Config 1.0//EN", url.toString());
-      digester.register("-//The Apache Software Foundation//DTD Tobago Config 1.0//EN", url.toString());
-      digester.register("-//The Apache Software Foundation//DTD Tobago Config 1.0.29//EN", url1029.toString());
+      digester.register(publicId, url.toString());
     } else {
-      LOG.warn("Unable to retrieve local DTD '" + TOBAGO_CONFIG_DTD + "'; trying external URL");
+      LOG.warn("Unable to retrieve local DTD '" + entityUrl + "'; trying external URL");
     }
   }
 }

Copied: myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd (from r995893, myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd?p2=myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd&p1=myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd&r1=995893&r2=995982&rev=995982&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0_29.dtd (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd Fri Sep 10 20:52:13 2010
@@ -19,7 +19,7 @@
 
 <!ENTITY % Boolean "(true|false|yes|no)">
 
-<!ELEMENT tobago-config (theme-config, resource-dir*, load-theme-resources-from-classpath?, mapping-rule*, ajax-enabled?, fix-resource-order?, renderers?)>
+<!ELEMENT tobago-config (theme-config, resource-dir*, ajax-enabled?, fix-resource-order?, renderers?)>
 
 <!ELEMENT theme-config (default-theme, supported-theme*)>
 <!ELEMENT default-theme (#PCDATA)>
@@ -31,20 +31,6 @@
 
 <!ELEMENT resource-dir (#PCDATA)>
 
-<!-- deprecated -->
-<!ELEMENT load-theme-resources-from-classpath (#PCDATA)>
-
-<!-- deprecated -->
-<!ELEMENT mapping-rule (request-uri, forward-uri, attribute*)>
-<!-- deprecated -->
-<!ELEMENT request-uri (#PCDATA)>
-<!-- deprecated -->
-<!ELEMENT forward-uri (#PCDATA)>
-
-<!ELEMENT attribute (key, value)>
-<!ELEMENT key (#PCDATA)>
-<!ELEMENT value (#PCDATA)>
-
 <!ELEMENT ajax-enabled (#PCDATA)>
 
 <!ELEMENT fix-resource-order (#PCDATA)>

Propchange: myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd?rev=995982&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd (added)
+++ myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.5.dtd Fri Sep 10 20:52:13 2010
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * 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.
+-->
+
+<!ENTITY % Boolean "(true|false|yes|no)">
+
+<!ELEMENT tobago-config (theme-config, resource-dir*, renderers?)>
+
+<!ELEMENT theme-config (default-theme, supported-theme*)>
+<!ELEMENT default-theme (#PCDATA)>
+<!ELEMENT supported-theme (#PCDATA)>
+
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT display-name (#PCDATA)>
+<!ELEMENT fallback (#PCDATA)>
+
+<!ELEMENT resource-dir (#PCDATA)>
+
+<!ELEMENT renderers (renderer)*>
+<!ELEMENT renderer (name|supported-markup)*>
+<!ELEMENT supported-markup (markup)*>
+<!ELEMENT markup (#PCDATA)>