roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r475847 - /incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java
Date Thu, 16 Nov 2006 18:22:24 GMT
Author: snoopdave
Date: Thu Nov 16 10:22:23 2006
New Revision: 475847

URL: http://svn.apache.org/viewvc?view=rev&rev=475847
Log:
Better date and content/summary handling in ROME->Roller conversion

Modified:
    incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java

Modified: incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java?view=diff&rev=475847&r1=475846&r2=475847
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java Thu Nov
16 10:22:23 2006
@@ -109,11 +109,16 @@
             setAuthor(entrydc.getCreator()); // use <dc:creator>
         }
         
-        // Play some games to get the date too
+        // Play some games to get the published date too
+        if (romeEntry.getUpdatedDate() != null) {
+            setUpdateTime(new Timestamp(romeEntry.getUpdatedDate().getTime()));
+        }          
         if (romeEntry.getPublishedDate() != null) {
             setPubTime(new Timestamp(romeEntry.getPublishedDate().getTime())); // use <pubDate>
         } else if (entrydc != null && entrydc.getDate() != null) {
             setPubTime(new Timestamp(entrydc.getDate().getTime())); // use <dc:date>
+        } else {
+            setPubTime(getUpdateTime());
         }
         
         // get content and unescape if it is 'text/plain'
@@ -126,11 +131,10 @@
             }
         }
         
-        // no content, then try <content:encoded>
+        // no content, try summary
         if (getText() == null || getText().trim().length() == 0) {
-            ContentModule cm = (ContentModule)romeEntry.getModule(ContentModule.URI);
-            if (cm != null) {
-                setText(StringEscapeUtils.unescapeHtml(cm.getEncoded()));
+            if (romeEntry.getDescription() != null) {
+                setText(romeEntry.getDescription().getValue());
             }
         }
         



Mime
View raw message