You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/04/30 16:24:50 UTC
svn commit: r533756 -
/lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
Author: andreas
Date: Mon Apr 30 07:24:50 2007
New Revision: 533756
URL: http://svn.apache.org/viewvc?view=rev&rev=533756
Log:
Remove original templates before adding new template. This fixes bug 42279.
Modified:
lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
Modified: lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java?view=diff&rev=533756&r1=533755&r2=533756
==============================================================================
--- lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java (original)
+++ lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java Mon Apr 30 07:24:50 2007
@@ -28,6 +28,7 @@
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
+import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.MutableConfiguration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
@@ -193,6 +194,10 @@
protected void addTemplateConfiguration(Publication template, DefaultConfiguration config)
throws ConfigurationException {
+ Configuration[] templateConfigs = config.getChildren(ELEMENT_TEMPLATE);
+ for (int i = 0; i < templateConfigs.length; i++) {
+ config.removeChild(templateConfigs[i]);
+ }
DefaultConfiguration templateConfig = new DefaultConfiguration(ELEMENT_TEMPLATE, null,
CONFIGURATION_NAMESPACE, "");
templateConfig.setAttribute(ATTRIBUTE_ID, template.getId());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org