roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject roller git commit: [ROL-2125] Add workaround to allow styled RSS and Atom feeds in Firefox, plus fix to boolean property handling logic.
Date Sun, 09 Dec 2018 22:00:07 GMT
Repository: roller
Updated Branches:
  refs/heads/roller-5.2.x 26764874b -> 94c9c2ac7


[ROL-2125] Add workaround to allow styled RSS and Atom feeds in Firefox, plus fix to boolean
property handling logic.


Project: http://git-wip-us.apache.org/repos/asf/roller/repo
Commit: http://git-wip-us.apache.org/repos/asf/roller/commit/94c9c2ac
Tree: http://git-wip-us.apache.org/repos/asf/roller/tree/94c9c2ac
Diff: http://git-wip-us.apache.org/repos/asf/roller/diff/94c9c2ac

Branch: refs/heads/roller-5.2.x
Commit: 94c9c2ac77eedbdaf5cd65cec082d5894eaac0c5
Parents: 2676487
Author: Dave Johnson <snoopdave@gmail.com>
Authored: Sun Dec 9 17:00:03 2018 -0500
Committer: Dave Johnson <snoopdave@gmail.com>
Committed: Sun Dec 9 17:00:03 2018 -0500

----------------------------------------------------------------------
 .../weblogger/ui/struts2/admin/GlobalConfig.java       | 13 +++++++------
 app/src/main/webapp/WEB-INF/velocity/feeds.vm          |  5 +++++
 .../velocity/templates/feeds/site-comments-atom.vm     |  1 +
 .../velocity/templates/feeds/site-comments-rss.vm      |  1 +
 .../velocity/templates/feeds/site-entries-atom.vm      |  1 +
 .../velocity/templates/feeds/site-entries-rss.vm       |  1 +
 .../velocity/templates/feeds/site-search-atom.vm       |  1 +
 .../velocity/templates/feeds/weblog-comments-atom.vm   |  1 +
 .../velocity/templates/feeds/weblog-comments-rss.vm    |  1 +
 .../velocity/templates/feeds/weblog-entries-atom.vm    |  1 +
 .../velocity/templates/feeds/weblog-entries-rss.vm     |  1 +
 .../velocity/templates/feeds/weblog-files-atom.vm      |  1 +
 .../velocity/templates/feeds/weblog-search-atom.vm     |  1 +
 13 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
index da71a41..0ee3641 100644
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
+++ b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
@@ -169,16 +169,17 @@ public class GlobalConfig extends UIAction implements ParameterAware,
ServletReq
             // it may not always be the case, but we should be okay for now
             // null check below needed w/Oracle
             if( updProp.getValue() != null
-                    && (updProp.getValue().equals("true") || updProp.getValue().equals("false")))
{
-                
-                if(incomingProp == null || !incomingProp.equals("on")) {
-                    incomingProp = "false";
+                    && (   updProp.getValue().equals("true") || updProp.getValue().equals("false")
+                        || updProp.getValue().equals("on")   || updProp.getValue().equals("off")
+                       )) {
+                if (incomingProp != null && (incomingProp.equalsIgnoreCase("true")
|| incomingProp.equalsIgnoreCase("on"))) {
+                    incomingProp = "true";
                 }
                 else {
-                    incomingProp = "true";
+                    incomingProp = "false";
                 }
             }
-            
+
             // only work on props that were submitted with the request
             if(incomingProp != null) {
                 log.debug("Setting new value for ["+propName+"]");

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/feeds.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/feeds.vm b/app/src/main/webapp/WEB-INF/velocity/feeds.vm
index 228e11e..065a548 100644
--- a/app/src/main/webapp/WEB-INF/velocity/feeds.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/feeds.vm
@@ -141,4 +141,9 @@
 #if($pager.prevLink && $pager.items.size() > 0)
     <link rel="previous" type="application/atom+xml" href="$utils.escapeXML($pager.prevLink)"
/>
 #end
+#end
+
+#macro(showFirefoxFeedWorkaround)
+<!-- 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
+-->
 #end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
index a7ce1fa..5cd92c4 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $site.getCommentsPager(-1, $config.feedSize) )
 <feed xmlns="http://www.w3.org/2005/Atom">

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
index 01ee0e7..b45c984 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding="utf-8"?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/rss.xsl"
media="screen"?>#end
 <rss version="2.0" 
   xmlns:dc="http://purl.org/dc/elements/1.1/"

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
index 84a43a9..73ad02f 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $site.getWeblogEntriesPager(-1, $config.feedSize))
 <feed xmlns="http://www.w3.org/2005/Atom">

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
index acfe54b..fa693f8 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding="utf-8"?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/rss.xsl"
media="screen"?>#end
 <rss version="2.0" 
   xmlns:dc="http://purl.org/dc/elements/1.1/"

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
index 510e77a..b18405c 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $model.searchResultsPager)
 <feed xmlns="http://www.w3.org/2005/Atom" 

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
index b923542..bda27a1 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $model.commentsPager)
 <feed xmlns="http://www.w3.org/2005/Atom">

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
index 0529875..8b3ad81 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding="utf-8"?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/rss.xsl"
media="screen"?>#end
 <rss version="2.0" 
   xmlns:dc="http://purl.org/dc/elements/1.1/"

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
index 7c8e4cf..eee05c3 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $model.weblogEntriesPager)
 <feed xmlns="http://www.w3.org/2005/Atom">

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
index 0be1bfe..0b70113 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding="utf-8"?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/rss.xsl"
media="screen"?>#end
 <rss version="2.0" 
   xmlns:dc="http://purl.org/dc/elements/1.1/"

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-files-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-files-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-files-atom.vm
index 5fdf545..95537d3 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-files-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-files-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $model.mediaFilesPager)
 <feed xmlns="http://www.w3.org/2005/Atom">

http://git-wip-us.apache.org/repos/asf/roller/blob/94c9c2ac/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
index 2efbc79..0e9d247 100644
--- a/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
@@ -16,6 +16,7 @@
   directory of this distribution.
 
 *#<?xml version="1.0" encoding='utf-8'?>
+#showFirefoxFeedWorkaround()
 #if($config.feedStyle)<?xml-stylesheet type="text/xsl" href="$url.absoluteSite/roller-ui/styles/atom.xsl"
media="screen"?>#end
 #set($pager = $model.searchResultsPager)
 <feed xmlns="http://www.w3.org/2005/Atom" 


Mime
View raw message