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 2006/07/06 17:07:43 UTC
svn commit: r419572 -
/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java
Author: andreas
Date: Thu Jul 6 08:07:43 2006
New Revision: 419572
URL: http://svn.apache.org/viewvc?rev=419572&view=rev
Log:
PublicationTemplateFallbackModule uses fallback:// source. Now it works with modules.copy=false.
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java?rev=419572&r1=419571&r2=419572&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationTemplateFallbackModule.java Thu Jul 6 08:07:43 2006
@@ -20,6 +20,7 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.excalibur.source.SourceResolver;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationUtil;
import org.apache.lenya.cms.publication.templating.ExistingSourceResolver;
@@ -54,11 +55,8 @@
}
String resolvedUri = null;
- PublicationTemplateManager templateManager = null;
try {
- templateManager = (PublicationTemplateManager) this.manager.lookup(PublicationTemplateManager.ROLE);
- Publication publication;
String targetUri = null;
// check if publication ID is provided in attribute name
@@ -75,31 +73,24 @@
+ "]");
}
- publication = PublicationUtil.getPublication(this.manager, publicationId);
} else {
- publication = PublicationUtil.getPublication(this.manager, objectModel);
targetUri = name;
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("Publication resolved from request: [" + publication.getId()
- + "]");
- }
}
- if (publication.exists()) {
- ExistingSourceResolver resolver = new ExistingSourceResolver();
- templateManager.visit(publication, targetUri, resolver);
- resolvedUri = resolver.getURI();
- } else {
- //outside of a publication
- resolvedUri = "context://" + targetUri;
+
+ SourceResolver resolver = null;
+ try {
+ resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
+ resolvedUri = resolver.resolveURI("fallback://" + targetUri).getURI();
+ } finally {
+ if (resolver != null) {
+ this.manager.release(resolver);
+ }
}
+
} catch (final Exception e) {
String message = "Resolving path [" + name + "] failed: ";
getLogger().error(message, e);
throw new ConfigurationException(message, e);
- } finally {
- if (templateManager != null) {
- this.manager.release(templateManager);
- }
}
return resolvedUri;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org