You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/02/26 16:19:23 UTC

svn commit: r511848 - /lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java

Author: nettings
Date: Mon Feb 26 07:19:22 2007
New Revision: 511848

URL: http://svn.apache.org/viewvc?view=rev&rev=511848
Log:
fixed handling of proxy configuration (now nested!)

Modified:
    lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java

Modified: lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java?view=diff&rev=511848&r1=511847&r2=511848
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java Mon Feb 26 07:19:22 2007
@@ -176,29 +176,24 @@
                 this.siteManagerName = siteManagerConfiguration.getAttribute(ATTRIBUTE_NAME);
             }
 
-            Configuration[] proxyConfigs = config.getChild(ELEMENT_PROXIES).getChildren(ELEMENT_PROXY);
-            // backwards-compatibility. rip out for lenya releases post 1.4.x:
-            if (proxyConfigs.length == 0) {
-              proxyConfigs = config.getChildren(ELEMENT_PROXY);
-              if (proxyConfigs.length > 0)
-                   getLogger().warn("Deprecated configuration: <proxy> elements in " + configFile
-                       + " must be grouped in a <proxies>...</proxies> element."
-                       + " See webapp/lenya/resources/schemas/publication.xconf.");
-            }
-            for (int i = 0; i < proxyConfigs.length; i++) {
-                String url = proxyConfigs[i].getAttribute(ATTRIBUTE_URL);
-                String ssl = proxyConfigs[i].getAttribute(ATTRIBUTE_SSL);
-                String area = proxyConfigs[i].getAttribute(ATTRIBUTE_AREA);
-
-                Proxy proxy = new Proxy();
-                proxy.setUrl(url);
-
-                Object key = getProxyKey(area, Boolean.valueOf(ssl).booleanValue());
-                this.areaSsl2proxy.put(key, proxy);
-                if (getLogger().isDebugEnabled()) {
-                    getLogger().debug(
-                            "Adding proxy: [" + proxy + "] for area=[" + area + "] SSL=[" + ssl
-                                    + "]");
+            Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
+            if (proxyConfig != null) {
+                Configuration[] proxyConfigs = proxyConfig.getChildren(ELEMENT_PROXY);
+                for (int i = 0; i < proxyConfigs.length; i++) {
+                    String url = proxyConfigs[i].getAttribute(ATTRIBUTE_URL);
+                    String ssl = proxyConfigs[i].getAttribute(ATTRIBUTE_SSL);
+                    String area = proxyConfigs[i].getAttribute(ATTRIBUTE_AREA);
+    
+                    Proxy proxy = new Proxy();
+                    proxy.setUrl(url);
+    
+                    Object key = getProxyKey(area, Boolean.valueOf(ssl).booleanValue());
+                    this.areaSsl2proxy.put(key, proxy);
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().debug(
+                                "Adding proxy: [" + proxy + "] for area=[" + area + "] SSL=[" + ssl
+                                        + "]");
+                    }
                 }
             }
 
@@ -228,14 +223,17 @@
                 getLogger().info("No content directory specified within pub configuration!");
             }
 
-            Configuration[] resourceTypeConfigs = config.getChildren(ELEMENT_RESOURCE_TYPE);
-            for (int i = 0; i < resourceTypeConfigs.length; i++) {
-                String name = resourceTypeConfigs[i].getAttribute(ATTRIBUTE_NAME);
-                this.resourceTypes.add(name);
-
-                String workflow = resourceTypeConfigs[i].getAttribute(ATTRIBUTE_WORKFLOW, null);
-                if (workflow != null) {
-                    this.resourceType2workflow.put(name, workflow);
+            Configuration resourceTypeConfig = config.getChild(ELEMENT_RESOURCE_TYPES);
+            if (resourceTypeConfig != null) {
+                Configuration[] resourceTypeConfigs = resourceTypeConfig.getChildren(ELEMENT_RESOURCE_TYPE);
+                for (int i = 0; i < resourceTypeConfigs.length; i++) {
+                    String name = resourceTypeConfigs[i].getAttribute(ATTRIBUTE_NAME);
+                    this.resourceTypes.add(name);
+    
+                    String workflow = resourceTypeConfigs[i].getAttribute(ATTRIBUTE_WORKFLOW, null);
+                    if (workflow != null) {
+                        this.resourceType2workflow.put(name, workflow);
+                    }
                 }
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org