You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by wo...@apache.org on 2010/03/25 16:04:47 UTC

svn commit: r927437 - in /portals/applications/rss/trunk: rss-jar/ rss-jar/src/main/java/org/apache/portals/applications/rss/ rss-jar/src/test/ rss-jar/src/test/java/ rss-jar/src/test/java/org/ rss-jar/src/test/java/org/apache/ rss-jar/src/test/java/or...

Author: woonsan
Date: Thu Mar 25 15:04:46 2010
New Revision: 927437

URL: http://svn.apache.org/viewvc?rev=927437&view=rev
Log:
APA-32: Adding disable-output-escape option with a test case.

Added:
    portals/applications/rss/trunk/rss-jar/src/test/
    portals/applications/rss/trunk/rss-jar/src/test/java/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/
    portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java   (with props)
    portals/applications/rss/trunk/rss-jar/src/test/resources/
    portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml   (with props)
    portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl   (with props)
    portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml   (with props)
Modified:
    portals/applications/rss/trunk/rss-jar/pom.xml
    portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RSSPortlet.java
    portals/applications/rss/trunk/rss-war/pom.xml
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/xsl/rss.xsl

Modified: portals/applications/rss/trunk/rss-jar/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/pom.xml?rev=927437&r1=927436&r2=927437&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-jar/pom.xml (original)
+++ portals/applications/rss/trunk/rss-jar/pom.xml Thu Mar 25 15:04:46 2010
@@ -40,6 +40,7 @@
     <rome.version>0.8</rome.version>
     <jdom.version>1.0</jdom.version>
     <slf4j.version>1.5.6</slf4j.version>
+    <junit.version>3.8.1</junit.version>
   </properties>
 
   <!-- Dependencies -->
@@ -140,7 +141,45 @@
       <artifactId>jdom</artifactId>
       <version>${jdom.version}</version>
     </dependency>
-
+    
+    <!-- Test dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>junit-addons</groupId>
+          <artifactId>junit-addons-runner</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>${spring.version}</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>${slf4j.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+      <version>${slf4j.version}</version>
+      <scope>test</scope>
+    </dependency>
+    
   </dependencies>
   
   <build>

Modified: portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RSSPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RSSPortlet.java?rev=927437&r1=927436&r2=927437&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RSSPortlet.java (original)
+++ portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RSSPortlet.java Thu Mar 25 15:04:46 2010
@@ -39,6 +39,8 @@ import javax.xml.parsers.DocumentBuilder
 
 import org.apache.portals.applications.transform.TransformCacheEntry;
 import org.apache.portals.applications.util.Streams;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -54,7 +56,8 @@ import org.xml.sax.InputSource;
  */
 public class RSSPortlet extends AbstractRssPortlet implements EntityResolver
 {
-
+    private static Logger log = LoggerFactory.getLogger(RSSPortlet.class);
+    
     private Document document = null;
 
     private Map stylesheets = null;
@@ -97,9 +100,9 @@ public class RSSPortlet extends Abstract
         }
         catch (IOException x)
         {
-            System.err.println("Entity Resolution error: ( " + publicId + " Taking " + systemId + " from cache throwed Exception: " + x);
-
+            log.error("Entity Resolution error: ( " + publicId + " Taking " + systemId + " from cache throwed Exception: " + x);
         }
+        
         return null;
     }
 
@@ -186,7 +189,8 @@ public class RSSPortlet extends Abstract
                 parameters.put("showdescription", prefs.getValue("showdescription", "true"));
                 parameters.put("showtitle", prefs.getValue("showtitle", "true"));
                 parameters.put("showtextinput", prefs.getValue("showtextinput", "true"));
-                           
+                parameters.put("disableescape", prefs.getValue("disableescape", "false"));
+                
                 StringWriter sw= new StringWriter();
                 transform.transform(realStylesheet, source, sw, parameters); //response.getPortletOutputStream(), parameters);
                 Streams.drain(new StringReader(sw.toString()), response.getWriter());

Added: portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java?rev=927437&view=auto
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java (added)
+++ portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java Thu Mar 25 15:04:46 2010
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.applications.rss;
+
+import java.io.IOException;
+import java.util.ListResourceBundle;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletPreferences;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import junit.framework.TestCase;
+
+import org.apache.portals.applications.rss.servlets.SpringInitServlet;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.DefaultResourceLoader;
+import org.springframework.mock.web.MockServletConfig;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.mock.web.portlet.MockPortletConfig;
+import org.springframework.mock.web.portlet.MockPortletContext;
+import org.springframework.mock.web.portlet.MockPortletPreferences;
+import org.springframework.mock.web.portlet.MockRenderRequest;
+import org.springframework.mock.web.portlet.MockRenderResponse;
+
+/**
+ * TestRSSPortlet
+ * 
+ * @version $Id$
+ */
+public class TestRSSPortlet extends TestCase
+{
+    private static final String TEST_LINE_ESCAPED = "&lt;em&gt;NOTE: DO NOT DELETE THIS LINE! USED IN TEST CASE!!&lt;/em&gt;";
+    private static final String TEST_LINE_UNESCAPED = "<em>NOTE: DO NOT DELETE THIS LINE! USED IN TEST CASE!!</em>";
+    
+    private ServletContext servletContext;
+    private ServletConfig servletConfig;
+    private SpringInitServlet springInitServlet;
+    
+    private PortletContext portletContext;
+    private PortletConfig portletConfig;
+    private RSSPortlet rssPortlet;
+    
+    @Override
+    public void setUp()
+    {
+        servletContext = new MockServletContext(new DefaultResourceLoader());
+        servletConfig = new MockServletConfig(servletContext);
+        ((MockServletConfig) servletConfig).addInitParameter("spring-configuration", "/test-spring-init-servlet-beans.xml");
+        
+        springInitServlet = new SpringInitServlet();
+        
+        try
+        {
+            springInitServlet.init(servletConfig);
+        }
+        catch (ServletException e)
+        {
+            fail("Failed to initialize spring init servlet: " + e);
+        }
+        
+        portletContext = new MockPortletContext(new DefaultResourceLoader());
+        portletConfig = new MockPortletConfig(portletContext);
+        ((MockPortletConfig) portletConfig).addInitParameter("stylesheet", "/test-rss.xsl");
+        ResourceBundle bundle = new ListResourceBundle()
+        {
+            protected Object[][] getContents() 
+            {
+                return new Object[][] {
+                    {"javax.portlet.title", "RSS Portlet"},
+                    {"javax.portlet.short-title", "RSS"},
+                    {"javax.portlet.keywords", "My RSS Portlet"}
+                };
+            }
+        };
+        ((MockPortletConfig) portletConfig).setResourceBundle(Locale.ENGLISH, bundle);
+        
+        rssPortlet = new RSSPortlet();
+        
+        try
+        {
+            rssPortlet.init(portletConfig);
+        }
+        catch (PortletException e)
+        {
+            fail("Failed to initialize rss portlet: " + e);
+        }
+    }
+    
+    @Override
+    public void tearDown()
+    {
+        rssPortlet.destroy();
+        springInitServlet.destroy();
+    }
+    
+    public void testEscapedResult() throws PortletException, IOException
+    {
+        PortletPreferences preferences = new MockPortletPreferences();
+        ((MockPortletPreferences) preferences).setValue("url", new ClassPathResource("/test-rss.xml").getURL().toString());
+        ((MockPortletPreferences) preferences).setValue("itemdisplayed", "15");
+        ((MockPortletPreferences) preferences).setValue("openinpopup", "true");
+        ((MockPortletPreferences) preferences).setValue("showdescription", "true");
+        ((MockPortletPreferences) preferences).setValue("showtitle", "true");
+        ((MockPortletPreferences) preferences).setValue("showtextinput", "true");
+        ((MockPortletPreferences) preferences).setValue("minrefresh", "900");
+        ((MockPortletPreferences) preferences).setValue("disableescape", "false");
+        
+        MockRenderRequest request = new MockRenderRequest(portletContext);
+        request.setPreferences(preferences);
+        request.addLocale(Locale.ENGLISH);
+        MockRenderResponse response = new MockRenderResponse();
+        
+        rssPortlet.render(request, response);
+        rssPortlet.cache.clearCache();
+        
+        System.out.println("The output:");
+        String content = response.getContentAsString();
+        System.out.println("" + content);
+        
+        assertTrue("The test line missing: " + TEST_LINE_ESCAPED, content.contains(TEST_LINE_ESCAPED));
+    }
+    
+    public void testUnescapedResult() throws PortletException, IOException
+    {
+        PortletPreferences preferences = new MockPortletPreferences();
+        ((MockPortletPreferences) preferences).setValue("url", new ClassPathResource("/test-rss.xml").getURL().toString());
+        ((MockPortletPreferences) preferences).setValue("itemdisplayed", "15");
+        ((MockPortletPreferences) preferences).setValue("openinpopup", "true");
+        ((MockPortletPreferences) preferences).setValue("showdescription", "true");
+        ((MockPortletPreferences) preferences).setValue("showtitle", "true");
+        ((MockPortletPreferences) preferences).setValue("showtextinput", "true");
+        ((MockPortletPreferences) preferences).setValue("minrefresh", "900");
+        ((MockPortletPreferences) preferences).setValue("disableescape", "true");
+        
+        MockRenderRequest request = new MockRenderRequest(portletContext);
+        request.setPreferences(preferences);
+        request.addLocale(Locale.ENGLISH);
+        MockRenderResponse response = new MockRenderResponse();
+        
+        rssPortlet.render(request, response);
+        rssPortlet.cache.clearCache();
+        
+        System.out.println("The output:");
+        String content = response.getContentAsString();
+        System.out.println("" + content);
+        
+        assertTrue("The test line missing: " + TEST_LINE_UNESCAPED, content.contains(TEST_LINE_UNESCAPED));
+    }
+}

Propchange: portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/applications/rss/trunk/rss-jar/src/test/java/org/apache/portals/applications/rss/TestRSSPortlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml?rev=927437&view=auto
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml (added)
+++ portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml Thu Mar 25 15:04:46 2010
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with this
+  work for additional information regarding copyright ownership. The ASF
+  licenses this file to You under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+  or agreed to in writing, software distributed under the License is
+  distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the specific language
+  governing permissions and limitations under the License. $Id:$
+-->
+<rss version="0.91">
+  <channel>
+    <title>Welcome to Apache Portals Applications</title>
+    <link>http://portals.apache.org/applications/</link>
+    <description>
+      Apache Portals Applications (APA) is a collaborative software development project.
+      &lt;em&gt;NOTE: DO NOT DELETE THIS LINE! USED IN TEST CASE!!&lt;/em&gt;
+      APA is dedicated to providing robust, full-featured, commercial-quality, 
+      and freely available Portlet Applications under the Apache license developed 
+      at the Apache Software Foundation.
+    </description>
+    <language>en-us</language>
+
+    <lastBuildDate>Thu, 25 Mar 25 13:55:33 CET</lastBuildDate>
+    <copyright>Copyright: (C) 2010 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</copyright>
+    <docs>http://portals.apache.org/applications/</docs>
+
+    <image>
+      <title>Apache Portals</title>
+      <url>http://portals.apache.org/applications/images/apache-portals.gif</url>
+      <link>http://portals.apache.org/</link>
+    </image>
+  </channel>
+</rss>

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl?rev=927437&view=auto
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl (added)
+++ portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl Thu Mar 25 15:04:46 2010
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="iso-8859-1"?> 
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+Author:  Kevin A Burton (burton@apache.org)
+Author:  Santiago Gala (sgala@hisitech.com)
+Author:  Rapha묠Luta (raphael@apache.org)
+Author:  Paul Spencer (paulspencer@mindspring.com)
+$Id$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+                xmlns:downlevel="http://my.netscape.com/rdf/simple/0.9/"
+                exclude-result-prefixes="downlevel rdf"
+                version="1.0">
+
+    <xsl:output indent="yes" 
+                method="html"
+                omit-xml-declaration="yes"/>                
+
+    <xsl:param name="itemdisplayed" select="number(15)"/>
+    <xsl:param name="openinpopup" select="'false'"/>
+    <xsl:param name="showdescription" select="'true'"/>
+    <xsl:param name="showtitle" select="'true'"/>
+    <xsl:param name="showtextinput" select="'true'"/>
+    <xsl:param name="disableescape" select="'false'" />
+
+    <xsl:template match="/rss">
+      <div>
+        <xsl:apply-templates select="channel"/>
+      </div>
+    </xsl:template>
+
+    <xsl:template match="/rdf:RDF">
+      <div>
+        <xsl:apply-templates select="downlevel:channel"/>
+      </div>
+    </xsl:template>
+
+    <xsl:template match="channel">
+      <xsl:variable name="description" select="description"/>    
+      <xsl:if test="$showtitle = 'true' and $description">
+        <p>
+          <xsl:apply-templates select="image|../image" mode="channel"/>
+          <xsl:choose>
+            <xsl:when test="$disableescape = 'true'">
+              <xsl:value-of select="$description" disable-output-escaping="yes"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$description"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </p>
+      </xsl:if>
+      <ul>
+        <xsl:apply-templates select="item[$itemdisplayed&gt;=position()]"/>
+      </ul>
+      <xsl:if test="$showtextinput = 'true'">
+        <xsl:apply-templates select="textinput"/>
+      </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="downlevel:channel">
+      <xsl:variable name="description" select="downlevel:description"/>
+      <xsl:if test="$showtitle = 'true' and $description">
+        <p>
+        <xsl:choose>
+          <xsl:when test="count(../downlevel:image)">
+            <xsl:apply-templates select="../downlevel:image" mode="channel"/>
+            <xsl:choose>
+              <xsl:when test="$disableescape = 'true'">
+                <xsl:value-of select="$description" disable-output-escaping="yes"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$description"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <a>
+              <xsl:attribute name="href"><xsl:value-of select="downlevel:link"/></xsl:attribute>
+              <xsl:if test="$openinpopup = 'true'">
+                <xsl:attribute name="target">_blank</xsl:attribute>
+              </xsl:if>
+              <xsl:choose>
+                <xsl:when test="$disableescape = 'true'">
+                  <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="$description"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </a>
+          </xsl:otherwise>
+        </xsl:choose>
+        </p>
+      </xsl:if>
+      <ul>
+        <xsl:apply-templates select="../downlevel:item[$itemdisplayed&gt;=position()]"/>
+      </ul>
+      <xsl:if test="$showtextinput = 'true'">
+        <xsl:apply-templates select="downlevel:textinput"/>
+      </xsl:if>
+    </xsl:template>
+    
+    <xsl:template match="item">
+      <xsl:variable name="description" select="description"/>
+      <li>
+        <a>
+          <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
+          <xsl:if test="$openinpopup = 'true'">
+            <xsl:attribute name="target">_blank</xsl:attribute>
+          </xsl:if>
+          <xsl:value-of select="title"/>
+        </a>
+        <xsl:if test="$showdescription = 'true' and $description">
+          <br/><xsl:choose>
+                 <xsl:when test="$disableescape = 'true'">
+                   <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                 </xsl:when>
+                 <xsl:otherwise>
+                   <xsl:value-of select="$description"/>
+                 </xsl:otherwise>
+               </xsl:choose>
+        </xsl:if>
+      </li>
+    </xsl:template>
+    
+    <xsl:template match="downlevel:item">
+      <xsl:variable name="description" select="downlevel:description"/>
+      <li>
+        <a>
+         <xsl:attribute name="href"><xsl:value-of select="downlevel:link"/></xsl:attribute>
+          <xsl:if test="$openinpopup = 'true'">
+            <xsl:attribute name="target">_blank</xsl:attribute>
+          </xsl:if>
+         <xsl:value-of select="downlevel:title"/>
+        </a>
+        <xsl:if test="$showdescription = 'true' and $description">
+          <br/><xsl:choose>
+                 <xsl:when test="$disableescape = 'true'">
+                   <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                 </xsl:when>
+                 <xsl:otherwise>
+                   <xsl:value-of select="$description"/>
+                 </xsl:otherwise>
+               </xsl:choose>
+        </xsl:if>
+      </li>
+    </xsl:template>
+    
+    <xsl:template match="textinput">
+      <form action="{link}">
+        <xsl:value-of select="description"/><br/>
+        <input type="text" name="{name}" value=""/>
+        <input type="submit" name="submit" value="{title}"/>
+      </form>
+    </xsl:template>
+
+    <xsl:template match="downlevel:textinput">
+      <form action="{downlevel:link}">
+        <xsl:value-of select="downlevel:description"/><br/>
+        <input type="text" name="{downlevel:name}" value=""/>
+        <input type="submit" name="submit" value="{downlevel:title}"/>
+      </form>
+    </xsl:template>
+    
+    <xsl:template match="image" mode="channel">
+      <a>
+        <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
+        <xsl:if test="$openinpopup = 'true'">
+          <xsl:attribute name="target">_blank</xsl:attribute>
+        </xsl:if>
+        <xsl:element name="img">
+          <xsl:attribute name="align">right</xsl:attribute>
+          <xsl:attribute name="border">0</xsl:attribute>
+          <xsl:if test="title">
+            <xsl:attribute name="alt">
+              <xsl:value-of select="title"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:if test="url">
+            <xsl:attribute name="src">
+              <xsl:value-of select="url"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:if test="width">
+            <xsl:attribute name="width">
+              <xsl:value-of select="width"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:if test="height">
+            <xsl:attribute name="height">
+              <xsl:value-of select="height"/>
+            </xsl:attribute>
+          </xsl:if>
+        </xsl:element>
+      </a>
+    </xsl:template>
+
+    <xsl:template match="downlevel:image" mode="channel">
+      <a>
+        <xsl:attribute name="href"><xsl:value-of select="downlevel:link"/></xsl:attribute>
+        <xsl:if test="$openinpopup = 'true'">
+          <xsl:attribute name="target">_blank</xsl:attribute>
+        </xsl:if>
+        <xsl:element name="img">
+          <xsl:attribute name="align">right</xsl:attribute>
+          <xsl:attribute name="border">0</xsl:attribute>
+          <xsl:if test="downlevel:title">
+            <xsl:attribute name="alt">
+              <xsl:value-of select="downlevel:title"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:if test="downlevel:url">
+            <xsl:attribute name="src">
+              <xsl:value-of select="downlevel:url"/>
+            </xsl:attribute>
+          </xsl:if>
+        </xsl:element>
+      </a>  
+    </xsl:template>
+
+    <!-- We ignore images unless we are inside a channel -->    
+    <xsl:template match="image">
+    </xsl:template>
+    <xsl:template match="downlevel:image">
+    </xsl:template>
+    
+</xsl:stylesheet>

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-rss.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml?rev=927437&view=auto
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml (added)
+++ portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml Thu Mar 25 15:04:46 2010
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE beans PUBLIC  "-//SPRING//DTD BEAN//EN"
+ "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+    <description>Spring Portlet Components</description>
+
+  <!-- Transform -->
+  <bean id="transform" 
+  	   class="org.apache.portals.applications.transform.impl.JetspeedTransform" 
+   >
+  </bean>
+
+  <bean id="transformCache" 
+  	   class="org.apache.portals.applications.transform.impl.MemoryTransformCache" 
+   >
+       <constructor-arg index="0">
+			<ref bean="transform"/>
+		</constructor-arg>       
+  	   <!-- cache size -->
+  	   <constructor-arg index="1"><value>100</value></constructor-arg>
+  	   <!-- eviction percentage -->
+  	   <constructor-arg index="2"><value>10</value></constructor-arg>
+  	   <!-- enable cache -->
+  	   <constructor-arg index="3"><value>true</value></constructor-arg>
+  	   <!-- debug flag -->
+  	   <constructor-arg index="4"><value>true</value></constructor-arg>
+
+  </bean>
+    
+    
+</beans>
\ No newline at end of file

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/applications/rss/trunk/rss-jar/src/test/resources/test-spring-init-servlet-beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/applications/rss/trunk/rss-war/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/pom.xml?rev=927437&r1=927436&r2=927437&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/pom.xml (original)
+++ portals/applications/rss/trunk/rss-war/pom.xml Thu Mar 25 15:04:46 2010
@@ -94,11 +94,13 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <version>${slf4j.version}</version>
+      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
       <version>${slf4j.version}</version>
+      <scope>runtime</scope>
     </dependency>
   </dependencies>
 

Modified: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml?rev=927437&r1=927436&r2=927437&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml Thu Mar 25 15:04:46 2010
@@ -1,511 +1,548 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
+  <!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version
+    2.0 (the "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
+    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    applicable law or agreed to in writing, software distributed under
+    the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+    OR CONDITIONS OF ANY KIND, either express or implied. See the
+    License for the specific language governing permissions and
+    limitations under the License.
+  -->
 <portlet-app id="apa-rss"
-  xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+  version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
 
-<portlet id="RSS">
-    <description>RSS is a simple XML-based system that allows users to subscribe to their favorite websites. 
-        Using RSS, content is stored into a standardized format, which can be viewed and organized 
-        through RSS-aware software or automatically conveyed as new content on another website or portal.</description>
+  <portlet id="RSS">
+    <description>RSS is a simple XML-based system that allows users
+      to subscribe to their favorite websites.
+      Using RSS, content is stored into a standardized format, which can be
+      viewed and organized
+      through RSS-aware software or automatically conveyed as new content on
+      another website or portal.</description>
     <portlet-name>RSS</portlet-name>
-    <display-name>RSS Portlet</display-name>    
-    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>    
+    <display-name>RSS Portlet</display-name>
+    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>		
-	<init-param>
-      <description>Default RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>Default RSS Transform XSLT</description>
       <name>stylesheet</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>HTML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>HTML RSS Transform XSLT</description>
       <name>stylesheet.text/html</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>WML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>WML RSS Transform XSLT</description>
       <name>stylesheet.text/vnd.wap.wml</name>
       <value>/WEB-INF/xsl/rss-wml.xsl</value>
-	</init-param>		
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>internet-news-reader.png</value>
-    </init-param>    
+      <name>portlet-icon</name>
+      <value>internet-news-reader.png</value>
+    </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	 
-      <portlet-mode>HELP</portlet-mode>	  	  	   
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>es</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>News</title>
       <short-title>RSS</short-title>
       <keywords>news,RSS,syndication</keywords>
-    </portlet-info>	
-	<portlet-preferences>	
-		<preference>
-			<name>url</name>
-			<value>http://www.npr.org/rss/rss.php?topicId=2</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>minrefresh</name>
-			<value>900</value>		
-		</preference>	
-	</portlet-preferences>				
-</portlet>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>http://www.npr.org/rss/rss.php?topicId=2</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>minrefresh</name>
+        <value>900</value>
+      </preference>
+      <preference>
+        <name>disableescape</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
-<portlet id="RomeRSS">
-    <description>RSS is a simple XML-based system that allows users to subscribe to their favorite websites. 
-        Using RSS, content is stored into a standardized format, which can be viewed and organized 
-        through RSS-aware software or automatically conveyed as new content on another website or portal.</description>    
+  <portlet id="RomeRSS">
+    <description>RSS is a simple XML-based system that allows users
+      to subscribe to their favorite websites.
+      Using RSS, content is stored into a standardized format, which can be
+      viewed and organized
+      through RSS-aware software or automatically conveyed as new content on
+      another website or portal.</description>
     <portlet-name>RomeRSS</portlet-name>
     <display-name>Rome RSS Portlet</display-name>
-    <portlet-class>org.apache.portals.applications.rss.RomeRSSPortlet</portlet-class>    
-	<init-param>
-		<name>AllowPreferences</name>
-		<value>true</value>
-	</init-param>
-	<init-param>
-		<name>ViewPage</name>
-		<value>/WEB-INF/view/view.vm</value>
-	</init-param>	
+    <portlet-class>org.apache.portals.applications.rss.RomeRSSPortlet</portlet-class>
+    <init-param>
+      <name>AllowPreferences</name>
+      <value>true</value>
+    </init-param>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/view.vm</value>
+    </init-param>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>			
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>internet-news-reader.png</value>
+      <name>portlet-icon</name>
+      <value>internet-news-reader.png</value>
     </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	  
-      <portlet-mode>HELP</portlet-mode>	  	  
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>RSS(R)</title>
       <short-title>RSS</short-title>
       <keywords>news,RSS,atom,syndication</keywords>
-    </portlet-info>	
-	<portlet-preferences>
-		<preference>
-			<name>url</name>
-			<value>http://www.npr.org/rss/rss.php?topicId=4</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>false</value>		
-		</preference>		
-	</portlet-preferences>		
-</portlet>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>http://www.npr.org/rss/rss.php?topicId=4</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
-<portlet id="BBCFootballNews">
-    <description>This is an RSS feed from the BBC Sport website for the latest football (soccer) news. 
-     RSS feeds allow you to stay up to date with the latest news and features you want from BBC Sport..</description>    
+  <portlet id="BBCFootballNews">
+    <description>This is an RSS feed from the BBC Sport website for
+      the latest football (soccer) news.
+      RSS feeds allow you to stay up to date with the latest news and features
+      you want from BBC Sport..</description>
     <portlet-name>BBCFootballNews</portlet-name>
     <display-name>Football (Soccer) Sports News from the BBC</display-name>
-    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>    
+    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>		
-	<init-param>
-      <description>Default RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>Default RSS Transform XSLT</description>
       <name>stylesheet</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>HTML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>HTML RSS Transform XSLT</description>
       <name>stylesheet.text/html</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>WML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>WML RSS Transform XSLT</description>
       <name>stylesheet.text/vnd.wap.wml</name>
       <value>/WEB-INF/xsl/rss-wml.xsl</value>
-	</init-param>		
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>bbcnews.png</value>
-    </init-param>    
+      <name>portlet-icon</name>
+      <value>bbcnews.png</value>
+    </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	 
-      <portlet-mode>HELP</portlet-mode>	  	  	   
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>es</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>BBC Football News</title>
       <short-title>Football</short-title>
       <keywords>sports,football,soccer,RSS,syndication</keywords>
-    </portlet-info>	
-	<portlet-preferences>	
-		<preference>
-			<name>url</name>
-			<value>http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>minrefresh</name>
-			<value>900</value>		
-		</preference>	
-	</portlet-preferences>				
-</portlet>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>
+          http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>minrefresh</name>
+        <value>900</value>
+      </preference>
+      <preference>
+        <name>disableescape</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
-<portlet id="NFLNews">
-    <description>This is an RSS feed from the ESPN website for the latest NFL American football news. 
-     RSS feeds allow you to stay up to date with the latest news and headlines from ESPN.</description>    
+  <portlet id="NFLNews">
+    <description>This is an RSS feed from the ESPN website for the
+      latest NFL American football news.
+      RSS feeds allow you to stay up to date with the latest news and
+      headlines from ESPN.</description>
     <portlet-name>NFLNews</portlet-name>
     <display-name>Football (American) Sports News from ESPN</display-name>
-    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>    
+    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>		
-	<init-param>
-      <description>Default RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>Default RSS Transform XSLT</description>
       <name>stylesheet</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>HTML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>HTML RSS Transform XSLT</description>
       <name>stylesheet.text/html</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>WML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>WML RSS Transform XSLT</description>
       <name>stylesheet.text/vnd.wap.wml</name>
       <value>/WEB-INF/xsl/rss-wml.xsl</value>
-	</init-param>		
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>nfl.png</value>
-    </init-param>    
+      <name>portlet-icon</name>
+      <value>nfl.png</value>
+    </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	 
-      <portlet-mode>HELP</portlet-mode>	  	  	   
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>es</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>NFL News</title>
       <short-title>NFL</short-title>
       <keywords>sports,football,NFL,RSS,syndication</keywords>
-    </portlet-info>	
-	<portlet-preferences>	
-		<preference>
-			<name>url</name>
-			<value>http://sports.espn.go.com/espn/rss/nfl/news</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>minrefresh</name>
-			<value>900</value>		
-		</preference>	
-	</portlet-preferences>				
-</portlet>
-    
-<portlet id="TechNews">
-    <description>Latest Technology Industry News from the BBC in RSS format.
-     RSS feeds allow you to stay up to date with the latest news and headlines from BBC.</description>    
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>http://sports.espn.go.com/espn/rss/nfl/news</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>minrefresh</name>
+        <value>900</value>
+      </preference>
+      <preference>
+        <name>disableescape</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
+
+  <portlet id="TechNews">
+    <description>Latest Technology Industry News from the BBC in
+      RSS format.
+      RSS feeds allow you to stay up to date with the latest news and
+      headlines from BBC.</description>
     <portlet-name>TechNews</portlet-name>
     <display-name>Latest Technology News</display-name>
-    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>    
+    <portlet-class>org.apache.portals.applications.rss.RSSPortlet</portlet-class>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>		
-	<init-param>
-      <description>Default RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>Default RSS Transform XSLT</description>
       <name>stylesheet</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>HTML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>HTML RSS Transform XSLT</description>
       <name>stylesheet.text/html</name>
       <value>/WEB-INF/xsl/rss.xsl</value>
-	</init-param>
-	<init-param>
-      <description>WML RSS Transform XSLT</description>        
+    </init-param>
+    <init-param>
+      <description>WML RSS Transform XSLT</description>
       <name>stylesheet.text/vnd.wap.wml</name>
       <value>/WEB-INF/xsl/rss-wml.xsl</value>
-	</init-param>		
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>bbcnews.png</value>
-    </init-param>    
+      <name>portlet-icon</name>
+      <value>bbcnews.png</value>
+    </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	 
-      <portlet-mode>HELP</portlet-mode>	  	  	   
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>es</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>Technology news</title>
       <short-title>Tech</short-title>
-      <keywords>news,tech,technology,computer,software,IT,IS,RSS,syndication</keywords>
-    </portlet-info>	
-	<portlet-preferences>	
-		<preference>
-			<name>url</name>
-			<value>http://news.bbc.co.uk/rss/newsonline_uk_edition/technology/rss.xml</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>minrefresh</name>
-			<value>900</value>		
-		</preference>	
-	</portlet-preferences>				
-</portlet>
+      <keywords>
+        news,tech,technology,computer,software,IT,IS,RSS,syndication</keywords>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>
+          http://news.bbc.co.uk/rss/newsonline_uk_edition/technology/rss.xml</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>minrefresh</name>
+        <value>900</value>
+      </preference>
+      <preference>
+        <name>disableescape</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
-<portlet id="StockMarketNews">
-    <description>Latest Stock Market and Financial News from Yahoo RSS news feeds.</description>    
+  <portlet id="StockMarketNews">
+    <description>Latest Stock Market and Financial News from Yahoo
+      RSS news feeds.</description>
     <portlet-name>StockMarketNews</portlet-name>
     <display-name>Stock Market News</display-name>
-    <portlet-class>org.apache.portals.applications.rss.RomeRSSPortlet</portlet-class>    
-	<init-param>
-		<name>AllowPreferences</name>
-		<value>true</value>
-	</init-param>
-	<init-param>
-		<name>ViewPage</name>
-		<value>/WEB-INF/view/view.vm</value>
-	</init-param>	
+    <portlet-class>org.apache.portals.applications.rss.RomeRSSPortlet</portlet-class>
+    <init-param>
+      <name>AllowPreferences</name>
+      <value>true</value>
+    </init-param>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/view.vm</value>
+    </init-param>
     <init-param>
       <name>HelpPage</name>
       <value>/WEB-INF/view/rss-help.html</value>
-    </init-param>	
+    </init-param>
     <init-param>
       <name>EditPage</name>
       <value>/WEB-INF/view/edit-prefs.vm</value>
-    </init-param>			
+    </init-param>
     <init-param>
-        <name>portlet-icon</name>
-        <value>utilities-system-monitor.png</value>
+      <name>portlet-icon</name>
+      <value>utilities-system-monitor.png</value>
     </init-param>
     <expiration-cache>1200</expiration-cache>
     <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>	  
-      <portlet-mode>HELP</portlet-mode>	  	  
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
     </supports>
     <supports>
       <mime-type>text/vnd.wap.wml</mime-type>
-      <portlet-mode>VIEW</portlet-mode>	  
-	</supports>	
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>fr</supported-locale>
-    <resource-bundle>org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
+    <resource-bundle>
+      org.apache.portals.applications.rss.resources.RssResources</resource-bundle>
     <portlet-info>
       <title>Stock Market News</title>
       <short-title>Market News</short-title>
       <keywords>news,RSS,stock,market,finance,financial,business</keywords>
-    </portlet-info>	
-	<portlet-preferences>
-		<preference>
-			<name>url</name>
-			<value>http://rss.news.yahoo.com/rss/stocks</value>		
-		</preference>	
-		<preference>
-			<name>itemdisplayed</name>
-			<value>15</value>		
-		</preference>
-		<preference>
-			<name>openinpopup</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showdescription</name>
-			<value>true</value>		
-		</preference>	
-		<preference>
-			<name>showtitle</name>
-			<value>true</value>		
-		</preference>
-		<preference>
-			<name>showtextinput</name>
-			<value>false</value>		
-		</preference>		
-	</portlet-preferences>		
-</portlet>
+    </portlet-info>
+    <portlet-preferences>
+      <preference>
+        <name>url</name>
+        <value>http://rss.news.yahoo.com/rss/stocks</value>
+      </preference>
+      <preference>
+        <name>itemdisplayed</name>
+        <value>15</value>
+      </preference>
+      <preference>
+        <name>openinpopup</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showdescription</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtitle</name>
+        <value>true</value>
+      </preference>
+      <preference>
+        <name>showtextinput</name>
+        <value>false</value>
+      </preference>
+    </portlet-preferences>
+  </portlet>
 
   <custom-portlet-mode>
     <description>Custom About Mode</description>

Modified: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/xsl/rss.xsl
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/xsl/rss.xsl?rev=927437&r1=927436&r2=927437&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/xsl/rss.xsl (original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/xsl/rss.xsl Thu Mar 25 15:04:46 2010
@@ -29,15 +29,16 @@ $Id$
                 exclude-result-prefixes="downlevel rdf"
                 version="1.0">
 
-     <xsl:output indent="yes" 
-                 method="html"
-                 omit-xml-declaration="yes"/>                
+    <xsl:output indent="yes" 
+                method="html"
+                omit-xml-declaration="yes"/>                
 
     <xsl:param name="itemdisplayed" select="number(15)"/>
     <xsl:param name="openinpopup" select="'false'"/>
     <xsl:param name="showdescription" select="'true'"/>
     <xsl:param name="showtitle" select="'true'"/>
     <xsl:param name="showtextinput" select="'true'"/>
+    <xsl:param name="disableescape" select="'false'" />
 
     <xsl:template match="/rss">
       <div>
@@ -56,7 +57,14 @@ $Id$
       <xsl:if test="$showtitle = 'true' and $description">
         <p>
           <xsl:apply-templates select="image|../image" mode="channel"/>
-          <xsl:value-of select="$description"/>            
+          <xsl:choose>
+            <xsl:when test="$disableescape = 'true'">
+              <xsl:value-of select="$description" disable-output-escaping="yes"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$description"/>
+            </xsl:otherwise>
+          </xsl:choose>
         </p>
       </xsl:if>
       <ul>
@@ -72,19 +80,33 @@ $Id$
       <xsl:if test="$showtitle = 'true' and $description">
         <p>
         <xsl:choose>
-         <xsl:when test="count(../downlevel:image)">
-          <xsl:apply-templates select="../downlevel:image" mode="channel"/>
-          <xsl:value-of select="$description"/>
-         </xsl:when>
-         <xsl:otherwise>
-          <a>
-           <xsl:attribute name="href"><xsl:value-of select="downlevel:link"/></xsl:attribute>
-           <xsl:if test="$openinpopup = 'true'">
-            <xsl:attribute name="target">_blank</xsl:attribute>
-           </xsl:if>
-           <xsl:value-of select="$description"/>
-          </a>
-         </xsl:otherwise>
+          <xsl:when test="count(../downlevel:image)">
+            <xsl:apply-templates select="../downlevel:image" mode="channel"/>
+            <xsl:choose>
+              <xsl:when test="$disableescape = 'true'">
+                <xsl:value-of select="$description" disable-output-escaping="yes"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$description"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <a>
+              <xsl:attribute name="href"><xsl:value-of select="downlevel:link"/></xsl:attribute>
+              <xsl:if test="$openinpopup = 'true'">
+                <xsl:attribute name="target">_blank</xsl:attribute>
+              </xsl:if>
+              <xsl:choose>
+                <xsl:when test="$disableescape = 'true'">
+                  <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="$description"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </a>
+          </xsl:otherwise>
         </xsl:choose>
         </p>
       </xsl:if>
@@ -107,7 +129,14 @@ $Id$
           <xsl:value-of select="title"/>
         </a>
         <xsl:if test="$showdescription = 'true' and $description">
-          <br/><xsl:value-of select="$description"/>
+          <br/><xsl:choose>
+                 <xsl:when test="$disableescape = 'true'">
+                   <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                 </xsl:when>
+                 <xsl:otherwise>
+                   <xsl:value-of select="$description"/>
+                 </xsl:otherwise>
+               </xsl:choose>
         </xsl:if>
       </li>
     </xsl:template>
@@ -123,7 +152,14 @@ $Id$
          <xsl:value-of select="downlevel:title"/>
         </a>
         <xsl:if test="$showdescription = 'true' and $description">
-          <br/><xsl:value-of select="$description"/>
+          <br/><xsl:choose>
+                 <xsl:when test="$disableescape = 'true'">
+                   <xsl:value-of select="$description" disable-output-escaping="yes"/>
+                 </xsl:when>
+                 <xsl:otherwise>
+                   <xsl:value-of select="$description"/>
+                 </xsl:otherwise>
+               </xsl:choose>
         </xsl:if>
       </li>
     </xsl:template>
@@ -207,6 +243,3 @@ $Id$
     </xsl:template>
     
 </xsl:stylesheet>
-
-
-