roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r395408 - in /incubator/roller/trunk: src/org/roller/util/Utilities.java web/WEB-INF/classes/flavors/atom.vm web/WEB-INF/classes/flavors/rss.vm
Date Wed, 19 Apr 2006 22:08:41 GMT
Author: snoopdave
Date: Wed Apr 19 15:08:40 2006
New Revision: 395408

URL: http://svn.apache.org/viewcvs?rev=395408&view=rev
Log:
Show entry.summary as RSS <description> or Atom <content> if there is no entry.text

Modified:
    incubator/roller/trunk/src/org/roller/util/Utilities.java
    incubator/roller/trunk/web/WEB-INF/classes/flavors/atom.vm
    incubator/roller/trunk/web/WEB-INF/classes/flavors/rss.vm

Modified: incubator/roller/trunk/src/org/roller/util/Utilities.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/util/Utilities.java?rev=395408&r1=395407&r2=395408&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/util/Utilities.java (original)
+++ incubator/roller/trunk/src/org/roller/util/Utilities.java Wed Apr 19 15:08:40 2006
@@ -73,11 +73,17 @@
     private static final Pattern QUOTE_PATTERN = Pattern.compile("&quot;", Pattern.CASE_INSENSITIVE);
   
     /**
-     * Utility methods for calling StringUtils since it cannot be
-     * instantiated and Utilties can.
+     * Test if string is not null and and not empty.
      */
     public static boolean isNotEmpty(String str) {
         return StringUtils.isNotEmpty(str);
+    }
+    
+    /**
+     * Test if string is null or empty.
+     */
+    public static boolean isEmpty(String str) {
+        return StringUtils.isEmpty(str);
     }
     
     //------------------------------------------------------------------------

Modified: incubator/roller/trunk/web/WEB-INF/classes/flavors/atom.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/flavors/atom.vm?rev=395408&r1=395407&r2=395408&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/flavors/atom.vm (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/flavors/atom.vm Wed Apr 19 15:08:40 2006
@@ -30,7 +30,8 @@
         <published>$utilities.formatIso8601Date($entry.pubTime)</published>
         <updated>$utilities.formatIso8601Date($entry.updateTime)</updated> 
         <category term="$utilities.textToHTML($entry.category.path, true)" label="$utilities.textToHTML($entry.category.name,
true)" />
-        #if( $utilities.isNotEmpty($entry.summary) )<summary type="html">#showEntrySummary($entry)</summary>#end
+        #if( $utilities.isNotEmpty($entry.summary) && $utilities.isNotEmpty($entry.text))<summary
type="html">#showEntrySummary($entry)</summary>#end
+        #if( $utilities.isNotEmpty($entry.summary) && $utilities.isEmpty($entry.text))<content
type="html">#showEntrySummary($entry)</content>#end
         #if( $utilities.isNotEmpty($entry.text) )<content type="html">#showEntryContent($entry)</content>#end
         #set( $mc_url = $entry.findEntryAttribute("att_mediacast_url") )
         #set( $mc_type = $entry.findEntryAttribute("att_mediacast_type") )

Modified: incubator/roller/trunk/web/WEB-INF/classes/flavors/rss.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/flavors/rss.vm?rev=395408&r1=395407&r2=395408&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/flavors/rss.vm (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/flavors/rss.vm Wed Apr 19 15:08:40 2006
@@ -22,7 +22,8 @@
     #end
     <pubDate>$utilities.formatRfc822Date($entry.pubTime)</pubDate>
     <category>$utilities.textToHTML($entry.category.name,true)</category>
-    #if( $utilities.isNotEmpty($entry.summary) )<atom:summary type="html">#showEntrySummary($entry)</atom:summary>#end
   
+    #if( $utilities.isNotEmpty($entry.summary) && $utilities.isNotEmpty($entry.text))<summary
type="html">#showEntrySummary($entry)</summary>#end
+    #if( $utilities.isNotEmpty($entry.summary) && $utilities.isEmpty($entry.text))<description>#showEntrySummary($entry)</description>#end
     #if( $utilities.isNotEmpty($entry.text) )<description>#showEntryContent($entry)</description>#end
     #set( $mc_url = $entry.findEntryAttribute("att_mediacast_url") )
     #set( $mc_type = $entry.findEntryAttribute("att_mediacast_type") )



Mime
View raw message