svn commit: r676562 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Jul 14 05:10:36 2008
New Revision: 676562

URL: http://svn.apache.org/viewvc?rev=676562&view=rev
Log:
Reverting change: Check SiteSource existence when requested with format parameter based on repository source, not SitemapSource (was not the real cause of the NPE).

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java?rev=676562&r1=676561&r2=676562&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java Mon Jul 14 05:10:36 2008
@@ -51,7 +51,6 @@
 
     private ServiceManager manager;
     private Source delegate;
-    private Source repositorySource;
     private String scheme;
     private String uri;
 
@@ -108,9 +107,6 @@
 
             if (site.contains(path, language)) {
                 Document doc = site.getNode(path).getLink(language).getDocument();
-                String lenyaURL = doc.getSourceURI();
-                Session session = RepositoryUtil.getSession(this.manager, request);
-                this.repositorySource = new RepositorySource(manager, lenyaURL, session, getLogger());
 
                 if (locationSteps.hasMoreTokens()) {
                     Query query = new Query(locationSteps.nextToken());
@@ -120,7 +116,9 @@
                     }
                 }
                 if (this.delegate == null) {
-                    this.delegate = this.repositorySource;
+                    String lenyaURL = doc.getSourceURI();
+                    Session session = RepositoryUtil.getSession(this.manager, request);
+                    this.delegate = new RepositorySource(manager, lenyaURL, session, getLogger());
                 }
             }
 
@@ -130,7 +128,7 @@
     }
     
     public boolean exists() {
-        return this.repositorySource != null;
+        return this.delegate != null;
     }
 
     public long getContentLength() {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.