You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2004/11/29 02:28:17 UTC
svn commit: r106873 - in forrest/trunk/plugins/feeder: . resources/stylesheets src/documentation/content/xdocs src/documentation/content/xdocs/samples src/documentation/content/xdocs/samples/aggregate
Author: rgardler
Date: Sun Nov 28 17:28:16 2004
New Revision: 106873
URL: http://svn.apache.org/viewcvs?view=rev&rev=106873
Log:
Changed the way we identify feeds, now embedded in a feedDescritpor
file. This file can later be used to control the rendering of the feed,
for example, limit the number of items displayed, add a disclaimer etc.
Added:
forrest/trunk/plugins/feeder/resources/stylesheets/feedDesc2RSS20.xsl (contents, props changed)
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateDescriptor.xml
- copied, changed from r106721, forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregate/demoAggregation.xml
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/feedDescriptor.xml (contents, props changed)
Removed:
forrest/trunk/plugins/feeder/resources/stylesheets/aggregateToRSS20.xsl
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregate/
Modified:
forrest/trunk/plugins/feeder/input.xmap
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml
forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml
forrest/trunk/plugins/feeder/status.xml
Modified: forrest/trunk/plugins/feeder/input.xmap
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/input.xmap?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/input.xmap&r1=106872&p2=forrest/trunk/plugins/feeder/input.xmap&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/input.xmap (original)
+++ forrest/trunk/plugins/feeder/input.xmap Sun Nov 28 17:28:16 2004
@@ -25,20 +25,17 @@
<map:pipelines>
<map:pipeline>
- <map:match pattern="feeder/**/**.xml">
- <map:generate src="http://{1}/{2}"/>
+ <map:match pattern="feeder/*.xml">
+ <map:generate src="{project:content.xdocs}/{1}.xml"/>
+ <map:transform src="{forrest:plugins}/feeder/resources/stylesheets/feedDesc2RSS20.xsl"/>
<map:transform src="{forrest:plugins}/feeder/resources/stylesheets/rss2document.xsl"/>
<map:serialize type="xml"/>
</map:match>
- </map:pipeline>
-
- <map:pipeline>
- <map:match pattern="feederAggregate/**.xml">
- <map:generate src="{project:content.xdocs}/{1}.xml"/>
- <map:transform src="{forrest:plugins}/feeder/resources/stylesheets/aggregateToRSS20.xsl"/>
- <!-- FIXME: previous transform produces bad XML
- <map:transform src="{forrest:plugins}/feeder/resources/stylesheets/rss2document.xsl"/>
- -->
+
+ <map:match pattern="**/feeder/*.xml">
+ <map:generate src="{project:content.xdocs}/{1}/{2}.xml"/>
+ <map:transform src="{forrest:plugins}/feeder/resources/stylesheets/feedDesc2RSS20.xsl"/>
+ <map:transform src="{forrest:plugins}/feeder/resources/stylesheets/rss2document.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
Deleted: /forrest/trunk/plugins/feeder/resources/stylesheets/aggregateToRSS20.xsl
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/resources/stylesheets/aggregateToRSS20.xsl?view=auto&rev=106872
==============================================================================
Added: forrest/trunk/plugins/feeder/resources/stylesheets/feedDesc2RSS20.xsl
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/resources/stylesheets/feedDesc2RSS20.xsl?view=auto&rev=106873
==============================================================================
--- (empty file)
+++ forrest/trunk/plugins/feeder/resources/stylesheets/feedDesc2RSS20.xsl Sun Nov 28 17:28:16 2004
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation
+
+ Licensed 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.
+-->
+<!--
+Stylesheet for generating an aggregated feed from multple feeds.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+ <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
+
+ <xsl:template match="feedDescriptor">
+ <rss version="2.0">
+ <xsl:apply-templates/>
+ </rss>
+ </xsl:template>
+
+ <xsl:template match="feed">
+ <xsl:variable name="url" select="url"/>
+ <xsl:variable name="feed" select="document($url)"/>
+ <xsl:apply-templates select="$feed/rss/channel"/>
+ </xsl:template>
+
+ <xsl:template match="@*|*|text()|processing-instruction()|comment()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|*|text()|processing-instruction()|comment()"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
Copied: forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateDescriptor.xml (from r106721, forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregate/demoAggregation.xml)
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateDescriptor.xml?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregate/demoAggregation.xml&r1=106721&p2=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateDescriptor.xml&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregate/demoAggregation.xml (original)
+++ forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateDescriptor.xml Sun Nov 28 17:28:16 2004
@@ -14,11 +14,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<aggregateDescriptor>
- <feed id="planetApache">
- <url>http://www.planetapache.org/rss20.xml</url>
- </feed>
- <feed id="planetJava">
- <url>http://planetjava.org/rss.php</url>
- </feed>
-</aggregateDescriptor>
+<feedDescriptor>
+<feed id="planetApache">
+ <url>http://www.planetapache.org/rss20.xml</url>
+</feed>
+<feed id="planetJava">
+ <url>http://planetjava.org/rss.php</url>
+</feed>
+</feedDescriptor>
Modified: forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml&r1=106872&p2=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml (original)
+++ forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/aggregateFeed.xml Sun Nov 28 17:28:16 2004
@@ -21,38 +21,27 @@
</header>
<body>
- <warning>This functionlaity is not yet complete, if you make it work please
- submit a patch.</warning>
-
<p>This sample shows how a number of different feeds can be aggregated
- into a single feed and then displayed in a Forrest site. In order to do
- this you must first create an aggregate descriptor file and then
- create a link in the following format:</p>
-
- <source>
-<a href="/feederAggregate/path/aggregateDescriptor.typeExtension">Feed Link Text</a>
- </source>
-
- <section>
- <title>Aggregate Descriptor File</title>
- <p>The aggregate descriptor file is an XML doucment that describes the
- feeds that you want to collate into a single document. It has the
- following format:</p>
-
- <source><![CDATA[
-<aggregateDescriptor>
+ into a single feed and then displayed in a Forrest site. Creating an
+ aggregated feed is no different to embedding a
+ <a href="singleFeed.xml">single feed</a>. Simply add more feeds into your
+ feed descriptor file and then link to it in the same way.</p>
+
+ <p>For example:</p>
+
+ <source><![CDATA[
+<feedDescriptor>
<feed id="planetApache">
<url>http://www.planetapache.org/rss20.xml</url>
</feed>
<feed id="planetJava">
<url>http://planetjava.org/rss.php</url>
</feed>
-</aggregateDescriptor>
+</feedDescriptor>
]]></source>
- <p><a href="/feederAggregate/samples/aggregate/demoAggregation.xml">Take a
+ <p><a href="/samples/feeder/aggregateDescriptor.xml">Take a
look</a> at what the above file produces.</p>
- </section>
</body>
</document>
Added: forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/feedDescriptor.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/feedDescriptor.xml?view=auto&rev=106873
==============================================================================
--- (empty file)
+++ forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/feedDescriptor.xml Sun Nov 28 17:28:16 2004
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation
+
+ Licensed 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.
+-->
+<feedDescriptor>
+ <feed id="planetApache">
+ <url>http://www.planetapache.org/rss20.xml</url>
+ </feed>
+</feedDescriptor>
Modified: forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml&r1=106872&p2=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml (original)
+++ forrest/trunk/plugins/feeder/src/documentation/content/xdocs/samples/singleFeed.xml Sun Nov 28 17:28:16 2004
@@ -22,21 +22,32 @@
<body>
<p>This sample shows how a single RSS feed can be converted to an XDoc and
- included in a Forrest site. In order to do this simply create a link
- with the following format:</p>
+ included in a Forrest site. In order to do this you must first create a
+ <code>feedDescriptor</code> file. This describes all the feeds that your
+ project knows about. A simple example is:</p>
- <source>
-<a href="/feeder/feed.domain.com/path/to/feed.rss.typeExtension">Feed Link Text</a>
- </source>
-
- <p>For example, an href of
- <code>/feeder/www.planetapache.org/rss20.xml.html</code> will retrieve the
- rss feed from <code>http://www.planetapache.org/rss20.xml</code> and
- render it as and HTML document whilst an href of
- <code>/feeder/www.planetapache.org/rss20.xml.html</code> will generate a
- PDF, <a href="/feeder/www.planetapache.org/rss20.xml.html">Try it</a>.
- </p>
+ <source><![CDATA[
+<feedDescriptor>
+ <feed id="planetApache">
+ <url>http://www.planetapache.org/rss20.xml</url>
+ </feed>
+</feedDescriptor>
+ ]]></source>
+ <p>In order to embed the data from the <code>planetApache</code> feed
+ you create a link in the following form:</p>
+
+ <source><a href="PATH_TO_FEED_DESCRIPTOR/feeder/FEED_DESCRIPTOR_NAME.EXTENSION></source>
+
+ <p>In this URL you must replace <code>PATH_TO_FEED_DESCRIPTOR</code>
+ with the directory path to your feed descriptor file,
+ <code>FEED_DESCRIPTOR_NAME</code> with the name of the descriptor file,
+ and <code>EXTENSION</code> with the extension indicating the format you
+ want the feed to be delivered in (i.e. html, pdf etc.)</p>
+
+ <p>For example <a href="/samples/feeder/feedDescriptor.html">/samples/feeder/feedDescriptor.html</a>
+ will display the feed shown above.</p>
+
<warning>The way URLs are structured is due to change in the near future,
use at your own risk (see Forrest mailing lists for discussion).</warning>
</body>
Modified: forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml&r1=106872&p2=forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml (original)
+++ forrest/trunk/plugins/feeder/src/documentation/content/xdocs/site.xml Sun Nov 28 17:28:16 2004
@@ -40,7 +40,7 @@
<samples label="Samples" href="samples/" tab="samples">
<index label="Index" href="index.html" description="An index of the available samples"/>
<singleFeed label="Single Feed" href="singleFeed.html" description="An example of a single feed in a Forrest page"/>
- <aggregate label="Aggregate Feed" href="index.html" description="An example of an aggregate feed in a Forrest page"/>
+ <aggregate label="Aggregate Feed" href="aggregateFeed.html" description="An example of an aggregate feed in a Forrest page"/>
</samples>
<!--
Modified: forrest/trunk/plugins/feeder/status.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/feeder/status.xml?view=diff&rev=106873&p1=forrest/trunk/plugins/feeder/status.xml&r1=106872&p2=forrest/trunk/plugins/feeder/status.xml&r2=106873
==============================================================================
--- forrest/trunk/plugins/feeder/status.xml (original)
+++ forrest/trunk/plugins/feeder/status.xml Sun Nov 28 17:28:16 2004
@@ -30,6 +30,11 @@
automatically be used for entries of type <foo>. -->
<action dev="RDG" type="add" context="admin">
+ Changed the way we identify feeds, now embedded in a feedDescritpor
+ file. This file can later be used to control the rendering of the feed,
+ for example, limit the number of items displayed, add a disclaimer etc.
+ </action>
+ <action dev="RDG" type="add" context="admin">
Initial Import
</action>
<!-- Sample action: