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/04/14 23:41:24 UTC
svn commit: r528878 -
/lenya/trunk/src/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
Author: nettings
Date: Sat Apr 14 14:41:23 2007
New Revision: 528878
URL: http://svn.apache.org/viewvc?view=rev&rev=528878
Log:
fixed publication instantiator (removed obsolete <templates/> element
from configuration)
new publications now work correctly.
thanks to jürgen ragaller for spotting this.
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=528878&r1=528877&r2=528878
==============================================================================
--- 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 Sat Apr 14 14:41:23 2007
@@ -72,7 +72,6 @@
private static final String CONFIGURATION_FILE = "config/publication.xconf";
private static final String CONFIGURATION_NAMESPACE = "http://apache.org/cocoon/lenya/publication/1.1";
private static final String ELEMENT_NAME = "name";
- private static final String ELEMENT_TEMPLATES = "templates";
private static final String ELEMENT_TEMPLATE = "template";
private static final String ATTRIBUTE_ID = "id";
private static final String ELEMENT_RESOURCE_TYPES = "resource-types";//*
@@ -188,19 +187,9 @@
}
protected void addTemplateConfiguration(Publication template, DefaultConfiguration config) throws ConfigurationException {
- MutableConfiguration templatesConfig = config.getMutableChild(ELEMENT_TEMPLATES, false);
- if (templatesConfig == null) {
- templatesConfig = new DefaultConfiguration(ELEMENT_TEMPLATES, null, CONFIGURATION_NAMESPACE, "");
- config.addChild(templatesConfig);
- } else {
- MutableConfiguration[] templateConfigs = templatesConfig.getMutableChildren(ELEMENT_TEMPLATE);
- for (int i = 0; i < templateConfigs.length; i++) {
- templatesConfig.removeChild(templateConfigs[i]);
- }
- }
DefaultConfiguration templateConfig = new DefaultConfiguration(ELEMENT_TEMPLATE, null, CONFIGURATION_NAMESPACE, "");
templateConfig.setAttribute(ATTRIBUTE_ID, template.getId());
- templatesConfig.addChild(templateConfig);
+ config.addChild(templateConfig);
}
protected void removeChildren(MutableConfiguration config, String name) throws ConfigurationException {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org