roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r428830 - in /incubator/roller/branches/roller_3.0: src/org/apache/roller/ui/rendering/model/ web/WEB-INF/velocity/ web/WEB-INF/velocity/templates/feeds/
Date Fri, 04 Aug 2006 18:30:55 GMT
Author: snoopdave
Date: Fri Aug  4 11:30:54 2006
New Revision: 428830

URL: http://svn.apache.org/viewvc?rev=428830&view=rev
Log:
New utilitie method escapeXML for use in feeds

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/feeds.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
Fri Aug  4 11:30:54 2006
@@ -227,6 +227,14 @@
         return StringEscapeUtils.unescapeHtml(str);
     }
     
+    public static String escapeXML(String str) {
+        return StringEscapeUtils.escapeXml(str);
+    }
+    
+    public static String unescapeXML(String str) {
+        return StringEscapeUtils.unescapeXml(str);
+    }
+    
     public static String replace(String src, String target, String rWith) {
         return StringUtils.replace(src, target, rWith);
     }

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/feeds.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/feeds.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/feeds.vm (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/feeds.vm Fri Aug  4 11:30:54
2006
@@ -29,14 +29,14 @@
     #foreach($entry in $entries)
     <entry>
         <id>$entry.permalink</id>
-        <title type="html">$utils.escapeHTML($entry.title)</title>
+        <title type="html">$utils.escapeXML($entry.title)</title>
         <author><name>$entry.creator.fullName</name></author>
         <link rel="alternate" type="text/html" href="$entry.permalink"/>
         <published>$utils.formatIso8601Date($entry.pubTime)</published>
         <updated>$utils.formatIso8601Date($entry.updateTime)</updated> 
-        <category term="$utils.escapeHTML($entry.category.path)" label="$utils.escapeHTML($entry.category.name)"
/>
-        #if( $utils.isNotEmpty($entry.summary))<summary type="html">$utils.escapeHTML($entry.transformedSummary)</summary>#end
-        #if( $utils.isNotEmpty($entry.text) )<content type="html">$utils.escapeHTML($entry.transformedText)</content>#end
+        <category term="$utils.escapeXML($entry.category.path)" label="$utils.escapeXML($entry.category.name)"
/>
+        #if( $utils.isNotEmpty($entry.summary))<summary type="html">$utils.escapeXML($entry.transformedSummary)</summary>#end
+        #if( $utils.isNotEmpty($entry.text) )<content type="html">$utils.escapeXML($entry.transformedText)</content>#end
         #set( $mc_url = $entry.findEntryAttribute("att_mediacast_url") )
         #set( $mc_type = $entry.findEntryAttribute("att_mediacast_type") )
         #set( $mc_length = $entry.findEntryAttribute("att_mediacast_length") )
@@ -52,17 +52,17 @@
   #foreach($entry in $entries)
   <item>
     <guid isPermaLink="true">$entry.permalink</guid>
-    <title>$utils.escapeHTML($utils.removeHTML($entry.title))</title>
-    <dc:creator>$utils.escapeHTML($entry.creator.fullName)</dc:creator>
+    <title>$utils.escapeXML($utils.removeHTML($entry.title))</title>
+    <dc:creator>$utils.escapeXML($entry.creator.fullName)</dc:creator>
     <link>$entry.permalink</link>
     #if( $entry.link && !$entry.link.trim().equals("") )
-    <source url="$utils.escapeHTML($entry.link)">$utils.escapeHTML($entry.link)</source>
+    <source url="$utils.escapeXML($entry.link)">$utils.escapeXML($entry.link)</source>
     #end
     <pubDate>$utils.formatRfc822Date($entry.pubTime)</pubDate>
-    <category>$utils.escapeHTML($entry.category.name)</category>
-    #if( $utils.isNotEmpty($entry.summary) && $utils.isNotEmpty($entry.text))<atom:summary
type="html">$utils.escapeHTML($entry.transformedSummary)</atom:summary>#end
-    #if( $utils.isNotEmpty($entry.summary) && $utils.isEmpty($entry.text))<description>$utils.escapeHTML($entry.transformedText)</description>#end
-    #if( $utils.isNotEmpty($entry.text) )<description>$utils.escapeHTML($entry.transformedText)</description>#end
+    <category>$utils.escapeXML($entry.category.name)</category>
+    #if( $utils.isNotEmpty($entry.summary) && $utils.isNotEmpty($entry.text))<atom:summary
type="html">$utils.escapeXML($entry.transformedSummary)</atom:summary>#end
+    #if( $utils.isNotEmpty($entry.summary) && $utils.isEmpty($entry.text))<description>$utils.escapeXML($entry.transformedText)</description>#end
+    #if( $utils.isNotEmpty($entry.text) )<description>$utils.escapeXML($entry.transformedText)</description>#end
     #set( $mc_url = $entry.findEntryAttribute("att_mediacast_url") )
     #set( $mc_type = $entry.findEntryAttribute("att_mediacast_type") )
     #set( $mc_length = $entry.findEntryAttribute("att_mediacast_length") )
@@ -81,15 +81,15 @@
     #foreach($comment in $comments)
     <entry>
         <id>$url.comment($comment.weblogEntry.anchor, $comment.timestamp)</id>

-        <title type="html">Re: $utils.escapeHTML($comment.weblogEntry.title)</title>
-        <author><name>$utils.escapeHTML($utils.removeHTML($comment.name))</name></author>
+        <title type="html">Re: $utils.escapeXML($comment.weblogEntry.title)</title>
+        <author><name>$utils.escapeXML($utils.removeHTML($comment.name))</name></author>
         <link rel="alternate" type="text/html" href="$url.comment($comment.weblogEntry.anchor,
$comment.timestamp)"/>
         <published>$utils.formatIso8601Date($comment.postTime)</published>
         <updated>$utils.formatIso8601Date($comment.postTime)</updated> 
-        #if($config.commentEscapeHtml)
-            #set($content = $utils.escapeHTML($utils.removeHTML($comment.content)))
+        #if($config.commentescapeXML)
+            #set($content = $utils.escapeXML($utils.removeHTML($comment.content)))
         #else 
-            #set($content = $utils.escapeHTML($utils.transformToHTMLSubset($utils.escapeHTML($comment.content))))
+            #set($content = $utils.escapeXML($utils.transformToHTMLSubset($utils.escapeXML($comment.content))))
         #end
         #if($config.commentAutoFormat)
             #set($content = $utils.autoformat($content))
@@ -104,13 +104,13 @@
     #foreach($comment in $comments)
     <item>
         <guid isPermaLink="true">$url.comment($comment.weblogEntry.anchor, $comment.timestamp)</guid>
-        <title>Re: $utils.escapeHTML($comment.weblogEntry.title)</title>
-        <dc:creator>$utils.escapeHTML($utils.removeHTML($comment.name))</dc:creator>
+        <title>Re: $utils.escapeXML($comment.weblogEntry.title)</title>
+        <dc:creator>$utils.escapeXML($utils.removeHTML($comment.name))</dc:creator>
         <pubDate>$utils.formatRfc822Date($comment.postTime)</pubDate>
-        #if($config.commentEscapeHtml)
-            #set($content = $utils.escapeHTML($utils.removeHTML($comment.content)))
+        #if($config.commentescapeXML)
+            #set($content = $utils.escapeXML($utils.removeHTML($comment.content)))
         #else 
-            #set($content = $utils.escapeHTML($utils.transformToHTMLSubset($utils.escapeHTML($comment.content))))
+            #set($content = $utils.escapeXML($utils.transformToHTMLSubset($utils.escapeXML($comment.content))))
         #end
         #if($config.commentAutoFormat)
             #set($content = $utils.autoformat($content))

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-atom.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
Fri Aug  4 11:30:54 2006
@@ -18,7 +18,7 @@
 *#<?xml version="1.0" encoding='utf-8'?>
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 <feed xmlns="http://www.w3.org/2005/Atom">
-    <title type="html">$utils.escapeHTML($config.siteName) (Comments)</title>
+    <title type="html">$utils.escapeXML($config.siteName) (Comments)</title>
     <id>$url.feed.comments.atom</id>
     <link rel="alternate" type="text/html" href="$url.home" />
     <id>$url.feed.comments.atom($model.categoryPath, $model.excerpts)</id>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-rss.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
Fri Aug  4 11:30:54 2006
@@ -21,10 +21,10 @@
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:atom="http://www.w3.org/2005/Atom" >
 <channel>
-  <title>$utils.escapeHTML($config.siteName) (Comments)</title>
+  <title>$utils.escapeXML($config.siteName) (Comments)</title>
   <link>$url.absoluteSite</link>
   <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.atom($model.categoryPath,
$model.excerpts)" />
-  <description>$utils.escapeHTML($config.siteDescription)</description>
+  <description>$utils.escapeXML($config.siteDescription)</description>
   <language>en-us</language>
   <copyright>Copyright $utils.formatDate($model.weblog.lastModified, "yyyy")</copyright>
   <lastBuildDate>$utils.formatRfc822Date($model.weblog.lastModified)</lastBuildDate>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-atom.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
Fri Aug  4 11:30:54 2006
@@ -18,8 +18,8 @@
 *#<?xml version="1.0" encoding='utf-8'?>
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 <feed xmlns="http://www.w3.org/2005/Atom">
-    <title type="html">$utils.escapeHTML($config.siteName)</title>
-    <subtitle type="html">$utils.escapeHTML($config.siteDescription)</subtitle>
+    <title type="html">$utils.escapeXML($config.siteName)</title>
+    <subtitle type="html">$utils.escapeXML($config.siteDescription)</subtitle>
     <id>$url.absoluteSite</id>
     <link rel="alternate" type="text/html" href="$url.absoluteSite" />
     <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryPath,
$model.excerpts)" />

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-rss.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
Fri Aug  4 11:30:54 2006
@@ -21,10 +21,10 @@
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:atom="http://www.w3.org/2005/Atom" >
 <channel>
-  <title>$utils.escapeHTML($config.siteName)</title>
+  <title>$utils.escapeXML($config.siteName)</title>
   <link>$url.absoluteSite</link>
   <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryPath,
$model.excerpts)" />
-  <description>$utils.escapeHTML($config.siteDescription)</description>
+  <description>$utils.escapeXML($config.siteDescription)</description>
   <language>en-us</language>
   <copyright>Copyright $utils.formatDate($model.weblog.lastModified, "yyyy")</copyright>
   <lastBuildDate>$utils.formatRfc822Date($model.weblog.lastModified)</lastBuildDate>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
Fri Aug  4 11:30:54 2006
@@ -18,7 +18,7 @@
 *#<?xml version="1.0" encoding='utf-8'?>
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 <feed xmlns="http://www.w3.org/2005/Atom">
-    <title type="html">$utils.escapeHTML($model.weblog.name) (Comments)</title>
+    <title type="html">$utils.escapeXML($model.weblog.name) (Comments)</title>
     <id>$url.feed.comments.atom</id>
     <link rel="alternate" type="text/html" href="$url.home" />
     <link rel="self" type="application/atom+xml" href="$url.feed.comments.atom($model.categoryPath,
$model.excerpts)" />

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
Fri Aug  4 11:30:54 2006
@@ -21,10 +21,10 @@
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:atom="http://www.w3.org/2005/Atom" >
 <channel>
-  <title>$utils.escapeHTML($utils.removeHTML($model.weblog.name)) (Comments)</title>
+  <title>$utils.escapeXML($utils.removeHTML($model.weblog.name)) (Comments)</title>
   <link>$url.home</link>
   <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.rss($model.categoryPath,
$model.excerpts)" />
-  <description>$utils.escapeHTML($model.weblog.description)</description>
+  <description>$utils.escapeXML($model.weblog.description)</description>
   <language>en-us</language>
   <copyright>Copyright $utils.formatDate($model.weblog.lastModified, "yyyy")</copyright>
   <lastBuildDate>$utils.formatRfc822Date($model.weblog.lastModified)</lastBuildDate>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
Fri Aug  4 11:30:54 2006
@@ -18,8 +18,8 @@
 *#<?xml version="1.0" encoding='utf-8'?>
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 <feed xmlns="http://www.w3.org/2005/Atom">
-    <title type="html">$utils.escapeHTML($model.weblog.name)</title>
-    <subtitle type="html">$utils.escapeHTML($model.weblog.description)</subtitle>
+    <title type="html">$utils.escapeXML($model.weblog.name)</title>
+    <subtitle type="html">$utils.escapeXML($model.weblog.description)</subtitle>
     <id>$url.feed.entries.atom</id>
     <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryPath,
$model.excerpts)" />
     <link rel="alternate" type="text/html" href="$url.home" />

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm?rev=428830&r1=428829&r2=428830&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
Fri Aug  4 11:30:54 2006
@@ -21,10 +21,10 @@
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:atom="http://www.w3.org/2005/Atom" >
 <channel>
-  <title>$utils.escapeHTML($utils.removeHTML($model.weblog.name))</title>
+  <title>$utils.escapeXML($utils.removeHTML($model.weblog.name))</title>
   <link>$url.home</link>
   <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryPath,
$model.excerpts)" />
-  <description>$utils.escapeHTML($model.weblog.description)</description>
+  <description>$utils.escapeXML($model.weblog.description)</description>
   <language>en-us</language>
   <copyright>Copyright $utils.formatDate($model.weblog.lastModified, "yyyy")</copyright>
   <lastBuildDate>$utils.formatRfc822Date($model.weblog.lastModified)</lastBuildDate>



Mime
View raw message