svn commit: r620051 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Fri Feb  8 16:17:48 2008
New Revision: 620051

URL: http://svn.apache.org/viewvc?rev=620051&view=rev
Log:
Simplified validity resolving in LenyaMetaDataGenerator - use validity of the source instead of generating a timestamp validity.

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java?rev=620051&r1=620050&r2=620051&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/generation/LenyaMetaDataGenerator.java Fri Feb  8 16:17:48 2008
@@ -84,6 +84,8 @@
     
     /** The repository content holder to generate the meta data for */
     private ContentHolder content;
+    
+    private SourceValidity validity;
 
     /**
      * Recycle this component. All instance variables are set to <code>null</code>.
@@ -92,6 +94,7 @@
         this.content = null;
         this.src = null;
         this.parser = null;
+        this.validity = null;
         super.recycle();
     }
     
@@ -121,6 +124,7 @@
         try {
             source = (RepositorySource) resolver.resolveURI(src);
             this.content = source.getContent();
+            this.validity = source.getValidity();
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
@@ -147,14 +151,7 @@
      *         not cacheable.
      */
     public SourceValidity getValidity() {
-        long lastModified;
-        try {
-            lastModified = this.content.getLastModified();
-        } catch (Exception e) {
-            getLogger().error("Error determining last modification date", e);
-            return null;
-        }
-        return new TimeStampValidity(lastModified);
+        return this.validity;
     }
 
     /**
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.