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:49:00 UTC

svn commit: r995980 - in /myfaces/tobago/branches/tobago-1.0.x/core/src/main: java/org/apache/myfaces/tobago/config/ resources/org/apache/myfaces/tobago/config/

Author: lofwyr
Date: Fri Sep 10 20:49:00 2010
New Revision: 995980

URL: http://svn.apache.org/viewvc?rev=995980&view=rev
Log:
TOBAGO-914
 - clean up

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java?rev=995980&r1=995979&r2=995980&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java Fri Sep 10 20:49:00 2010
@@ -21,6 +21,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.context.RenderersConfig;
 import org.apache.myfaces.tobago.context.Theme;
+import org.apache.myfaces.tobago.util.Deprecation;
 
 import javax.faces.context.FacesContext;
 import java.util.ArrayList;
@@ -56,6 +57,7 @@ public class TobagoConfig {
   }
 
   public void addMappingRule(MappingRule mappingRule) {
+    Deprecation.LOG.warn("mapping rules are deprecated");
     if (LOG.isDebugEnabled()) {
       LOG.debug("addMappingRule: {" + mappingRule + "}");
     }
@@ -182,7 +184,7 @@ public class TobagoConfig {
 
   @Deprecated
   public void setLoadThemesFromClasspath(String loadThemesFromClasspath) {
-    LOG.warn("Deprecated: setting load-theme-resources-from-classpath is "
+    Deprecation.LOG.error("Deprecated: setting load-theme-resources-from-classpath is "
         + "no longer supported");
   }
 

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java?rev=995980&r1=995979&r2=995980&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java Fri Sep 10 20:49:00 2010
@@ -40,7 +40,7 @@ import java.net.URL;
 public class TobagoConfigParser {
 
   private static final Log LOG = LogFactory.getLog(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 = "/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";
 
   public TobagoConfig parse(ServletContext context)
@@ -108,7 +108,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) {
@@ -122,18 +122,21 @@ 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);
+  }
+
+  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");
     }
   }
 }

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd?rev=995980&r1=995979&r2=995980&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-1.0.29.dtd Fri Sep 10 20:49:00 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)>